style: 总算处理好所有的 eslint 报错

This commit is contained in:
feige996
2025-06-21 17:11:17 +08:00
parent 32cf872405
commit e1654359fd
6 changed files with 55 additions and 55 deletions

View File

@@ -46,6 +46,18 @@ export const useUserStore = defineStore(
uni.removeStorageSync('userInfo')
uni.removeStorageSync('token')
}
/**
* 获取用户信息
*/
const getUserInfo = async () => {
const res = await _getUserInfo()
const userInfo = res.data
setUserInfo(userInfo)
uni.setStorageSync('userInfo', userInfo)
uni.setStorageSync('token', userInfo.token)
// TODO 这里可以增加获取用户路由的方法 根据用户的角色动态生成路由
return res
}
/**
* 用户登录
* @param credentials 登录参数
@@ -63,18 +75,7 @@ export const useUserStore = defineStore(
await getUserInfo()
return res
}
/**
* 获取用户信息
*/
const getUserInfo = async () => {
const res = await _getUserInfo()
const userInfo = res.data
setUserInfo(userInfo)
uni.setStorageSync('userInfo', userInfo)
uni.setStorageSync('token', userInfo.token)
// TODO 这里可以增加获取用户路由的方法 根据用户的角色动态生成路由
return res
}
/**
* 退出登录 并 删除用户信息
*/