fix:登录跳转失败问题

This commit is contained in:
ljy
2026-07-10 01:54:23 +08:00
parent e770c98de7
commit d66fd9099f
7 changed files with 88 additions and 28 deletions
+5 -2
View File
@@ -2,7 +2,7 @@ import type { ClientRuntimeConfig, WechatLoginResult } from '@dukang/shared-type
import { isWxAuthorizeEnabled } from '@dukang/shared-types';
import { WECHAT_INAPP_REQUIRED_MSG } from '@dukang/weixin-sdk';
import { isWechatEnv, weixinSdk } from './weixin';
import { request, saveAuth } from './api';
import { request, saveAuth, type PartnerSessionProfile } from './api';
export type PartnerProfile = {
id: string;
@@ -37,7 +37,10 @@ export async function checkNeedsWechatAuth(profile: PartnerProfile | null): Prom
/** 处理微信登录/绑定结果,返回是否已拿到 token 可进入首页 */
export function handlePartnerWechatLoginResult(result: WechatLoginResult): boolean {
if (!result.accessToken) return false;
saveAuth({ accessToken: result.accessToken });
saveAuth({
accessToken: result.accessToken,
partner: result.partner as PartnerSessionProfile | undefined,
});
return true;
}