| @@ -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] | |||
| @@ -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] | |||
| @@ -5,8 +5,7 @@ | |||
| <form class="ui form ignore-dirty" action="" method=""> | |||
| {{.CsrfTokenHtml}} | |||
| <h2 class="ui top attached header"> | |||
| {{/*.i18n.Tr "auth.forgot_password_title"*/}} | |||
| 请绑定手机号 | |||
| {{.i18n.Tr "phone.please_bind_your_mobile_number"}} | |||
| </h2> | |||
| <div class="ui attached segment"> | |||
| {{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) { | |||
| @@ -1,12 +1,10 @@ | |||
| {{template "base/head" .}} | |||
| <div class="ui secondary pointing tabular top attached borderless menu new-menu navbar"> | |||
| <a class="item" rel="nofollow" href="{{AppSubUrl}}/user/forgot_password"> | |||
| {{/* 手机验证码登陆 .i18n.Tr "auth.login_userpass" */}} | |||
| 邮箱找回密码 | |||
| {{.i18n.Tr "phone.email_retrieve_password"}} | |||
| </a> | |||
| <a class="active item" rel="nofollow" href="{{AppSubUrl}}/user/forgot_password?type=phone"> | |||
| {{/* .i18n.Tr "auth.login_userpass" */}} | |||
| 手机号找回密码 | |||
| {{.i18n.Tr "phone.mobile_number_retrieve_password"}} | |||
| </a> | |||
| </div> | |||
| <div class="user forgot password"> | |||
| @@ -19,13 +17,12 @@ | |||
| </h2> | |||
| <div class="ui attached segment"> | |||
| {{template "base/alert" .}} | |||
| {{if .EnablePhone }} | |||
| <div style="display:flex;justify-content:center;"> | |||
| <div class="use-type" usetype="3" style="width:491px;" showlabel="true" shownewpwd="true" autofocus="true"> | |||
| {{template "user/auth/phone_verify" .}} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <style> | |||
| .use-type ._label-c, .use-type .new-pass-word-wrap { | |||
| display: flex; | |||
| @@ -36,9 +33,8 @@ | |||
| <div class="ui divider"></div> | |||
| <div class="inline field"> | |||
| <label></label> | |||
| <button class="ui blue button">{{/*.i18n.Tr "auth.send_reset_mail"*/}}提交</button> | |||
| <button class="ui blue button">{{.i18n.Tr "phone.submit"}}</button> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| </div> | |||
| @@ -157,7 +157,7 @@ | |||
| left: 0; | |||
| width: 51px; | |||
| height: 51px; | |||
| background-color: blue; | |||
| box-shadow: 0 0 4px rgb(35 173 255); | |||
| } | |||
| .slide-bar-c .verify-code-c { | |||
| @@ -247,10 +247,11 @@ | |||
| outline: none; | |||
| } | |||
| </style> | |||
| <div class="phone-verify-code"> | |||
| <div class="phone-c"> | |||
| <div class="phone-label _label-c required"> | |||
| <span class="_label">手机号码</span> | |||
| <span class="_label">{{.i18n.Tr "phone.phone_number"}}</span> | |||
| </div> | |||
| <div class="phone-area-c"> | |||
| <select value="+86"> | |||
| @@ -258,14 +259,14 @@ | |||
| </select> | |||
| </div> | |||
| <div class="field phone-num-c"> | |||
| <input class="phoneNumber" style="width:100% !important" name="phone_number" value="{{.phone_number}}" placeholder="手机号码" required autocomplete="off" /> | |||
| <input class="phoneNumber" style="width:100% !important" name="phone_number" value="{{.phone_number}}" placeholder="{{.i18n.Tr "phone.phone_number"}}" required autocomplete="off" /> | |||
| </div> | |||
| </div> | |||
| <div class="slide-bar-wrap" style="display:flex;"> | |||
| <div class="slide-bar-label _label-c required" style=""></div> | |||
| <div class="slide-bar-c" style="flex:1;"> | |||
| <div class="slide-bar-bg"> | |||
| <div class="slide-txt">向右拖动滑块填充拼图</div> | |||
| <div class="slide-txt">{{.i18n.Tr "phone.drag_the_slider_to_fill_the_puzzle"}}</div> | |||
| <div class="slide-bar"></div> | |||
| <div class="slide-trigger"></div> | |||
| </div> | |||
| @@ -274,24 +275,23 @@ | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="verify-code-c"> | |||
| <div class="verify-code-label _label-c required"> | |||
| <span class="_label">手机验证码</span> | |||
| <span class="_label">{{.i18n.Tr "phone.mobile_phone_verification_code"}}</span> | |||
| </div> | |||
| <div class="verify-code-num-c"> | |||
| <input class="verifyCode" style="width:100% !important" name="verify_code" value="{{.verify_code}}" placeholder="请输入短信验证码" required autocomplete="off" /> | |||
| <input class="verifyCode" style="width:100% !important" name="verify_code" value="{{.verify_code}}" placeholder="{{.i18n.Tr "phone.please_enter_SMS_verification_code"}}" required autocomplete="off" /> | |||
| </div> | |||
| <div class="verify-code-send"> | |||
| <div class="verify-code-send-btn __disabled">获取验证码</div> | |||
| <div class="verify-code-send-btn __disabled">{{.i18n.Tr "phone.get_verification_code"}}</div> | |||
| </div> | |||
| </div> | |||
| <div class="new-pass-word-wrap"> | |||
| <div class="new-pass-word-label _label-c required"> | |||
| <span class="_label">新的登录密码</span> | |||
| <span class="_label">{{.i18n.Tr "phone.new_login_password"}}</span> | |||
| </div> | |||
| <div class="new-pass-word-c"> | |||
| <input class="newPassword" style="width:100% !important" name="password" type="password" placeholder="请输入新的密码" required autocomplete="off" /> | |||
| <input class="newPassword" style="width:100% !important" name="password" type="password" placeholder="{{.i18n.Tr "phone.please_enter_new_password"}}" required autocomplete="off" /> | |||
| </div> | |||
| </div> | |||
| <div class="new-pass-word-wrap"> | |||
| @@ -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; | |||
| @@ -1,16 +1,13 @@ | |||
| {{if or .EnableOpenIDSignIn .EnableSSPI .EnableCloudBrain}} | |||
| <div class="ui secondary pointing tabular top attached borderless menu new-menu navbar"> | |||
| <a class="{{if .PageIsPhoneLogin}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login/phone"> | |||
| {{/* 手机验证码登陆 .i18n.Tr "auth.login_userpass" */}} | |||
| 手机登录 | |||
| {{.i18n.Tr "phone.mobile_login"}} | |||
| </a> | |||
| <a class="{{if .PageIsLogin}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login"> | |||
| {{/* .i18n.Tr "auth.login_userpass" */}} | |||
| 账号密码登录 | |||
| {{.i18n.Tr "phone.account_password_login"}} | |||
| </a> | |||
| <a class="{{if .PageIsCloudBrainLogin}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login/cloud_brain"> | |||
| {{/* .i18n.Tr "auth.login_cloudbrain" */}} | |||
| 云脑1用户登录 | |||
| {{.i18n.Tr "phone.cloud_brain_user_login"}} | |||
| </a> | |||
| {{if .EnableOpenIDSignIn}} | |||
| <a class="{{if .PageIsLoginOpenID}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login/openid"> | |||
| @@ -35,8 +35,8 @@ | |||
| </div> | |||
| {{if .EnablePhone }} | |||
| <div class="field required" style="width:391px;"> | |||
| <label for="phone">{{/* .i18n.Tr "phone" */}} 手机号码</label> | |||
| <div class="use-type" usetype="2" ophonenumber="{{.SignedUser.PhoneNumber}}"> | |||
| <label for="phone">{{.i18n.Tr "phone.phone_number"}}</label> | |||
| <div class="use-type" usetype="2" ophonenumber="{{.SignedUser.PhoneNumber}}" verifycodenorequired="true"> | |||
| {{template "user/auth/phone_verify" .}} | |||
| </div> | |||
| </div> | |||