Commit 792a833d authored by wuhao's avatar wuhao 🎯

qwe34

parent ba58e96a
Pipeline #1186 failed with stages
......@@ -32,7 +32,7 @@ export async function getInitialState() {
const msg = await queryCurrentUser();
return msg.data;
} catch (error) {
history.push(loginPath);
// history.push(loginPath);
}
return undefined;
}; // 如果是登录页面,不执行
......@@ -88,9 +88,9 @@ export const layout = ({ initialState, setInitialState }) => {
onPageChange: () => {
const { location } = history;
// 如果没有登录,重定向到 login
if (!initialState?.currentUser && location.pathname !== loginPath) {
history.push(loginPath);
}
// if (!initialState?.currentUser && location.pathname !== loginPath) {
// history.push(loginPath);
// }
},
links: isDev
? [
......
......@@ -93,7 +93,7 @@ request.interceptors.response.use(async (response, options) => {
} else {
const data = await response.clone().json();
// 详情返回的response处理
if (data?.code != '0000') {
if (data?.code != '0000' && data?.code) {
message.destroy();
message.warn(data?.msg);
if (data?.code == '0001' && window.location.href.indexOf('login') == -1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment