6 Commits 8bb80c01a1 ... e8e9b95992

Author SHA1 Message Date
  木星 e8e9b95992 Merge branch 'master' into release/V1.0.0/test 1 month ago
  木星 b75808972b 修改上传模型传参判断 1 month ago
  木星 526d411992 注释授权码 2 months ago
  木星 926fca535d 添加手机号验证 2 months ago
  木星 1de88eb872 添加上传zip格式判断 2 months ago
  木星 0b1a5c5edf 添加登录参数 2 months ago

+ 1 - 1
.env.base

@@ -10,7 +10,7 @@
10
 VITE_NODE_ENV=development
10
 VITE_NODE_ENV=development
11
 
11
 
12
 # 接口前缀
12
 # 接口前缀
13
-VITE_API_BASE_PATH='https://test.you07.com/link-server'
13
+VITE_API_BASE_PATH='http://192.168.4.194:9099/link-server'
14
 
14
 
15
 # 打包路径
15
 # 打包路径
16
 VITE_BASE_PATH=/
16
 VITE_BASE_PATH=/

+ 1 - 1
.env.dev

@@ -10,7 +10,7 @@
10
 VITE_NODE_ENV=production
10
 VITE_NODE_ENV=production
11
 
11
 
12
 # 接口前缀
12
 # 接口前缀
13
-VITE_API_BASE_PATH='https://test.you07.com/link-server'
13
+VITE_API_BASE_PATH='http://192.168.4.194:9099/link-server'
14
 
14
 
15
 # 打包路径
15
 # 打包路径
16
 VITE_BASE_PATH=./
16
 VITE_BASE_PATH=./

+ 1 - 1
.env.gitee

@@ -2,7 +2,7 @@
2
 VITE_NODE_ENV=production
2
 VITE_NODE_ENV=production
3
 
3
 
4
 # 接口前缀
4
 # 接口前缀
5
-VITE_API_BASE_PATH='https://test.you07.com/link-server'
5
+VITE_API_BASE_PATH='http://192.168.4.194:9099/link-server'
6
 
6
 
7
 # 打包路径
7
 # 打包路径
8
 VITE_BASE_PATH=/vue-element-plus-admin/
8
 VITE_BASE_PATH=/vue-element-plus-admin/

+ 1 - 1
.env.pro

@@ -10,7 +10,7 @@
10
 VITE_NODE_ENV=production
10
 VITE_NODE_ENV=production
11
 
11
 
12
 # 接口前缀
12
 # 接口前缀
13
-VITE_API_BASE_PATH='https://test.you07.com/link-server'
13
+VITE_API_BASE_PATH='http://192.168.4.194:9099/link-server'
14
 # 打包路径
14
 # 打包路径
15
 VITE_BASE_PATH=./
15
 VITE_BASE_PATH=./
16
 
16
 

+ 1 - 1
.env.test

@@ -10,7 +10,7 @@
10
 VITE_NODE_ENV=production
10
 VITE_NODE_ENV=production
11
 
11
 
12
 # 接口前缀
12
 # 接口前缀
13
-VITE_API_BASE_PATH='https://test.you07.com/link-server'
13
+VITE_API_BASE_PATH='http://192.168.4.194:9099/link-server'
14
 
14
 
15
 # 打包路径
15
 # 打包路径
16
 VITE_BASE_PATH=./
16
 VITE_BASE_PATH=./

+ 1 - 1
index.html

@@ -14,7 +14,7 @@
14
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
14
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15
     <title><%= title %></title>
15
     <title><%= title %></title>
16
     <script>
16
     <script>
17
-     window.VITE_API_BASE_PATH='https://test.you07.com/link-server'
17
+     window.VITE_API_BASE_PATH='http://192.168.4.194:9099/link-server'
18
     </script>
18
     </script>
19
 
19
 
20
   </head>
20
   </head>

+ 1 - 1
src/App.vue

@@ -5,7 +5,7 @@ import { ConfigGlobal } from '@/components/ConfigGlobal'
5
 import { useDesign } from '@/hooks/web/useDesign'
5
 import { useDesign } from '@/hooks/web/useDesign'
6
 import { useUserStore } from '@/store/modules/user'
6
 import { useUserStore } from '@/store/modules/user'
7
 import router from './router'
7
 import router from './router'
8
-import { loginApi, getRsaKey, getTestRoleApi, getAdminRoleApi, getRefreshToken } from '@/api/login'
8
+import { getRefreshToken } from '@/api/login'
9
 
