diff --git a/package.json b/package.json index 6668327..500f445 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pig-ui", - "version": "2.7.3", + "version": "2.7.5", "private": true, "scripts": { "pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ", diff --git a/src/const/crud/admin/user.js b/src/const/crud/admin/user.js index 136c9fe..cc357dc 100644 --- a/src/const/crud/admin/user.js +++ b/src/const/crud/admin/user.js @@ -14,9 +14,12 @@ * this software without specific prior written permission. * Author: lengleng (wangiegie@gmail.com) */ -import { getDetails } from '@/api/admin/user' +import {getDetails} from '@/api/admin/user' -var validateUsername = (rule, value, callback) => { +const validateUsername = (rule, value, callback) => { + if (!value) { + return callback(new Error('请输入用户名')) + } getDetails(value).then(response => { if (window.boxType === 'edit') callback() let result = response.data.data @@ -28,6 +31,18 @@ var validateUsername = (rule, value, callback) => { }) } +// 设置密码校验规则 +const checkPassword = (rule, value, callback) => { + if (window.boxType === 'edit') { + return callback() + } + if (!value) { + callback(new Error('请输入密码')) + } else { + callback() + } +} + // 设置手机号的验证规则 const checkPhone = (rule, value, callback) => { if (!value) { @@ -59,7 +74,7 @@ export const tableOption = { prop: 'userId', span: 24, hide: true, - editDisabled: true, + editDisplay: false, addDisplay: false }, { fixed: true, @@ -73,13 +88,13 @@ export const tableOption = { required: true, message: '请输入用户名' }, - { - min: 3, - max: 20, - message: '长度在 3 到 20 个字符', - trigger: 'blur' - }, - { validator: validateUsername, trigger: 'blur' } + { + min: 3, + max: 20, + message: '长度在 3 到 20 个字符', + trigger: 'blur' + }, + {validator: validateUsername, trigger: 'blur'} ] }, { label: '密码', @@ -88,16 +103,7 @@ export const tableOption = { value: '', hide: true, span: 24, - rules: [{ - required: true, - message: '密码不能为空', - trigger: 'blur' - },{ - min: 6, - max: 20, - message: '长度在 6 到 20 个字符', - trigger: 'blur' - }] + rules: [{validator: checkPassword, trigger: 'blur'}] }, { label: '所属部门', prop: 'deptId', @@ -116,11 +122,11 @@ export const tableOption = { type: 'phone', value: '', span: 24, - rules: [ { + rules: [{ required: true, message: '密码不能为空', trigger: 'blur' - },{ + }, { validator: checkPhone, trigger: 'blur' }] diff --git a/src/main.js b/src/main.js index 0935554..673ef3a 100644 --- a/src/main.js +++ b/src/main.js @@ -26,12 +26,12 @@ import basicContainer from './components/basic-container/main' Vue.use(VueAxios, axios) Vue.use(ElementUI, { - size: 'medium', + size: 'small', menuType: 'text' }) Vue.use(Avue, { - size: 'medium', + size: 'small', menuType: 'text' }) diff --git a/src/page/index/tags.vue b/src/page/index/tags.vue index f40bdfd..43f42a3 100644 --- a/src/page/index/tags.vue +++ b/src/page/index/tags.vue @@ -27,7 +27,7 @@ + > 更多 diff --git a/src/page/login/index.vue b/src/page/login/index.vue index a524945..6799556 100644 --- a/src/page/login/index.vue +++ b/src/page/login/index.vue @@ -6,7 +6,7 @@ src="/img/logo.png" alt="">

{{website.infoTitle}}

-

©2020 v2.7.3

+

©2020 v2.7.5