diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index c0dfd456d..b1e6852db 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -389,6 +389,23 @@ manual_first=Please slide to finish the jigsaw first. verify_code_fail=Please input right verify code. bind_phone=Please Bind Your Phone. bind_phone_fail=Fail to bind phone number, please try again later. +phone_number=Phone number +drag_the_slider_to_fill_the_puzzle=Drag the slider to the right to fill the puzzle +mobile_phone_verification_code=Phone verification code +please_enter_SMS_verification_code=Please enter SMS verification code +get_verification_code=Get verification code +new_login_password=New login password +please_enter_new_password=Please enter new password +second_resend=S resend +please_bind_your_mobile_number=Please Bind Your Phone Number +submit=Submit +please_enter_the_correct_mobile_number=Please enter the correct phone number +please_enter_the_correct_mobile_phone_verification_code=Please enter the correct phone verification code +email_retrieve_password=Email retrieve password +mobile_number_retrieve_password=Phone number retrieve password +mobile_login=Mobile login +account_password_login=Account password login +cloud_brain_user_login=Cloud brain user login [mail] diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index ed513ca65..7de657ea9 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -393,9 +393,23 @@ manual_first=请先拖动滑块填充拼图。 verify_code_fail=请输入正确的短信验证码。 bind_phone=请绑定手机号。 bind_phone_fail=绑定手机号失败,请稍后再试。 - - - +phone_number=手机号码 +drag_the_slider_to_fill_the_puzzle=向右拖动滑块填充拼图 +mobile_phone_verification_code=手机验证码 +please_enter_SMS_verification_code=请输入短信验证码 +get_verification_code=获取验证码 +new_login_password=新的登录密码 +please_enter_new_password=请输入新的密码 +second_resend=S后重发 +please_bind_your_mobile_number=请绑定手机号 +submit=提交 +please_enter_the_correct_mobile_number=请输入正确的手机号 +please_enter_the_correct_mobile_phone_verification_code=请输入正确格式的手机验证码 +email_retrieve_password=邮箱找回密码 +mobile_number_retrieve_password=手机号找回密码 +mobile_login=手机登录 +account_password_login=账号密码登录 +cloud_brain_user_login=云脑1用户登录 [mail] diff --git a/templates/user/auth/bind_phone.tmpl b/templates/user/auth/bind_phone.tmpl index 1e1493442..4ddaa97b3 100644 --- a/templates/user/auth/bind_phone.tmpl +++ b/templates/user/auth/bind_phone.tmpl @@ -5,8 +5,7 @@
{{.CsrfTokenHtml}}

- {{/*.i18n.Tr "auth.forgot_password_title"*/}} - 请绑定手机号 + {{.i18n.Tr "phone.please_bind_your_mobile_number"}}

{{template "base/alert" .}} @@ -42,11 +41,11 @@ if (phoneNumber && verifyCode) { e.preventDefault(); if (!/^1[3578]\d{9}$/.test(phoneNumber)) { - bindPhoneEl.find('.ui.negative.message').show().find('p').text('请输入正确的手机号'); + bindPhoneEl.find('.ui.negative.message').show().find('p').text({{.i18n.Tr "phone.please_enter_the_correct_mobile_number"}}); return; } if (!/^\d{6}$/.test(verifyCode)) { - bindPhoneEl.find('.ui.negative.message').show().find('p').text('请输入正确格式的手机验证码'); + bindPhoneEl.find('.ui.negative.message').show().find('p').text({{.i18n.Tr "phone.please_enter_the_correct_mobile_phone_verification_code"}}); return; } $.ajax({ @@ -54,8 +53,9 @@ type: 'post', dataType: 'json', data: { + _csrf: bindPhoneEl.find('input[name="_csrf"]').val(), phone_number: phoneNumber, - verify_code: phoneNumber + verify_code: verifyCode }, success: function(res) { if (res && res.Code === 0) { diff --git a/templates/user/auth/forgot_passwd_phone.tmpl b/templates/user/auth/forgot_passwd_phone.tmpl index ca98b59e4..3dc4fba74 100644 --- a/templates/user/auth/forgot_passwd_phone.tmpl +++ b/templates/user/auth/forgot_passwd_phone.tmpl @@ -1,12 +1,10 @@ {{template "base/head" .}}
@@ -19,13 +17,12 @@
{{template "base/alert" .}} - {{if .EnablePhone }}
{{template "user/auth/phone_verify" .}}
-
+
+
- 手机号码 + {{.i18n.Tr "phone.phone_number"}}
- +
-
向右拖动滑块填充拼图
+
{{.i18n.Tr "phone.drag_the_slider_to_fill_the_puzzle"}}
@@ -274,24 +275,23 @@
-
- 手机验证码 + {{.i18n.Tr "phone.mobile_phone_verification_code"}}
- +
-
获取验证码
+
{{.i18n.Tr "phone.get_verification_code"}}
- 新的登录密码 + {{.i18n.Tr "phone.new_login_password"}}
- +
@@ -310,7 +310,7 @@ window.addEventListener('load', function () { function PhoneVerifyCode(dom) { if (!dom) return; - this.countDownNumber = 20; + this.countDownNumber = 120; this.init(dom); } @@ -345,6 +345,10 @@ if (autofocus) { this.dom.find('input.phoneNumber').focus(); } + var verifyCodeNoRequired = wrap.attr('verifycodenorequired'); + if (verifyCodeNoRequired) { + this.dom.find('input.verifyCode').removeAttr('required'); + } }; PhoneVerifyCode.prototype.eventInit = function () { @@ -452,7 +456,6 @@ } else { self.dom.find('.phone-num-c').removeClass('error'); var useType = self.dom.closest('div.use-type').attr('usetype') || 0; - self.countDown(); $.ajax({ url: '/sendVerifyCode', type: 'post', @@ -463,8 +466,17 @@ slide_id: self.imgID, }, success: function(res) { - if (res && res.code === 0) { - console.log(res); + if (res && res.Code === 0) { + self.countDown(); + } else { + $('body').toast({ + message: res.Message, + showProgress: 'bottom', + showIcon:'warning circle', + class: 'warning', + position: 'top right', + }); + self.refreshImages(); } }, error: function(err) { @@ -507,14 +519,14 @@ var self = this; var sendBtnEl = this.dom.find('.verify-code-send-btn'); var count = this.countDownNumber; - sendBtnEl.addClass('__disabled').text(`${count}S后重发`); + sendBtnEl.addClass('__disabled').text(`${count}{{.i18n.Tr "phone.second_resend"}}`); this.canSendCode = false; this.countDownEnd = false; var timer = setInterval(function () { count--; - sendBtnEl.addClass('__disabled').text(`${count}S后重发`); + sendBtnEl.addClass('__disabled').text(`${count}{{.i18n.Tr "phone.second_resend"}}`); if (count <= 0) { - sendBtnEl.removeClass('__disabled').text(`获取验证码`); + sendBtnEl.removeClass('__disabled').text({{.i18n.Tr "phone.get_verification_code"}}); clearInterval(timer); self.canSendCode = true; self.countDownEnd = true; diff --git a/templates/user/auth/signin_navbar.tmpl b/templates/user/auth/signin_navbar.tmpl index f26bcb338..45475e46f 100755 --- a/templates/user/auth/signin_navbar.tmpl +++ b/templates/user/auth/signin_navbar.tmpl @@ -1,16 +1,13 @@ {{if or .EnableOpenIDSignIn .EnableSSPI .EnableCloudBrain}} {{if .EnablePhone }}
- -
+ +
{{template "user/auth/phone_verify" .}}