feat(partner): require WeChat OAuth before store photo upload
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -71,7 +71,8 @@ export async function loginWithWechatCode(
|
||||
platform?: WechatLoginPlatform,
|
||||
): Promise<WechatLoginResult> {
|
||||
const resolvedPlatform = platform ?? (getRuntimePlatform() === 'mini' ? 'mini' : 'h5');
|
||||
return apiRequest<WechatLoginResult>(config, '/auth/login/wechat', {
|
||||
const loginPath = config.wechatLoginPath ?? '/auth/login/wechat';
|
||||
return apiRequest<WechatLoginResult>(config, loginPath, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ code, platform: resolvedPlatform }),
|
||||
});
|
||||
|
||||
@@ -7,6 +7,8 @@ export type WeixinSdkConfig = {
|
||||
clientApp: string;
|
||||
/** 获取 access token(可选,登录后自动带) */
|
||||
getAccessToken?: () => string | null;
|
||||
/** 微信 code 登录接口,默认 /auth/login/wechat */
|
||||
wechatLoginPath?: string;
|
||||
};
|
||||
|
||||
export type WxInvokeResult<T> = {
|
||||
|
||||
Reference in New Issue
Block a user