9
 
10
 const { getPrefixCls } = useDesign()
10
 const { getPrefixCls } = useDesign()
11
 
11
 

+ 12 - 1
src/hooks/web/useValidator.ts

@@ -35,6 +35,16 @@ export const useValidator = () => {
35
     }
35
     }
36
   }
36
   }
37
 
37
 
38
+  // 验证手机号码
39
+  const validateMobile = (val: string, callback: Callback, message: string) => {
40
+    const mobilePattern = /^1[3-9]\d{9}$/
41
+    if (!mobilePattern.test(val)) {
42
+      callback(new Error(message))
43
+    } else {
44
+      callback()
45
+    }
46
+  }
47
+
38
   const notSpace = (val: any, callback: Callback, message: string) => {
48
   const notSpace = (val: any, callback: Callback, message: string) => {
39
     // 用户名不能有空格
49
     // 用户名不能有空格
40
     if (val.indexOf(' ') !== -1) {
50
     if (val.indexOf(' ') !== -1) {
@@ -86,6 +96,7 @@ export const useValidator = () => {
86
     notSpace,
96
     notSpace,
87
     notSpecialCharacters,
97
     notSpecialCharacters,
88
     onlyEnglish,
98
     onlyEnglish,
89
-    noSpaceOrSpecialChars
99
+    noSpaceOrSpecialChars,
100
+    validateMobile
90
   }
101
   }
91
 }
102
 }

+ 63 - 59
src/views/Authority/User.vue

@@ -30,10 +30,9 @@ import { Form, FormSchema, RadioOption } from '@/components/Form'
30
 import { useForm } from '@/hooks/web/useForm'
30
 import { useForm } from '@/hooks/web/useForm'
31
 import { useValidator } from '@/hooks/web/useValidator'
31
 import { useValidator } from '@/hooks/web/useValidator'
32
 import { BaseButton } from '@/components/Button'
32
 import { BaseButton } from '@/components/Button'
33
-import { Search, Edit, Delete } from '@element-plus/icons-vue'
34
 import { getRsaKey } from '@/api/login'
33
 import { getRsaKey } from '@/api/login'
35
 import { cloneDeep } from 'lodash-es'
34
 import { cloneDeep } from 'lodash-es'
36
-const { required, noSpaceOrSpecialChars } = useValidator()
35
+const { required, noSpaceOrSpecialChars, validateMobile } = useValidator()
37
 
36
 
38
 defineOptions({
37
 defineOptions({
39
   name: 'TemplateManage'
38
   name: 'TemplateManage'
@@ -47,6 +46,11 @@ const rules = reactive<{
47
       validator: (rule, value, callback) =>
46
       validator: (rule, value, callback) =>
48
         noSpaceOrSpecialChars(value, callback, '不包含中文、空格、特殊字符')
47
         noSpaceOrSpecialChars(value, callback, '不包含中文、空格、特殊字符')
49
     }
48
     }
49
+  ],
50
+  userCode: [
51
+    {
52
+      validator: (rule, value, callback) => validateMobile(value, callback, '请输入正确手机号')
53
+    }
50
   ]
54
   ]
51
 })
55
 })
52
 
56
 
@@ -126,23 +130,23 @@ let schema = reactive<FormSchema[]>([
126
     },
130
     },
127
     formItemProps: {}
131
     formItemProps: {}
128
   },
132
   },
