feat: openid 即可区分用户 — openid-login 降级建档(CRMEB 查不到也建档)+ 用户中心微信授权登录按钮

This commit is contained in:
2026-07-31 15:04:53 +08:00
parent dd4f922f95
commit 4e4df248ca
2 changed files with 45 additions and 22 deletions

View File

@@ -24,6 +24,7 @@ import { Button } from "../components/ui/button";
import { Card } from "../components/ui/card";
import { Badge } from "../components/ui/badge";
import { useUser, getPregnancyStage } from "../context/UserContext";
import bridge from "../services/bridge";
interface UserInfo {
name: string;
@@ -287,6 +288,22 @@ export function ProfilePage() {
</div>
</div>
</Card>
{/* 微信授权登录:未绑定手机号时显示,点击跳小程序登录页完善资料 */}
{!user.phone && (
<div className="mt-4">
<button
onClick={() => bridge.requireAuth()}
className="w-full py-3 rounded-2xl bg-white border border-morandi-200 text-morandi-500 text-sm font-medium flex items-center justify-center gap-2 shadow-sm hover:bg-morandi-50"
>
<Shield className="w-4 h-4" />
微信授权登录 · 完善资料
</button>
<p className="text-center text-xs text-gray-400 mt-2">
绑定手机号后可同步头像昵称,数据不丢失
</p>
</div>
)}
</motion.div>
{/* 基本信息 */}