Commit 2d46a836 by 展昭

interceptors

parent a081d73b
Showing with 5 additions and 2 deletions
...@@ -40,7 +40,6 @@ http.interceptors.response.use( ...@@ -40,7 +40,6 @@ http.interceptors.response.use(
}, },
(error) => { (error) => {
Toast.clear(); Toast.clear();
console.log('error=',error);
let info = {}; let info = {};
let { status } = error.response; let { status } = error.response;
info = { info = {
...@@ -49,7 +48,9 @@ http.interceptors.response.use( ...@@ -49,7 +48,9 @@ http.interceptors.response.use(
msg: "系统出现未知错误" msg: "系统出现未知错误"
}; };
console.log(info); console.log(info);
return info;
Toast.fail('授权失败!',0);
//return info;
} }
); );
......
...@@ -34,6 +34,8 @@ async function getToken(access_token, appid) { ...@@ -34,6 +34,8 @@ async function getToken(access_token, appid) {
if (res.status == 200) { if (res.status == 200) {
const accessToken = res.data.access_token; const accessToken = res.data.access_token;
localStorage.setItem("token", accessToken); localStorage.setItem("token", accessToken);
} else {
console.log('res=', res);
} }
}, },
err => { err => {
......
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 sign in to comment