修改登录授权的问题

This commit is contained in:
Gao xiaosong
2020-07-15 22:32:33 +08:00
parent 19e9e9be31
commit 8a029054b3
2 changed files with 2 additions and 1 deletions

View File

@ -3,7 +3,7 @@ import Vue from 'vue'
// Vue.use(MpvueRouterPatch) // Vue.use(MpvueRouterPatch)
import { import {
wxappAuth, wxappAuth,
getUser getUserInfo
} from "@/api/user"; } from "@/api/user";
import store from "../store"; import store from "../store";
import dayjs from "dayjs"; import dayjs from "dayjs";

View File

@ -65,6 +65,7 @@ function baseRequest(options) {
if (res.status !== 200) { if (res.status !== 200) {
return Promise.reject({ msg: "请求失败", res, data }); return Promise.reject({ msg: "请求失败", res, data });
} }
console.log(data.status)
if ([401, 403].indexOf(data.status) !== -1) { if ([401, 403].indexOf(data.status) !== -1) {
handleLoginFailure(); handleLoginFailure();
return Promise.reject({ msg: res.data.msg, res, data, toLogin: true }); return Promise.reject({ msg: res.data.msg, res, data, toLogin: true });