refactor: store action name

This commit is contained in:
xingyu
2022-08-03 13:00:42 +08:00
parent 4bf8576dbd
commit e477179cd5
5 changed files with 15 additions and 15 deletions

View File

@ -39,7 +39,7 @@ export const useUserStore = defineStore({
}
},
actions: {
async getUserInfoAction(userInfo: UserInfoVO) {
async setUserInfoAction(userInfo: UserInfoVO) {
if (!getAccessToken()) {
this.resetState()
return null

View File

@ -112,7 +112,7 @@ const handleLogin = async (params) => {
const res = await LoginApi.loginApi(loginData.loginForm)
setToken(res)
const userInfo = await LoginApi.getInfoApi()
await userStore.getUserInfoAction(userInfo)
await userStore.setUserInfoAction(userInfo)
await getRoutes()
loginLoading.value = false
}

View File

@ -103,7 +103,7 @@ const signIn = async () => {
.then(async (res) => {
setToken(res?.token)
const userInfo = await getInfoApi()
await userStore.getUserInfoAction(userInfo)
await userStore.setUserInfoAction(userInfo)
getRoutes()
})
.catch(() => {})