Commit 792a833d authored by wuhao's avatar wuhao 🎯

qwe34

parent ba58e96a
Pipeline #1186 failed with stages
...@@ -32,7 +32,7 @@ export async function getInitialState() { ...@@ -32,7 +32,7 @@ export async function getInitialState() {
const msg = await queryCurrentUser(); const msg = await queryCurrentUser();
return msg.data; return msg.data;
} catch (error) { } catch (error) {
history.push(loginPath); // history.push(loginPath);
} }
return undefined; return undefined;
}; // 如果是登录页面,不执行 }; // 如果是登录页面,不执行
...@@ -88,9 +88,9 @@ export const layout = ({ initialState, setInitialState }) => { ...@@ -88,9 +88,9 @@ export const layout = ({ initialState, setInitialState }) => {
onPageChange: () => { onPageChange: () => {
const { location } = history; const { location } = history;
// 如果没有登录,重定向到 login // 如果没有登录,重定向到 login
if (!initialState?.currentUser && location.pathname !== loginPath) { // if (!initialState?.currentUser && location.pathname !== loginPath) {
history.push(loginPath); // history.push(loginPath);
} // }
}, },
links: isDev links: isDev
? [ ? [
......
...@@ -93,7 +93,7 @@ request.interceptors.response.use(async (response, options) => { ...@@ -93,7 +93,7 @@ request.interceptors.response.use(async (response, options) => {
} else { } else {
const data = await response.clone().json(); const data = await response.clone().json();
// 详情返回的response处理 // 详情返回的response处理
if (data?.code != '0000') { if (data?.code != '0000' && data?.code) {
message.destroy(); message.destroy();
message.warn(data?.msg); message.warn(data?.msg);
if (data?.code == '0001' && window.location.href.indexOf('login') == -1) { 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