代码改造完成,加入多字典查询方式

This commit is contained in:
zhengjie
2019-06-29 12:32:52 +08:00
parent 1b757d6972
commit 9ca7d4b05f
56 changed files with 771 additions and 1467 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div style="display: inline-block;">
<el-dialog :visible.sync="dialog" :title="title" append-to-body width="475px" @close="cancel">
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :title="title" append-to-body width="475px" @close="cancel">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="88px">
<el-form-item label="新邮箱" prop="email">
<el-input v-model="form.email" auto-complete="on" style="width: 200px;"/>
@@ -24,7 +24,7 @@
<script>
import store from '@/store'
import { validatEmail } from '@/utils/validate'
import { validPass, updateEmail } from '@/api/user'
import { updateEmail } from '@/api/user'
import { resetEmail } from '@/api/code'
export default {
props: {
@@ -34,19 +34,6 @@ export default {
}
},
data() {
const validatePass = (rule, value, callback) => {
if (value === '' || value === null) {
callback(new Error('密码不能为空'))
} else {
validPass(value).then(res => {
if (res.status === 200) {
callback()
} else {
callback(new Error('密码错误,请重新输入'))
}
})
}
}
const validMail = (rule, value, callback) => {
if (value === '' || value === null) {
callback(new Error('新邮箱不能为空'))
@@ -65,7 +52,7 @@ export default {
buttonName: '获取验证码', isDisabled: false, time: 60,
rules: {
pass: [
{ required: true, validator: validatePass, trigger: 'blur' }
{ required: true, message: '当前密码不能为空', trigger: 'blur' }
],
email: [
{ required: true, validator: validMail, trigger: 'blur' }