fix: fix bug for mobile verify code function not available in register page

This commit is contained in:
RockYang 2023-07-27 10:29:59 +08:00
parent 7eb69c1ad7
commit ae79c34508
2 changed files with 4 additions and 0 deletions

View File

@ -175,6 +175,7 @@ func authorizeMiddleware(s *AppServer) gin.HandlerFunc {
if c.Request.URL.Path == "/api/user/login" || if c.Request.URL.Path == "/api/user/login" ||
c.Request.URL.Path == "/api/admin/login" || c.Request.URL.Path == "/api/admin/login" ||
c.Request.URL.Path == "/api/user/register" || c.Request.URL.Path == "/api/user/register" ||
c.Request.URL.Path == "/api/sms/status" ||
strings.HasPrefix(c.Request.URL.Path, "/api/verify/") || strings.HasPrefix(c.Request.URL.Path, "/api/verify/") ||
strings.HasPrefix(c.Request.URL.Path, "/static/") || strings.HasPrefix(c.Request.URL.Path, "/static/") ||
c.Request.URL.Path == "/api/admin/config/get" { c.Request.URL.Path == "/api/admin/config/get" {

View File

@ -139,6 +139,9 @@ const register = function () {
return ElMessage.error('两次输入密码不一致'); return ElMessage.error('两次输入密码不一致');
} }
if (formData.value.code === '') {
formData.value.code = 0
}
httpPost('/api/user/register', formData.value).then(() => { httpPost('/api/user/register', formData.value).then(() => {
ElMessage.success({"message": "注册成功,即将跳转到登录页...", onClose: () => router.push("login")}) ElMessage.success({"message": "注册成功,即将跳转到登录页...", onClose: () => router.push("login")})
}).catch((e) => { }).catch((e) => {