Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一码通与自动重登逻辑 #23

Merged
merged 41 commits into from
Jan 22, 2025
Merged

一码通与自动重登逻辑 #23

merged 41 commits into from
Jan 22, 2025

Conversation

weijianxian
Copy link
Collaborator

No description provided.

…le enhancements

- Added error handling for login and getPayCode functions.
- Enhanced styles for input fields and QR code container.
- Ensured proper handling of empty objects to avoid null reference errors.
Copy link
Member

@renbaoshuo renbaoshuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

能否将登录逻辑拆到 @/lib/ymt-login.ts 内?拆分方式类似 #22 中的 @/lib/user-login.ts,拆分后的页面逻辑类似 @/app/login.tsx

@ozline
Copy link
Member

ozline commented Jan 13, 2025

这里标记哦个一下还需要做的事情,以免遗忘:

  1. 添加另一个码的实现 @weijianxian
  2. 协助进行一些统一账号管理,由于现在学校教务处和统一身份认证是使用同一个学号的不同鉴权体系,即密码可能不同(当然,可以使用同一个复杂度的密码,但我们不能这么认为),因此首次使用智汇福大相关功能时或许需要初始化一下用户信息,这部分需要 @ozline @klxiaoniu@renbaoshuo 协助进行

@renbaoshuo
Copy link
Member

我在 #25 中对 app/ 下的文件结构进行了调整,今天晚上开会说明完了以后我会再亲自改一下这个 PR。

@ozline
Copy link
Member

ozline commented Jan 19, 2025

出现了一堆冲突,这个 pr 要不要考虑先合入?然后后面样式再慢慢改?@renbaoshuo,还是说要改的不是 UI 之类的

@ozline
Copy link
Member

ozline commented Jan 19, 2025

目前已经完成主分支代码的合入和调整,我这边完善了一码通的身份认证页面设计,以及调整了登录逻辑,现在的逻辑是点击【一码通】就会自动检查是否存在 token,如果不存在则跳入统一身份认证登录页面

这套设计实际上并不合理,因为用户可能并不想登录,我们没有提供选择权。同时这个判断方式有点粗暴,另外,这个 accessToken 在 asyncStorage 中会和我们 jwch 接口的 access_token 存在歧义,需要解决,@klxiaoniu @renbaoshuo
image

@ozline ozline mentioned this pull request Jan 19, 2025
@klxiaoniu
Copy link
Contributor

色值尽量不用固定颜色,用global.css中定义的颜色,避免不同主题下的问题

@renbaoshuo renbaoshuo requested a review from ozline January 21, 2025 14:45
@ozline ozline changed the title 一码通 一码通与自动重登逻辑 Jan 21, 2025
Comment on lines +186 to +189
throw {
type: RejectEnum.NativeLoginFailed,
data: '自动验证码识别失败',
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里建议 throw 一个 Error 出来,可以在 @/lib/error 里面定义一个 NativeLoginFailedError,在外面用 err instanceof NativeLoginFailedError 即可判断。

@ozline ozline merged commit c15faa8 into master Jan 22, 2025
1 check passed
@ozline ozline deleted the qrcode branch January 22, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants