feat(App): 宿主接入短信登录 + app_identity/app_bind
- mixin 新增 _appIdentityFlow:有 token → GET wechat/app_identity; 无 openid → uni.login(weixin) → POST wechat/app_bind → 再取身份 - _silenceAuthOpenid 在 APP-PLUS 下改走该流程(不碰 wx.login) - 首页壳/容器页:未登录时停止自动重试,兜底屏给「登录后继续」; 登录页成功后 reLaunch 回原页(首页 / 容器页带原 url) - App 的 requestProfile 改为直接查共享资料并回传 hash(不弹面板、 不调 getPhoneNumber,规避 web-view 覆盖页内浮层) - api/user.js 新增 appIdentity / appBind Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
13
api/user.js
13
api/user.js
@@ -900,4 +900,17 @@ export function channelApplyInfoApi() {
|
||||
// 采购商切换身份
|
||||
export function checkIdentityApi(data) {
|
||||
return request.post(`user/switch_identity`, data);
|
||||
}
|
||||
|
||||
/* ---------- App 身份(2026-10-26,Android 一期) ----------
|
||||
宿主在短信登录后调用:
|
||||
appIdentity() 取规范 openid(routine 优先 → app → unionid 反查)
|
||||
appBind({ code }) 新用户:uni.login 拿 code → 绑定到当前 uid
|
||||
两个接口都要求登录态(request 自动带 Authori-zation)。 */
|
||||
export function appIdentity() {
|
||||
return request.get('wechat/app_identity');
|
||||
}
|
||||
|
||||
export function appBind(data) {
|
||||
return request.post('wechat/app_bind', data);
|
||||
}
|
||||
Reference in New Issue
Block a user