fix:修复验证码报错刷新问题

This commit is contained in:
Xwen
2023-12-22 22:25:37 +08:00
parent 556e9f52c8
commit 3dc6bfe6ee
4 changed files with 34 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
import { login, logout, register } from "@/apis/accountApi";
import { getUserDetailInfo } from "@/apis/auth";
import { getUserDetailInfo, getLoginCode } from "@/apis/auth";
import useAuths from "@/hooks/useAuths";
import { defineStore } from "pinia";
@@ -14,6 +14,8 @@ const useUserStore = defineStore("user", {
icon: null,
roles: [],
permissions: [],
codeImageURL: "",
codeUUid: "",
}),
getters: {},
actions: {
@@ -112,6 +114,11 @@ const useUserStore = defineStore("user", {
this.userName = "";
this.id = "";
},
async updateCodeImage() {
const { data } = await getLoginCode();
this.codeImageURL = "data:image/jpg;base64," + data.img;
this.codeUUid = data.uuid;
},
},
persist: {
key: "userInfo",