门店端微信号自动登录

This commit is contained in:
2026-07-09 22:07:35 +08:00
parent e20ee1ec7f
commit 12ba19ede4
7 changed files with 210 additions and 59 deletions
+2 -4
View File
@@ -8,8 +8,7 @@ import {
checkNeedsWechatAuth,
fetchShopAccount,
handleShopWechatCallback,
saveShopWechatAuth,
sessionFromWechatLogin,
handleShopWechatLoginResult,
} from '../lib/wechat-auth';
import { isWechatEnv, weixinSdk } from '../lib/weixin';
import { stripOAuthParamsFromLocation } from '@dukang/weixin-sdk';
@@ -56,9 +55,8 @@ export default function HomePage() {
void handleShopWechatCallback()
.then((result) => {
if (!result) return;
const session = sessionFromWechatLogin(result);
const session = handleShopWechatLoginResult(result);
if (session) {
saveShopWechatAuth(result);
applySession(session);
}
setAuthModalOpen(false);