feat: extend registrationData with city/industry/company/personalityTags/birthday
This commit is contained in:
@@ -26,7 +26,12 @@ const state = reactive({
|
||||
childhood: { date: '', text: '' },
|
||||
joy: { date: '', text: '' },
|
||||
low: { date: '', text: '' },
|
||||
future: { vision: '', ideal: '' }
|
||||
future: { vision: '', ideal: '' },
|
||||
city: '',
|
||||
industry: '',
|
||||
company: '',
|
||||
personalityTags: [],
|
||||
birthday: ''
|
||||
}
|
||||
})
|
||||
|
||||
@@ -69,6 +74,20 @@ const login = async (phone, smsCode) => {
|
||||
}
|
||||
}
|
||||
|
||||
const loginWithWechat = async (payload = {}) => {
|
||||
state.isLoading = true
|
||||
try {
|
||||
await authService.wechatLogin(payload)
|
||||
state.isLoggedIn = true
|
||||
await fetchUserProfile()
|
||||
return { success: true, hasProfile: hasProfile.value }
|
||||
} catch (error) {
|
||||
return { success: false, error: error.message }
|
||||
} finally {
|
||||
state.isLoading = false
|
||||
}
|
||||
}
|
||||
|
||||
const logout = async () => {
|
||||
await authService.logout()
|
||||
resetAuthState()
|
||||
@@ -400,6 +419,7 @@ export const useAppStore = () => {
|
||||
...state,
|
||||
hasProfile,
|
||||
login,
|
||||
loginWithWechat,
|
||||
logout,
|
||||
fetchUserProfile,
|
||||
saveUserProfile,
|
||||
|
||||
Reference in New Issue
Block a user