12345
parent
82f524b3b6
commit
239939373a
|
@ -33,8 +33,8 @@ function getNeedToken() {
|
||||||
// 请求拦截器,内部根据返回值,重新组装,统一管理。
|
// 请求拦截器,内部根据返回值,重新组装,统一管理。
|
||||||
axios.interceptors.response.use(
|
axios.interceptors.response.use(
|
||||||
(res) => {
|
(res) => {
|
||||||
// token过期
|
// token过期
|
||||||
const ret = response.decode(new Uint8Array(res.data));
|
const ret = response.decode(new Uint8Array(res));
|
||||||
if(ret.code ===40100 || ret.code ===40101) {
|
if(ret.code ===40100 || ret.code ===40101) {
|
||||||
localRemove("token");
|
localRemove("token");
|
||||||
ElMessage.closeAll();
|
ElMessage.closeAll();
|
||||||
|
|
|
@ -73,7 +73,8 @@ import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||||
import infoApi from "@/api/infoApi.js";
|
import infoApi from "@/api/infoApi.js";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import { user, token, response, info } from '../proto/data/pd'
|
import { user, token, response, info } from '../proto/data/pd';
|
||||||
|
import myApi from "@/api/myApi.js";
|
||||||
export default {
|
export default {
|
||||||
name: "home",
|
name: "home",
|
||||||
setup() {
|
setup() {
|
||||||
|
@ -87,8 +88,8 @@ export default {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
getSys();
|
getSys();
|
||||||
});
|
});
|
||||||
const getSys = async () => {
|
const getSys = async () => {
|
||||||
const res = await infoApi.getSys();
|
const res = await infoApi.getSys();
|
||||||
|
|
|
@ -67,6 +67,7 @@ export default {
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
localRemove("token");
|
localRemove("token");
|
||||||
|
|
||||||
});
|
});
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
loginForm.value.validate(async (valid) => {
|
loginForm.value.validate(async (valid) => {
|
||||||
|
|
Loading…
Reference in New Issue