login.ts
735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { defineStore } from 'pinia'
const useLogin = defineStore(
// 唯一ID
'login',
() => {
const isCheckSms = ref(false)
const smsValidateCode = ref('');
const firstUnmetRequirement = ref('');
const encodePwd = ref('')
return {
/**
* 密文
*/
encodePwd,
/**
* 是否直接去校验验证码
*/
isCheckSms,
/**
* 网关登录验证码
*/
smsValidateCode,
/**
* 注册密码未满足的第一条规则的 label
*/
firstUnmetRequirement,
}
},
{
persist:{
storage: sessionStorage,
paths: ['firstUnmetRequirement','smsValidateCode','encodePwd']
}
}
)
export default useLogin