mirror of
https://gitee.com/lijingbo-2021/open-anylink-web.git
synced 2025-12-30 11:02:25 +00:00
对登录请求做流控
This commit is contained in:
@@ -93,8 +93,7 @@ const register = async () => {
|
||||
|
||||
const login = async () => {
|
||||
await form.value.validate() // 登录之前预校验
|
||||
const response = userLoginService(formModel.value)
|
||||
response
|
||||
loginWrapper()
|
||||
.then(async (res) => {
|
||||
userData.setAt(res.data.data.accessToken)
|
||||
userData.setRt(res.data.data.refreshToken)
|
||||
@@ -149,7 +148,13 @@ const onClickCaptcha = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// 60s内只能被执行10次
|
||||
const loginWrapper = flowLimiteWrapper(
|
||||
async () => {
|
||||
return userLoginService(formModel.value)
|
||||
},
|
||||
5,
|
||||
60000
|
||||
)
|
||||
const getCaptchaImageWrapper = flowLimiteWrapper(
|
||||
async () => {
|
||||
captchaId.value = ''
|
||||
|
||||
Reference in New Issue
Block a user