diff --git a/conf.json b/conf.json index ae42140..f1faea2 100644 --- a/conf.json +++ b/conf.json @@ -12,8 +12,8 @@ "web-escort-admin": { "appid": "", "secret": "", - "callbackUri": "http://localhost:9010/user/wechat/qr/callback", - "webOrigin": "http://localhost:5173" + "callbackUri": "https://api.huashengtec.com/user/wechat/qr/callback", + "webOrigin": "http://escort.huashengtec.com/admin" } }, "mongodb": { diff --git a/handler/users.js b/handler/users.js index c437229..d7108f9 100644 --- a/handler/users.js +++ b/handler/users.js @@ -1141,6 +1141,14 @@ class HandlerUser { } } + // 4.5 存量用户此前以手机号充当用户名:本次登录带了昵称就补全, + // 已设过真实姓名的不覆盖(新建账号在上面 create 时已写入 name)。 + // 不单独 save,随步骤 8 的 issueToken 一并落库 + const inputName = String(name || "").trim(); + if (inputName && (!user.profile?.name || user.profile.name === user.profile.mobile)) { + user.profile.name = inputName; + } + // 5. 绑定身份:唯一索引兜底。 // 11000 可能来自 unionid(该微信已绑定其他账号)或 openid(并发绑定), // 必须按 keyPattern / message 区分,不能一律报同一种错误。