Browse Source

手机验证码

tags/v1.22.7.1
chenshihai 3 years ago
parent
commit
8086f57aa1
8 changed files with 36 additions and 10 deletions
  1. +3
    -0
      options/locale/locale_en-US.ini
  2. +4
    -1
      options/locale/locale_zh-CN.ini
  3. +2
    -0
      templates/admin/user/list.tmpl
  4. +3
    -3
      templates/user/auth/bind_phone.tmpl
  5. +2
    -1
      templates/user/auth/forgot_passwd.tmpl
  6. +3
    -1
      templates/user/auth/forgot_passwd_phone.tmpl
  7. +14
    -2
      templates/user/auth/signin_phone.tmpl
  8. +5
    -2
      web_src/js/components/UserAnalysis.vue

+ 3
- 0
options/locale/locale_en-US.ini View File

@@ -339,6 +339,8 @@ email_not_associate = The email address is not associated with any account.
email_not_main=The email address is wrong, please input your primary email address.
email_not_right=The email address is not associated with any account, please input the right email address.
send_reset_mail = Send Account Recovery Email
please_enter_main_email=Please enter your primary email
please_enter_main_email_tips=Tips: Only the primary email can receive the recovery email.
reset_password = Account Recovery
invalid_code = Your confirmation code is invalid or has expired.
reset_password_helper = Recover Account
@@ -2520,6 +2522,7 @@ users.new_account = Create User Account
users.name = Username
users.full_name = Full Name
users.activated = Activated
users.bind_phone = Bind Phone
users.admin = Admin
users.restricted = Restricted
users.repos = Repos


+ 4
- 1
options/locale/locale_zh-CN.ini View File

@@ -342,7 +342,9 @@ resend_mail=单击此处重新发送确认邮件
email_not_associate=您输入的邮箱地址未被关联到任何帐号!
email_not_main=电子邮箱地址不正确,请输入您设置的主要邮箱地址。
email_not_right=您输入了不存在的邮箱地址,请输入正确的邮箱地址。
send_reset_mail=发送账户恢复邮件
send_reset_mail=发送密码找回邮件
please_enter_main_email=请输入接收通知提醒的主要邮箱地址
please_enter_main_email_tips=说明:如果您设置了多个邮箱地址,只有主要邮箱可以收到密码找回邮件,其他邮箱无法收到。
reset_password=账户恢复
invalid_code=此确认密钥无效或已过期。
reset_password_helper=恢复账户
@@ -2530,6 +2532,7 @@ users.new_account=创建新帐户
users.name=用户名
users.full_name=全名
users.activated=已激活
users.bind_phone=手机验证
users.admin=管理员
users.restricted=受限
users.repos=项目数


+ 2
- 0
templates/admin/user/list.tmpl View File

@@ -20,6 +20,7 @@
<th>{{.i18n.Tr "admin.users.name"}}</th>
<th>{{.i18n.Tr "email"}}</th>
<th>{{.i18n.Tr "admin.users.activated"}}</th>
<th>{{.i18n.Tr "admin.users.bind_phone"}}</th>
<th>{{.i18n.Tr "admin.users.admin"}}</th>
<th>{{.i18n.Tr "admin.users.restricted"}}</th>
<th>{{.i18n.Tr "admin.users.repos"}}</th>
@@ -35,6 +36,7 @@
<td><a href="{{AppSubUrl}}/{{.Name}}">{{.Name}}</a></td>
<td><span class="text truncate email">{{.Email}}</span></td>
<td><i class="fa fa{{if .IsActive}}-check{{end}}-square-o"></i></td>
<td><i class="fa fa{{if .PhoneNumber}}-check{{end}}-square-o"></i></td>
<td><i class="fa fa{{if .IsAdmin}}-check{{end}}-square-o"></i></td>
<td><i class="fa fa{{if .IsRestricted}}-check{{end}}-square-o"></i></td>
<td>{{.NumRepos}}</td>


+ 3
- 3
templates/user/auth/bind_phone.tmpl View File

