fix:完善门店和总部管理端

This commit is contained in:
ljy
2026-07-06 20:58:38 +08:00
parent 67b5a580c5
commit fcf1d45522
25 changed files with 1273 additions and 118 deletions
+6 -1
View File
@@ -9,6 +9,7 @@ import {
loginHqWithWechat,
} from '../../lib/wechat';
import { isWechatEnv } from '../../lib/weixin';
import { WECHAT_INAPP_REQUIRED_MSG } from '@dukang/weixin-sdk';
import { clearHqAccountCache } from '../../lib/session';
import './index.css';
@@ -148,6 +149,10 @@ export default function LoginPage() {
async function wechatLogin() {
if (!ensureAgreed()) return;
setMsg('');
if (!isWechatEnv()) {
setMsg(WECHAT_INAPP_REQUIRED_MSG);
return;
}
setWxLoading(true);
try {
const ok = await loginHqWithWechat();
@@ -222,7 +227,7 @@ export default function LoginPage() {
onClick={wxLoading ? undefined : wechatLogin}
>
<WechatIcon />
<Text>{wxLoading ? '登录中...' : '微信一键登录'}</Text>
<Text>{wxLoading ? '登录中...' : '微信一键授权'}</Text>
</View>
<View className="login-agreement" onClick={() => setAgreed((v) => !v)}>