dev_forum
杨树林 5 years ago
parent 2967988215
commit 9204560e1f

@ -2,7 +2,7 @@ import React from "react";
import axios from 'axios'; import axios from 'axios';
import { requestProxy } from "./indexEduplus2RequestProxy"; import { requestProxy } from "./indexEduplus2RequestProxy";
import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString} from 'educoder'; import { broadcastChannelOnmessage ,SetAppModel} from 'educoder';
import { notification } from 'antd'; import { notification } from 'antd';
import './index.css' import './index.css'
broadcastChannelOnmessage('refreshPage', () => { broadcastChannelOnmessage('refreshPage', () => {
@ -18,17 +18,10 @@ function locationurl(list){
} }
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
let debugType = "" const debugType =""
if (isDev) { // window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
const _search = window.location.search; // window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
let parsed = {}; // window._debugType = debugType;
if (_search) {
parsed = queryString.parse(_search);
}
debugType = window.location.search.indexOf('debug=t') != -1 ? "cxt" : ''
}
window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation // TODO 避免重复的请求 https://github.com/axios/axios#cancellation
@ -142,7 +135,6 @@ export function initAxiosInterceptors(props) {
// } // }
if (response.data.status === 403) { if (response.data.status === 403) {
// props.history.replace('/403') // props.history.replace('/403')
debugger
// 这里会分2个情况1、刚进入页面发请求返回的4032、进入页面后其他用户操作触发请求返回的403 // 这里会分2个情况1、刚进入页面发请求返回的4032、进入页面后其他用户操作触发请求返回的403
// TODO 这里做一个403弹框比较好 // TODO 这里做一个403弹框比较好
locationurl('/403'); locationurl('/403');

Loading…
Cancel
Save