Skip to content

Commit 13189d8

Browse files
author
alex
committed
add register
1 parent 7492e20 commit 13189d8

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

src/lang/en.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export default {
7979
password: 'Password',
8080
any: 'any',
8181
thirdparty: 'Or connect with',
82-
thirdpartyTips: 'Can not be simulated on local, so please combine you own business simulation! ! !'
82+
thirdpartyTips: 'Can not be simulated on local, so please combine you own business simulation! ! !',
83+
register: 'register'
8384
},
8485
documentation: {
8586
documentation: 'Documentation',

src/lang/es.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export default {
7979
password: 'Contraseña',
8080
any: 'nada',
8181
thirdparty: 'Conectar con',
82-
thirdpartyTips: 'No se puede simular en local, así que combine su propia simulación de negocios. ! !'
82+
thirdpartyTips: 'No se puede simular en local, así que combine su propia simulación de negocios. ! !',
83+
register: 'registro'
8384
},
8485
documentation: {
8586
documentation: 'Documentación',

src/lang/zh.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export default {
7979
password: '密码',
8080
any: '随便填',
8181
thirdparty: '第三方登录',
82-
thirdpartyTips: '本地不能模拟,请结合自己业务进行模拟!!!'
82+
thirdpartyTips: '本地不能模拟,请结合自己业务进行模拟!!!',
83+
register: '注册'
8384
},
8485
documentation: {
8586
documentation: '文档',

src/views/login/index.vue

+23-1
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@
4242
</span>
4343
</el-form-item>
4444

45-
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">
45+
<el-button :loading="loading" type="primary" style="width:50%;margin-bottom:30px;" @click.native.prevent="handleLogin">
4646
{{ $t('login.logIn') }}
4747
</el-button>
4848

49+
<el-button :loading="loading" type="primary" style="width:50%;margin-bottom:30px;" @click.native.prevent="register">
50+
{{ $t('login.register') }}
51+
</el-button>
52+
4953
<div style="position:relative">
5054
<div class="tips">
5155
<span>{{ $t('login.username') }} : admin</span>
@@ -161,6 +165,24 @@ export default {
161165
return false
162166
}
163167
})
168+
},
169+
register() {
170+
this.$refs.loginForm.validate(valid => {
171+
if (valid) {
172+
this.loading = true
173+
this.$store.dispatch('user/login', this.loginForm)
174+
.then(() => {
175+
this.$router.push({ path: this.redirect || '/' })
176+
this.loading = false
177+
})
178+
.catch(() => {
179+
this.loading = false
180+
})
181+
} else {
182+
console.log('error submit!!')
183+
return false
184+
}
185+
})
164186
}
165187
// afterQRScan() {
166188
// if (e.key === 'x-admin-oauth-code') {

0 commit comments

Comments
 (0)