main
瓶中沙 2024-01-24 09:12:25 +08:00
parent 82f524b3b6
commit 239939373a
3 changed files with 7 additions and 5 deletions

View File

@ -33,8 +33,8 @@ function getNeedToken() {
//
axios.interceptors.response.use(
(res) => {
// token
const ret = response.decode(new Uint8Array(res.data));
// token
const ret = response.decode(new Uint8Array(res));
if(ret.code ===40100 || ret.code ===40101) {
localRemove("token");
ElMessage.closeAll();

View File

@ -73,7 +73,8 @@ import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
import infoApi from "@/api/infoApi.js";
import { ElMessage } from "element-plus";
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 {
name: "home",
setup() {
@ -87,8 +88,8 @@ export default {
},
});
onMounted(() => {
getSys();
onMounted(async () => {
getSys();
});
const getSys = async () => {
const res = await infoApi.getSys();

View File

@ -67,6 +67,7 @@ export default {
});
onMounted(() => {
localRemove("token");
});
const submitForm = async () => {
loginForm.value.validate(async (valid) => {