perf: 同步完整版代码

This commit is contained in:
xiaoxian521
2022-05-01 08:34:33 +08:00
parent 0a9eb30549
commit 41b35588c5
28 changed files with 1644 additions and 431 deletions

View File

@@ -38,4 +38,6 @@ export type setType = {
export type userType = {
token: string;
name?: string;
verifyCode?: string;
currentPage?: number;
};

View File

@@ -22,7 +22,11 @@ export const useUserStore = defineStore({
id: "pure-user",
state: (): userType => ({
token,
name
name,
// 前端生成的验证码(按实际需求替换)
verifyCode: "",
// 登陆显示组件判断 0登陆 1手机登陆 2二维码登陆 3注册 4忘记密码默认0登陆
currentPage: 0
}),
actions: {
SET_TOKEN(token) {
@@ -31,6 +35,12 @@ export const useUserStore = defineStore({
SET_NAME(name) {
this.name = name;
},
SET_VERIFYCODE(verifyCode) {
this.verifyCode = verifyCode;
},
SET_CURRENTPAGE(value) {
this.currentPage = value;
},
// 登入
async loginByUsername(data) {
return new Promise<void>((resolve, reject) => {