This commit is contained in:
张成
2025-08-24 14:54:04 +08:00
parent 74174c504e
commit b92301a887
6 changed files with 49 additions and 33 deletions

View File

@@ -47,20 +47,21 @@ export const wechat_auth_login = async (): Promise<LoginResponse> => {
};
}
// 获取用户信息
const user_profile = await get_user_profile();
// 使用 httpService 调用微信授权接口
const auth_response = await httpService.post('/user/wx_auth', {
code: login_result.code
});
if (auth_response.success) {
if (auth_response.code === 0) {
return {
success: true,
message: '微信登录成功',
token: auth_response.data?.token || 'wx_token_' + Date.now(),
user_info: user_profile
user_info: auth_response.data?.user_info
};
} else {
return {
@@ -92,7 +93,7 @@ export const phone_auth_login = async (params: PhoneLoginParams): Promise<LoginR
code: params.verification_code
});
if (verify_response.success) {
if (verify_response.code===0) {
return {
success: true,
message: '登录成功',