Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_tpm_ui
杨树林 5 years ago
commit 2d995ddfba

@ -6,6 +6,7 @@ import { requestProxy } from "./indexEduplus2RequestProxy";
import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString } from 'educoder';
import { notification } from 'antd';
import './index.css';
const $ = window.$;
const opens ="79e33abd4b6588941ab7622aed1e67e8";
broadcastChannelOnmessage('refreshPage', () => {
window.location.reload()
@ -61,6 +62,14 @@ export function initAxiosInterceptors(props) {
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制
const requestMap = {};
window.railsgettimes = function(proxy) {
$.ajax({url:`${proxy}/api/main/first_stamp.json`,async:false,success:function(data,status){
if(data.status===0){
return data.message;
}
}});
}
window.setfalseInRequestMap = function(keyName) {
requestMap[keyName] = false;
}
@ -92,22 +101,23 @@ export function initAxiosInterceptors(props) {
}
}
if(`${config[0]}`!=`true`){
let timestamp = Date.parse(new Date())/1000;
let newopens=md5(opens+timestamp)
if (window.location.port === "3007") {
let timestamp=railsgettimes(proxy);
console.log(timestamp)
let newopens=md5(opens+timestamp)
config.url = `${proxy}${url}`;
if (config.url.indexOf('?') == -1) {
config.url = `${config.url}?debug=${debugType}&timestamp=${timestamp}&client_key=${newopens}`;
config.url = `${config.url}?debug=${debugType}&randomcode=${timestamp}&client_key=${newopens}`;
} else {
config.url = `${config.url}&debug=${debugType}&timestamp=${timestamp}&client_key=${newopens}`;
config.url = `${config.url}&debug=${debugType}&randomcode=${timestamp}&client_key=${newopens}`;
}
} else {
// 加api前缀
config.url = url;
if (config.url.indexOf('?') == -1) {
config.url = `${config.url}?&timestamp=${timestamp}&client_key=${newopens}`;
config.url = `${config.url}?&randomcode=${timestamp}&client_key=${newopens}`;
} else {
config.url = `${config.url}&timestamp=${timestamp}&client_key=${newopens}`;
config.url = `${config.url}&randomcode=${timestamp}&client_key=${newopens}`;
}
}
}

Loading…
Cancel
Save