Commit d34b1819 by zhaochengxiang

session过期

parent 2ba5c1b4
...@@ -13,10 +13,6 @@ body { ...@@ -13,10 +13,6 @@ body {
background-color: #fff; background-color: #fff;
} }
#root {
height: 100%;
}
code { code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace; monospace;
......
...@@ -89,12 +89,16 @@ export const SetSource = function (source) { ...@@ -89,12 +89,16 @@ export const SetSource = function (source) {
const callback = resp => { const callback = resp => {
if (resp.status === 401) { if (resp.status === 401) {
message.warning("session过期,请重新登录!"); message.warning("session过期,请重新登录!");
window.setTimeout(args => Open(`${ContextPath}/login`, { target: '_self' }), 2000); if (window.parent) {
window.parent.postMessage('session invalid');
}
return null; return null;
} }
else if (resp.status !== 200) { else if (resp.status !== 200) {
throw resp.data throw resp.data
} }
return resp.data || resp; return resp.data || resp;
} }
......
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