Browse Source

用户信息长度校验限制

tags/v3.1.0
RuoYi 3 years ago
parent
commit
58b4600144
  1. 14
      ruoyi-ui/src/views/system/user/index.vue
  2. 2
      ruoyi-ui/src/views/system/user/profile/userInfo.vue

14
ruoyi-ui/src/views/system/user/index.vue

@ -209,7 +209,7 @@ @@ -209,7 +209,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="用户昵称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户昵称" />
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -233,12 +233,12 @@ @@ -233,12 +233,12 @@
<el-row>
<el-col :span="12">
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" />
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" />
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" />
</el-form-item>
</el-col>
</el-row>
@ -437,7 +437,8 @@ export default { @@ -437,7 +437,8 @@ export default {
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
],
password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" }
{ required: true, message: "用户密码不能为空", trigger: "blur" },
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
],
email: [
{
@ -589,7 +590,10 @@ export default { @@ -589,7 +590,10 @@ export default {
handleResetPwd(row) {
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消"
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^.{5,20}$/,
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
}).then(({ value }) => {
resetUserPwd(row.userId, value).then(response => {
this.msgSuccess("修改成功,新密码是:" + value);

2
ruoyi-ui/src/views/system/user/profile/userInfo.vue

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<template>
<el-form ref="form" :model="user" :rules="rules" label-width="80px">
<el-form-item label="用户昵称" prop="nickName">
<el-input v-model="user.nickName" />
<el-input v-model="user.nickName" maxlength="30" />
</el-form-item>
<el-form-item label="手机号码" prop="phonenumber">
<el-input v-model="user.phonenumber" maxlength="11" />

Loading…
Cancel
Save