Browse Source

获取验证码、登录接口地址变更

dev
yinzuomei 6 years ago
parent
commit
5ac6f1a08b
  1. 13
      epmet-oper-web/src/views/pages/login.vue

13
epmet-oper-web/src/views/pages/login.vue

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

Loading…
Cancel
Save