129
-  {
130
-    field: 'authorizationCode',
131
-    label: '授权码',
132
-    component: 'Input',
133
-    colProps: {
134
-      span: 24
135
-    },
136
-    componentProps: {
137
-      style: {
138
-        width: '100%'
139
-      },
140
-      placeholder: '请输入授权码'
141
-    },
142
-    formItemProps: {
143
-      rules: [required()]
144
-    }
145
-  },
133
+  // {
134
+  //   field: 'authorizationCode',
135
+  //   label: '授权码',
136
+  //   component: 'Input',
137
+  //   colProps: {
138
+  //     span: 24
139
+  //   },
140
+  //   componentProps: {
141
+  //     style: {
142
+  //       width: '100%'
143
+  //     },
144
+  //     placeholder: '请输入授权码'
145
+  //   },
146
+  //   formItemProps: {
147
+  //     rules: [required()]
148
+  //   }
149
+  // },
146
   {
150
   {
147
     field: 'hasManage',
151
     field: 'hasManage',
148
     label: '是否进入后台',
152
     label: '是否进入后台',
@@ -209,7 +213,7 @@ const signIn = async () => {
209
       }
213
       }
210
 
214
 
211
       nweformData.userCode = encryptedData(res2.data, formData.userCode)
215
       nweformData.userCode = encryptedData(res2.data, formData.userCode)
212
-      nweformData.authorizationCode = encryptedData(res2.data, formData.authorizationCode)
216
+      // nweformData.authorizationCode = encryptedData(res2.data, formData.authorizationCode)
213
       let res = await saveUser(nweformData)
217
       let res = await saveUser(nweformData)
214
       if (res) {
218
       if (res) {
215
         dialogVisible.value = false
219
         dialogVisible.value = false
@@ -317,7 +321,7 @@ const editUser = async (data) => {
317
         style: {
321
         style: {
318
           width: '100%'
322
           width: '100%'
319
         },
323
         },
320
-        placeholder: '请输入8位数字',
324
+        placeholder: '请输入电话号码',
321
         disabled: isedit.value === '添加用户' ? false : true
325
         disabled: isedit.value === '添加用户' ? false : true
322
       },
326
       },
323
       formItemProps: {
327
       formItemProps: {
@@ -356,23 +360,23 @@ const editUser = async (data) => {
356
       },
360
       },
357
       formItemProps: {}
361
       formItemProps: {}
358
     },
362
     },
359
-    {
360
-      field: 'authorizationCode',
361
-      label: '授权码',
362
-      component: 'Input',
363
-      colProps: {
364
-        span: 24
365
-      },
366
-      componentProps: {
367
-        style: {
368
-          width: '100%'
369
-        },
370
-        placeholder: '请输入授权码'
371
-      },
372
-      formItemProps: {
373
-        rules: [required()]
374
-      }
375
-    },
363
+    // {
364
+    //   field: 'authorizationCode',
365
+    //   label: '授权码',
366
+    //   component: 'Input',
367
+    //   colProps: {
368
+    //     span: 24
369
+    //   },
370
+    //   componentProps: {
371
+    //     style: {
372
+    //       width: '100%'
373
+    //     },
374
+    //     placeholder: '请输入授权码'
375
+    //   },
376
+    //   formItemProps: {
377
+    //     rules: [required()]
378
+    //   }
379
+    // },
376
     {
380
     {
377
       field: 'hasManage',
381
       field: 'hasManage',
378
       label: '是否进入后台',
382
       label: '是否进入后台',
@@ -427,7 +431,7 @@ const editUser = async (data) => {
427
 
431
 
428
   let res = await getUserDetail(arr)
432
   let res = await getUserDetail(arr)
429
   res.data.userCode = decrypt(res.data.userCode, key2)
433
   res.data.userCode = decrypt(res.data.userCode, key2)
430
-  res.data.authorizationCode = decrypt(res.data.authorizationCode, key2)
434
+  // res.data.authorizationCode = decrypt(res.data.authorizationCode, key2)
431
   if (res) {
435
   if (res) {
432
     dialogVisible.value = true
436
     dialogVisible.value = true
433
     const formRef = await getElFormExpose()
437
     const formRef = await getElFormExpose()
@@ -437,7 +441,7 @@ const editUser = async (data) => {
437
     formData.userCode = res.data.userCode
441
     formData.userCode = res.data.userCode
438
     formData.displayName = res.data.displayName
442
     formData.displayName = res.data.displayName
439
     formData.hasManage = res.data.hasManage
443
     formData.hasManage = res.data.hasManage
440
-    formData.authorizationCode = res.data.authorizationCode
444
+    // formData.authorizationCode = res.data.authorizationCode
441
     formData.roleIds = res.data.roleInfoList[0].roleName
445
     formData.roleIds = res.data.roleInfoList[0].roleName
442
     formData.userId = res.data.userId
446
     formData.userId = res.data.userId
443
   }
447
   }
@@ -517,7 +521,7 @@ const tianjia = async () => {
517
         style: {
521
         style: {
518
           width: '100%'
522
           width: '100%'
519
         },
523
         },
520
-        placeholder: '请输入8位数字',
524
+        placeholder: '请输入电话号码',
521
         disabled: isedit.value === '添加用户' ? false : true
525
         disabled: isedit.value === '添加用户' ? false : true
522
       },
526
       },
523
       formItemProps: {
527
       formItemProps: {
@@ -558,23 +562,23 @@ const tianjia = async () => {
558
         rules: [required()]
562
         rules: [required()]
559
       }
563
       }
560
     },
564
     },
561
-    {
562
-      field: 'authorizationCode',
563
-      label: '授权码',
564
-      component: 'Input',
565
-      colProps: {
566
-        span: 24
567
-      },
568
-      componentProps: {
569
-        style: {
570
-          width: '100%'
571
-        },
572
-        placeholder: '请输入授权码'
573
-      },
574
-      formItemProps: {
575
-        rules: [required()]
576
-      }
577
-    },
565
+    // {
566
+    //   field: 'authorizationCode',
567
+    //   label: '授权码',
568
+    //   component: 'Input',
569
+    //   colProps: {
570
+    //     span: 24
571
+    //   },
572
+    //   componentProps: {
573
+    //     style: {
574
+    //       width: '100%'
575
+    //     },
576
+    //     placeholder: '请输入授权码'
577
+    //   },
578
+    //   formItemProps: {
579
+    //     rules: [required()]
580
+    //   }
581
+    // },
578
     {
582
     {
579
       field: 'hasManage',
583
       field: 'hasManage',
580
       label: '是否进入后台',
584
       label: '是否进入后台',
@@ -660,7 +664,7 @@ const tianjia = async () => {
660
     />
664
     />
661
   </ContentWrap>
665
   </ContentWrap>
662
 
666
 
663
-  <Dialog v-model="dialogVisible" maxHeight="380px" width="35rem" :title="isedit">
667
+  <Dialog v-model="dialogVisible" maxHeight="250px" width="35rem" :title="isedit">
664
     <Form label-position="left" :rules="rules" :schema="schema" @register="formRegister" />
668
     <Form label-position="left" :rules="rules" :schema="schema" @register="formRegister" />
665
 
669
 
666
     <template #footer>
670
     <template #footer>

+ 21 - 20
src/views/Login/components/LoginForm.vue

@@ -47,8 +47,8 @@ const { t } = useI18n()
47
 
47
 
48
 const rules = {
48
 const rules = {
49
   username: [required()],
49
   username: [required()],
50
-  password: [required()],
51
-  authCode: [required()]
50
+  password: [required()]
51
+  // authCode: [required()]
52
 }
52
 }
53
 
53
 
54
 const schema = reactive<FormSchema[]>([
54
 const schema = reactive<FormSchema[]>([
@@ -96,21 +96,21 @@ const schema = reactive<FormSchema[]>([
96
       prefixIcon: <Icon icon="mdi:password-outline" />
96
       prefixIcon: <Icon icon="mdi:password-outline" />
97
     }
97
     }
98
   },
98
   },
99
-  {
100
-    field: 'authCode',
101
-    // value: 'admin',
102
-    component: 'InputPassword',
103
-    colProps: {
104
-      span: 24
105
-    },
106
-    componentProps: {
107
-      style: {
108
-        width: '100%'
109
-      },
110
-      placeholder: '请输入授权码',
111
-      prefixIcon: <Icon icon="tdesign:secured" />
112
-    }
113
-  },
99
+  // {
100
+  //   field: 'authCode',
101
+  //   // value: 'admin',
102
+  //   component: 'InputPassword',
103
+  //   colProps: {
104
+  //     span: 24
105
+  //   },
106
+  //   // componentProps: {
107
+  //   //   style: {
108
+  //   //     width: '100%'
109
+  //   //   },
110
+  //   //   placeholder: '请输入授权码',
111
+  //   //   prefixIcon: <Icon icon="tdesign:secured" />
112
+  //   // }
113
+  // },
114
   {
114
   {
115
     field: 'login',
115
     field: 'login',
116
     colProps: {
116
     colProps: {
@@ -121,7 +121,7 @@ const schema = reactive<FormSchema[]>([
121
         default: () => {
121
         default: () => {
122
           return (
122
           return (
123
             <>
123
             <>
124
-              <div class="w-[100%]">
124
+              <div style="    margin-top: 50px;" class="w-[100%]">
125
                 <BaseButton
125
                 <BaseButton
126
                   style="font-size: 1.3rem; height: 2.5rem; "
126
                   style="font-size: 1.3rem; height: 2.5rem; "
127
                   loading={loading.value}
127
                   loading={loading.value}
@@ -193,7 +193,8 @@ const signIn = async () => {
193
 
193
 
194
         nweformData.password = encryptedData(res2.data, formData.password)
194
         nweformData.password = encryptedData(res2.data, formData.password)
195
         nweformData.username = encryptedData(res2.data, formData.username)
195
         nweformData.username = encryptedData(res2.data, formData.username)
196
-        nweformData.authCode = encryptedData(res2.data, formData.authCode)
196
+        // nweformData.authCode = encryptedData(res2.data, formData.authCode)
197
+
197
         const res = await loginApi(nweformData)
198
         const res = await loginApi(nweformData)
198
 
199
 
199
         if (res) {
200
         if (res) {
@@ -291,7 +292,7 @@ const getRole = async () => {
291
       userStore.setRoleRouters([])
292
       userStore.setRoleRouters([])
292
       formData.username = ''
293
       formData.username = ''
293
       formData.password = ''
294
       formData.password = ''
294
-      formData.authCode = ''
295
+      // formData.authCode = ''
295
       ElMessage.error('暂无权限,请联系管理员')
296
       ElMessage.error('暂无权限,请联系管理员')
296
     }
297
     }
297
   }
298
   }

+ 9 - 1
src/views/Resource/ResourceManage.vue

@@ -34,6 +34,8 @@ defineOptions({
34
   name: 'TemplateManage'
34
   name: 'TemplateManage'
35
 })
35
 })
36
 
36
 
37
+const compare = ref('')
38
+
37
 const { tableRegister, tableState, tableMethods } = useTable({
39
 const { tableRegister, tableState, tableMethods } = useTable({
38
   fetchDataApi: async () => {
40
   fetchDataApi: async () => {
39
     const { currentPage, pageSize } = tableState
41
     const { currentPage, pageSize } = tableState
@@ -250,6 +252,7 @@ const edittab = async (data: TableSlotDefault) => {
250
   formData.categoryName = data.row.categoryName
252
   formData.categoryName = data.row.categoryName
251
   formData.compressFileName = data.row.compressFileName
253
   formData.compressFileName = data.row.compressFileName
252
   formData.compressFilePath = data.row.compressFilePath
254
   formData.compressFilePath = data.row.compressFilePath
255
+  compare.value = data.row.compressFilePath
253
   formData.icon = data.row.icon.replace(PATH_URL, '')
256
   formData.icon = data.row.icon.replace(PATH_URL, '')
254
   imageUrl.value = data.row.icon
257
   imageUrl.value = data.row.icon
255
   formData.categoryId = data.row.categoryId
258
   formData.categoryId = data.row.categoryId
@@ -265,7 +268,11 @@ const signIn = async () => {
265
   const formRef = await getElFormExpose()
268
   const formRef = await getElFormExpose()
266
   const formData = await getFormData()
269
   const formData = await getFormData()
267
   console.log('lplplp', formData.compressFilePath)
270
   console.log('lplplp', formData.compressFilePath)
268
-  if (formData.compressFilePath) {
271
+  if (
272
+    formData.compressFilePath !== compare.value &&
273
+    formData.compressFilePath !== '' &&
274
+    formData.compressFilePath
275
+  ) {
269
     formData.uploadCompress = true
276
     formData.uploadCompress = true
270
   } else {
277
   } else {
271
     formData.uploadCompress = false
278
     formData.uploadCompress = false
@@ -325,6 +332,7 @@ const tianjia = async () => {
325
   isedit.value = '添加'
332
   isedit.value = '添加'
326
   schema[2].componentProps.fileList = []
333
   schema[2].componentProps.fileList = []
327
   dialogVisible.value = true
334
   dialogVisible.value = true
335
+  compare.value = ''
328
 }
336
 }
329
 </script>
337
 </script>
330
 
338
 

+ 1 - 1
src/views/Template/TemplateManage.vue

@@ -216,7 +216,7 @@ const schema = reactive<FormSchema[]>([
216
       },
216
       },
217
       beforeUpload: (rawFile) => {
217
       beforeUpload: (rawFile) => {
218
         console.log('kokokoko', rawFile)
218
         console.log('kokokoko', rawFile)
219
-        if (rawFile.type !== 'application/x-zip-compressed') {
219
+        if (rawFile.type !== 'application/x-zip-compressed' || rawFile.type !== 'application/zip') {
220
           ElMessage.error('只能上传ZIP文件')
220
           ElMessage.error('只能上传ZIP文件')
221
           return false
221
           return false
222
         } else if (rawFile.size / 1024 / 1024 > 2048) {
222
         } else if (rawFile.size / 1024 / 1024 > 2048) {