Bladeren bron

修改创建账号规则

wxy 4 maanden geleden
bovenliggende
commit
49458c4fb2

+ 1 - 1
src/components/Search/index.vue

@@ -21,7 +21,7 @@
 </template>
 
 <script setup>
-import { ref, defineProps, toRefs, onMounted, watch, watchEffect } from 'vue';
+import { ref, defineProps, toRefs, watch } from 'vue';
 import { Getdictionary } from "@/mixins/index.js";
 
 // 接收 props

+ 2 - 2
src/views/system/user/config.js

@@ -17,8 +17,8 @@ export const columns = [
     slotName: 'state',
     width:200 
   },
-  { title: '更新时间', dataIndex: 'updated_at', align: 'center', width:200 },
-  { title: '创建时间', dataIndex: 'created_at', align: 'center', width:200 },
+  { title: '更新时间', dataIndex: 'updatedAt', align: 'center', width:200 },
+  { title: '创建时间', dataIndex: 'createdAt', align: 'center', width:200 },
   {
     title: '操作',
     dataIndex: 'id',

+ 2 - 2
src/views/system/user/form.vue

@@ -143,7 +143,7 @@ const getRoleList = async () => {
 
 const changeKeyName = async (value, cb) => {
   const rgxText = '账号为数字或字母,长度6-20!'
-  if (/^[0-9 | A-Z | a-z]{6,20}$/.test(value.toString())) {
+  if (/^[0-9 | A-Z | a-z]{5,20}$/.test(value.toString())) {
     cb()
   } else {
     cb(value ? rgxText : '')
@@ -154,7 +154,7 @@ const changeKeyPassword =  async (value, cb) => {
     cb()
     return
   }
-  const rgx = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/
+  const rgx = /^(?=.*[0-9])(?=.*[a-zA-Z])[0-9A-Za-z\W_]{6,20}$/;
   const rgxText = '密码至少包含 数字和英文,长度6-20!'
   if (rgx.test(value)) {
     cb()

+ 2 - 3
src/views/system/user/index.vue

@@ -53,6 +53,7 @@
       v-else
       :data="userManagementAddData"
       @return-main="evReturnMain"
+
     />  
   </div>
 </template>
@@ -82,9 +83,7 @@ const pagination = ref({
   current: 1,
 })  
 const evReturnMain = (state = true) => {
-  if (state) {
-    // evInit()
-  }
+  intData()
   userFormDataState.value = state
 }