Closed McElaga closed 2 months ago
此拉取请求重构了登录逻辑,修复了错误,并提高了代码的灵活性,以适应登录印象级别配置。更改主要集中在重写 get_level_and_next_impression
函数、修复变量名,并确保当在 config.py
文件中修改印象级别配置时,登录功能仍然正常。
更改 | 详情 | 文件 |
---|---|---|
重写 get_level_and_next_impression 函数以更好地处理逻辑 |
|
zhenxun/builtin_plugins/sign_in/utils.py |
修复错误并提高代码可读性 |
|
zhenxun/builtin_plugins/sign_in/utils.py |
增强印象级别配置的灵活性 |
|
zhenxun/builtin_plugins/sign_in/utils.py zhenxun/builtin_plugins/sign_in/config.py |
get_level_and_next_impression
函数,更好地整合了好感度等级最低和最高时的逻辑,并且在好感度等级最高时返回的next_impression
和impression
相等,与后续判断升级进度相契合(好感度等级最高时进度始终为100%);config.py
文件更改好感度等级相关配置时,签到功能仍然可用。Summary by Sourcery
重构登录逻辑以修复与印象等级相关的错误,并提高代码的灵活性和可读性。确保系统适应印象等级的配置更改,并纠正最大印象等级的处理,以保持一致的进度报告。
错误修复:
get_level_and_next_impression
函数中的逻辑,以正确处理最高印象等级,确保在达到最大等级时进度始终为100%。增强功能:
config.py
文件中印象等级配置的更改。Original summary in English
## Summary by Sourcery Refactor the sign-in logic to fix bugs related to impression levels and improve code flexibility and readability. Ensure the system adapts to configuration changes in impression levels, and correct the handling of maximum impression levels to maintain consistent progress reporting. Bug Fixes: - Fix the logic in the `get_level_and_next_impression` function to correctly handle the highest impression level, ensuring the progress is always 100% when the maximum level is reached. Enhancements: - Improve the flexibility of the sign-in feature to adapt to changes in impression level configurations in the `config.py` file. - Enhance code readability by renaming variables and refining function logic.