|
|
|
@ -1,10 +1,14 @@
|
|
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import md5 from 'md5';
|
|
|
|
|
import { requestProxy } from "./indexEduplus2RequestProxy";
|
|
|
|
|
import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString } from 'educoder';
|
|
|
|
|
import { notification } from 'antd';
|
|
|
|
|
import './index.css'
|
|
|
|
|
import './index.css';
|
|
|
|
|
const opens ="79e33abd4b6588941ab7622aed1e67e8";
|
|
|
|
|
let timestamp = Date.parse(new Date());
|
|
|
|
|
const newopens=md5(opens+timestamp)
|
|
|
|
|
broadcastChannelOnmessage('refreshPage', () => {
|
|
|
|
|
window.location.reload()
|
|
|
|
|
})
|
|
|
|
@ -91,20 +95,20 @@ export function initAxiosInterceptors(props) {
|
|
|
|
|
}
|
|
|
|
|
if(`${config[0]}`!=`true`){
|
|
|
|
|
if (window.location.port === "3007") {
|
|
|
|
|
// if (url.indexOf('.json') == -1) {
|
|
|
|
|
//
|
|
|
|
|
// alert('开发提示:请给接口加.json:' + url)
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
config.url = `${proxy}${url}`;
|
|
|
|
|
if (config.url.indexOf('?') == -1) {
|
|
|
|
|
config.url = `${config.url}?debug=${debugType}`;
|
|
|
|
|
config.url = `${config.url}?debug=${debugType}&openkey=${newopens}`;
|
|
|
|
|
} else {
|
|
|
|
|
config.url = `${config.url}&debug=${debugType}`;
|
|
|
|
|
config.url = `${config.url}&debug=${debugType}&openkey=${newopens}`;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// 加api前缀
|
|
|
|
|
config.url = url;
|
|
|
|
|
if (config.url.indexOf('?') == -1) {
|
|
|
|
|
config.url = `${config.url}?openkey=${newopens}`;
|
|
|
|
|
} else {
|
|
|
|
|
config.url = `${config.url}&openkey=${newopens}`;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
@ -191,6 +195,11 @@ export function initAxiosInterceptors(props) {
|
|
|
|
|
locationurl('/500');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (response.data.status === 501) {
|
|
|
|
|
notification.warning({
|
|
|
|
|
description:response.data.message || '访问异常,请求不合理',
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (response.data.status === 402) {
|
|
|
|
|