|
|
@ -13,8 +13,8 @@ |
|
|
|
<el-option v-for="(val, key) in i18nMessages" :key="key" :label="val._lang" :value="key"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="username"> |
|
|
|
<el-input v-model="dataForm.username" :placeholder="$t('login.username')"> |
|
|
|
<el-form-item prop="phone"> |
|
|
|
<el-input v-model="dataForm.phone" placeholder="手机号"> |
|
|
|
<span slot="prefix" class="el-input__icon"> |
|
|
|
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-user"></use></svg> |
|
|
|
</span> |
|
|
@ -69,7 +69,10 @@ export default { |
|
|
|
i18nMessages: messages, |
|
|
|
captchaPath: '', |
|
|
|
dataForm: { |
|
|
|
app: 'oper', |
|
|
|
client: 'web', |
|
|
|
username: '', |
|
|
|
phone: '', |
|
|
|
password: '', |
|
|
|
uuid: '', |
|
|
|
captcha: '' |
|
|
@ -79,7 +82,7 @@ export default { |
|
|
|
computed: { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
username: [ |
|
|
|
phone: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
password: [ |
|
|
@ -98,7 +101,7 @@ export default { |
|
|
|
// 获取验证码 |
|
|
|
getCaptcha () { |
|
|
|
this.dataForm.uuid = getUUID() |
|
|
|
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/captcha?uuid=${this.dataForm.uuid}` |
|
|
|
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}` |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
@ -106,7 +109,7 @@ export default { |
|
|
|
if (!valid) { |
|
|
|
return false |
|
|
|
} |
|
|
|
this.$http.post('/auth/login', this.dataForm).then(({ data: res }) => { |
|
|
|
this.$http.post('/auth/login/loginbypassword', this.dataForm).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
this.getCaptcha() |
|
|
|
return this.$message.error(res.msg) |
|
|
|