优化
This commit is contained in:
+15
-12
@@ -13,8 +13,8 @@ export const useUserStore = defineStore('user', () => {
|
||||
const token = ref("")
|
||||
const userInfo = ref(null)
|
||||
const loginForm = ref({
|
||||
account: 'hfnbd',
|
||||
password: '1111',
|
||||
account: '',
|
||||
password: '',
|
||||
Telephone: '',
|
||||
})
|
||||
|
||||
@@ -51,17 +51,20 @@ export const useUserStore = defineStore('user', () => {
|
||||
const fetchLogin = async () => {
|
||||
try {
|
||||
let res = await reqLogin(loginForm.value)
|
||||
userInfo.value = res.data
|
||||
token.value = res.data?.PersonId
|
||||
currentProject.value = {
|
||||
ProjectId: res.data?.LoginProjectId,
|
||||
ProjectName: res.data?.LoginProjectName
|
||||
if(res.data){
|
||||
userInfo.value = res.data
|
||||
token.value = res.data?.PersonId
|
||||
currentProject.value = {
|
||||
ProjectId: res.data?.LoginProjectId,
|
||||
ProjectName: res.data?.LoginProjectName
|
||||
}
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 900)
|
||||
}
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 900)
|
||||
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user