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

支持短信登录中的滑动验证 #114

Merged
merged 1 commit into from
Jan 3, 2024
Merged

Conversation

hguandl
Copy link
Collaborator

@hguandl hguandl commented Aug 11, 2023

添加了支持验证码的短信登录 API。用户可以自己在浏览器内完成滑动验证后输入验证结果,并通过回调继续登录。目前只在 biliup 命令行工具里添加此功能,stream_gears 应该也可以用类似的方法。

@hguandl hguandl requested a review from ForgQi August 11, 2023 07:51
Some(ResponseValue::Value(data))
if !data["recaptcha_url"].as_str().unwrap_or("").is_empty() =>
{
let url = data["recaptcha_url"].as_str().unwrap().to_string();
Copy link
Member

Choose a reason for hiding this comment

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

这里要不要把unwrap换成Error

Copy link
Collaborator Author

@hguandl hguandl Aug 11, 2023

Choose a reason for hiding this comment

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

其实我觉得 captcha_key 和 recaptcha_url 都用 unwrap_or 好一些。match 过程中出 Error 的话应该整个函数直接返回了,最后拿到的是 send sms error,隐藏了 res 的原始内容。用 unwrap_or 的做法不会在匹配过程中返回错误,当两种情况都匹配不上就在最后统一返回 Err(Kind::Custom(res.to_string()))

Copy link
Member

Choose a reason for hiding this comment

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

欧克

@ForgQi ForgQi added this pull request to the merge queue Jan 3, 2024
Merged via the queue into biliup:master with commit 9125abc Jan 3, 2024
13 checks passed
@hguandl hguandl deleted the sms-recaptcha branch March 26, 2024 04:18
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.

None yet

2 participants