From 675311a1be80ed40c5d593520b5e269cef1cc6cd Mon Sep 17 00:00:00 2001 From: Peanut Date: Thu, 4 Jun 2026 08:09:09 +0800 Subject: [PATCH] feat: extend registrationData with city/industry/company/personalityTags/birthday --- mini-program/src/stores/app.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/mini-program/src/stores/app.js b/mini-program/src/stores/app.js index e1a9333..47f9c62 100644 --- a/mini-program/src/stores/app.js +++ b/mini-program/src/stores/app.js @@ -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,