Skip to content

fix(core): 识别uid替换默认用户名#3199

Closed
Kirito520Asuna wants to merge 3 commits into
babalae:mainfrom
Kirito520Asuna:main-code
Closed

fix(core): 识别uid替换默认用户名#3199
Kirito520Asuna wants to merge 3 commits into
babalae:mainfrom
Kirito520Asuna:main-code

Conversation

@Kirito520Asuna
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 512e385b-1222-4446-90ad-7fee2622dde7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- 替换genshin.uid()为ocrUID()函数实现OCR识别UID功能
- 添加版本兼容性检查,确保BGI版本满足最低要求0.60.2-alpha.4
- 新增ImageRegionSafe类用于安全释放图像资源
- 实现OCR识别UID的完整流程,包括区域捕获和文本提取
- 添加版本比较工具函数支持预发布版本标识
- 修改manifest.json配置,更新BGI版本依赖要求

chore(version): 更新插件版本号

- 将 bgi_version 从 0.60.2 更新为 0.60.2-alpha.4
- 保持 manifest 版本格式的一致性
- 为后续 alpha 测试准备版本标识

fix(genshin): 修复用户名获取异步处理问题

- 将getUsername函数改为async函数以支持异步操作
- 添加await关键字确保genshin.uid()正确执行
- 修复else语句前后的空格格式问题
- 在调用getUsername时添加await确保异步等待

fix(login): 修复用户名验证逻辑错误

- 调整了 UID 检查的执行顺序,确保在 UID 为 0 时才进行用户名验证
- 修复了用户名为空或格式不正确时的默认值设置
- 优化了 UID 不为 0 时直接使用 UID 作为用户名的逻辑
- 保持了原有的用户名格式验证规则(中文/英文/数字,长度1-20)

fix(core): 修复用户名验证逻辑并更新作者信息

- 当用户名违规时优先使用原神UID作为用户名,避免直接使用默认值
- 添加了对genshin.uid()函数的调用以获取用户唯一标识
- 在manifest.json中将版本从6.5.0更新到6.5.1
- 将bgi_version从0.54.0更新到0.60.2
- 在作者列表中添加了新贡献者云端客的信息
- 保持了原有的用户名验证规则不变
- 修正了版本检查条件判断错误
- 确保只有在版本满足要求时才获取UID
- 防止不兼容版本下UID获取失败的问题
@zaodonganqi
Copy link
Copy Markdown
Collaborator

公用轮子请直接在工具类处定义并导入,不要重复造轮子

- 移除对OCR识别UID的依赖,直接使用genshin.uid()方法
- 删除ImageRegionSafe类及相关图像区域安全释放功能
- 移除版本检查逻辑及相关的版本比较工具函数
- 更新manifest.json中的bgi_version至0.61.0
- 移除uid.js和version.js工具文件中的相关代码实现
@Kirito520Asuna Kirito520Asuna marked this pull request as draft May 25, 2026 11:37
@Kirito520Asuna Kirito520Asuna marked this pull request as ready for review May 26, 2026 15:00
@Kirito520Asuna Kirito520Asuna deleted the main-code branch May 26, 2026 15:08
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.

2 participants