|
@@ -1,11 +1,12 @@
|
|
|
import axios from "axios";
|
|
|
import { Notification, MessageBox, Message, Loading } from "element-ui";
|
|
|
import store from "@/store";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
+import { getToken, setToken } from "@/utils/auth";
|
|
|
import errorCode from "@/utils/errorCode";
|
|
|
import { tansParams, blobValidate } from "@/utils/ruoyi";
|
|
|
import cache from "@/plugins/cache";
|
|
|
import { saveAs } from "file-saver";
|
|
|
+import { sso } from '@/api/sso/ssoLogin';
|
|
|
|
|
|
let downloadLoadingInstance;
|
|
|
// 是否显示重新登录
|
|
@@ -100,6 +101,17 @@ service.interceptors.response.use(
|
|
|
) {
|
|
|
return res.data;
|
|
|
}
|
|
|
+ if (code === 222) {
|
|
|
+ let userInfo = JSON.parse(localStorage.getItem('userInfo'))
|
|
|
+ sso(userInfo).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ let token = res.token
|
|
|
+ setToken(token)
|
|
|
+ this.$store.commit('SET_TOKEN', token)
|
|
|
+ this.$store.dispatch("GetInfo").then(() => { })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
if (code === 401) {
|
|
|
if (!isRelogin.show) {
|
|
|
isRelogin.show = true;
|