新的登录接口 #51
Labels
No Label
area/smartpanel
bug
done-waiting-confirmed
kind/feature
page/admin
page/simplepage
page/tab-admin
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: smartoilets-front/projects#51
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
将会发布一个新的登录接口,返回内容更规范,原来的接口 data 直接就是token, 不好扩展。
API地址为 https://smartoilets.net/openapi/api/api/v1/oauth/login
新街口将包含 token 过期时间, 前端在请求任何接口之前直接用 这个过期时间判断一下是否过期,如果过期了则登录获取新的 token
涉及 page:
同时该接口支持匿名用户登录,用于给 https://smartoilets.net/fbpage/twsc/1A/female/abc 这样不需要用户登录的页面.
匿名账号规则: 如果URL中没有deviceId, 则 username 为 anonymous, 否则 username 为 {deviceId}
密码规则: {page}+当前年月日
例如 https://smartoilets.net/simplepage/PWH/F2/female?profile=alerter
则账号为 anonymous 密码为 simplepage20250109
返回数据结构:
前端应该将整个data缓存在本地,在请求任何接口前先用 expireAt 这个时间戳去与当前时间戳做对比, 如果 expireAt 小则说明token已经过期了, 需要重新 login
返回数据结构:
前端应该将整个data缓存在本地,在请求任何接口前先用 expireAt 这个时间戳去与当前时间戳做对比, 如果 expireAt 小则说明token已经过期了, 需要重新 login
账号规则: 如果URL中没有deviceId, 则 username 为 anonymous, 否则 username 为 {deviceId}
密码规则: {page}+当前年月日
例如 https://smartoilets.net/simplepage/PWH/F2/female?profile=alerter
则账号为 anonymous 密码为 simplepage20250109
[服务器WIP] 新的登录接口to 新的登录接口加了 再看下