feat: 完善登录流程、UI适配及协议文档更新
本次提交包含以下修改: 1. 新增微信登录相关服务及页面逻辑,实现首次微信绑定手机号流程 2. 优化产品匹配卡片 UI,移除不必要状态显示 3. 调整首页 scroll-view 属性及 banner 背景样式 4. 完善积分规则校验逻辑,增加时区及策略格式验证 5. 更新协议草案文档,补充资料清单及功能说明 6. 修复分析结果路由路径,适配新的匹配结果页面 7. 调整品牌 Logo 安卓端字体对齐样式
This commit is contained in:
@@ -7,7 +7,7 @@ export async function requestSmsCode(phone: string): Promise<boolean> {
|
||||
return true
|
||||
}
|
||||
|
||||
function acceptSession(result: UTSJSONObject, phone: string): string {
|
||||
export function acceptSession(result: UTSJSONObject, phone: string): string {
|
||||
const token = result['token'] as string | null
|
||||
const userId = result['userId'] as string | null
|
||||
const expiresAt = result['expiresAt'] as string | null
|
||||
@@ -19,11 +19,20 @@ function acceptSession(result: UTSJSONObject, phone: string): string {
|
||||
}
|
||||
|
||||
export async function loginWithSms(phone: string, code: string): Promise<string> {
|
||||
return acceptSession(await requestJson('/auth/sms-login', 'POST', { phone, code }), phone)
|
||||
return acceptSession(await requestSmsLogin(phone, code), phone)
|
||||
}
|
||||
|
||||
export async function loginWithPassword(phone: string, password: string): Promise<string> {
|
||||
return acceptSession(await requestJson('/auth/password-login', 'POST', { phone, password }), phone)
|
||||
return acceptSession(await requestPasswordLogin(phone, password), phone)
|
||||
}
|
||||
|
||||
// 页面先校验自身代次与原会话,再接受认证结果;迟到响应不能切换当前账户。
|
||||
export async function requestSmsLogin(phone: string, code: string): Promise<UTSJSONObject> {
|
||||
return await requestJson('/auth/sms-login', 'POST', { phone, code })
|
||||
}
|
||||
|
||||
export async function requestPasswordLogin(phone: string, password: string): Promise<UTSJSONObject> {
|
||||
return await requestJson('/auth/password-login', 'POST', { phone, password })
|
||||
}
|
||||
|
||||
export async function logoutAccount(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user