修改用户授权调用位置和逻辑
This commit is contained in:
@@ -80,6 +80,7 @@ export interface UserInfoType {
|
||||
}
|
||||
|
||||
// 微信授权登录
|
||||
// phone_code: 可选参数,如果提供则绑定手机号,否则只进行微信授权
|
||||
export const wechat_auth_login = async (
|
||||
phone_code?: string,
|
||||
): Promise<LoginResponse> => {
|
||||
@@ -94,11 +95,18 @@ export const wechat_auth_login = async (
|
||||
};
|
||||
}
|
||||
|
||||
// 使用 httpService 调用微信授权接口,传递手机号code
|
||||
const auth_response = await httpService.post("user/wx_auth", {
|
||||
// 构建请求参数
|
||||
const requestData: any = {
|
||||
code: login_result.code,
|
||||
phone_code: phone_code, // 传递手机号加密code
|
||||
});
|
||||
};
|
||||
|
||||
// 只有在提供 phone_code 时才添加到请求参数中
|
||||
if (phone_code) {
|
||||
requestData.phone_code = phone_code;
|
||||
}
|
||||
|
||||
// 使用 httpService 调用微信授权接口
|
||||
const auth_response = await httpService.post("user/wx_auth", requestData);
|
||||
|
||||
if (auth_response.code === 0) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user