@@ -27,7 +27,7 @@
<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>
@@ -37,14 +37,14 @@
var bindPhoneEl = $('.bindphone');
bindPhoneEl.find('button.button').off('click').on('click', function(e) {
var phoneNumber = bindPhoneEl.find('input.phoneNumber').val();
var verifyCode = bindPhoneEl.find('input.verifyCode').val();
var verifyCode = bindPhoneEl.find('input.verifyCode').val();
if (phoneNumber && verifyCode) {
e.preventDefault();
if (!/^1[3578]\d{9}$/.test(phoneNumber)) {
bindPhoneEl.find('.ui.negative.message').show().find('p').text({{.i18n.Tr "phone.please_enter_the_correct_mobile_number"}});
return;
}
if (!/^\d{6}$/.test(verifyCode)) {
if (!/^\d{6}$/.test(verifyCode)) {
bindPhoneEl.find('.ui.negative.message').show().find('p').text({{.i18n.Tr "phone.please_enter_the_correct_mobile_phone_verification_code"}});
return;
}


+ 2
- 1
templates/user/auth/forgot_passwd.tmpl View File

@@ -24,8 +24,9 @@
{{else if .IsResetRequest}}
<div class="required inline field {{if .Err_Email}}error{{end}}">
<label for="email">{{.i18n.Tr "email"}}</label>
<input id="email" name="email" type="email" value="{{.Email}}" autofocus required>
<input id="email" name="email" type="email" value="{{.Email}}" autofocus required placeholder="{{.i18n.Tr "auth.please_enter_main_email"}}">
</div>
<div style="text-align:center;">{{.i18n.Tr "auth.please_enter_main_email_tips"}}</div>
<div class="ui divider"></div>
<div class="inline field">
<label></label>


+ 3
- 1
templates/user/auth/forgot_passwd_phone.tmpl View File

@@ -17,6 +17,9 @@
</h2>
<div class="ui attached segment">
{{template "base/alert" .}}
<div style="display:none;" class="ui negative message">
<p></p>
</div>
{{if .EnablePhone }}
<div style="display:flex;justify-content:center;">
<div class="use-type" usetype="3" style="width:491px;" showlabel="true" shownewpwd="true" autofocus="true">
@@ -29,7 +32,6 @@
}
</style>
{{end}}
<div class="ui divider"></div>
<div class="inline field">
<label></label>


+ 14
- 2
templates/user/auth/signin_phone.tmpl View File

@@ -15,9 +15,18 @@
<div class="ui bottom aligned two column grid">
<div class="column">
<h2 class="ui header">
{{.i18n.Tr "auth.login_userpass"}}
</h2>
{{if .LinkAccountMode}}
{{.i18n.Tr "auth.oauth_signin_title"}}
{{else}}
{{.i18n.Tr "auth.login_userpass"}}
{{end}}
</h2>
</div>
{{if .ShowRegistrationButton}}
<div class="ui right floated column">
<a href="{{AppSubUrl}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a>
</div>
{{end}}
</div>
<div class="ui grid">
<div class="column">
@@ -37,6 +46,9 @@
<input name="remember" type="checkbox">
</div>
</div>
<div class="field" style="padding-right: 0; text-align: right;">
<a href="{{AppSubUrl}}/user/forgot_password?type=phone">{{.i18n.Tr "auth.forgot_password"}}</a>
</div>
</div>

<div class="ui hidden divider"></div>


+ 5
- 2
web_src/js/components/UserAnalysis.vue View File

@@ -225,7 +225,10 @@
label="用户所在地址"
width="120px"
align="center">
</el-table-column>
</el-table-column>
<el-table-column prop="BindPhone" label="是否手机验证" width="120px" align="center">
<template slot-scope="scope"> {{scope.row.BindPhone ? '是' : '否'}} </template>
</el-table-column>
<el-table-column
prop="RegistDate"
label="用户注册时间"
@@ -234,7 +237,7 @@
<template slot-scope="scope">
{{scope.row.RegistDate | transformTimestamp}}
</template>
</el-table-column>
</el-table-column>
<el-table-column
prop="DataDate"
label="系统统计时间"


Loading…
Cancel
Save