Pārlūkot izejas kodu

Merge branch 'master' into release/V1.0.0/test

木星 1 mēnesi atpakaļ
vecāks
revīzija
e8e9b95992

+ 1 - 1
.env.base

@@ -10,7 +10,7 @@
10 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 16
 VITE_BASE_PATH=/

+ 1 - 1
.env.dev

@@ -10,7 +10,7 @@
10 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 16
 VITE_BASE_PATH=./

+ 1 - 1
.env.gitee

@@ -2,7 +2,7 @@
2 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 8
 VITE_BASE_PATH=/vue-element-plus-admin/

+ 1 - 1
.env.pro

@@ -10,7 +10,7 @@
10 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
 VITE_BASE_PATH=./
16 16
 

+ 1 - 1
.env.test

@@ -10,7 +10,7 @@
10 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 16
 VITE_BASE_PATH=./

+ 1 - 1
index.html

@@ -14,7 +14,7 @@
14 14
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15 15
     <title><%= title %></title>
16 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 18
     </script>
19 19
 
20 20
   </head>

+ 1 - 1
src/App.vue

@@ -5,7 +5,7 @@ import { ConfigGlobal } from '@/components/ConfigGlobal'
5 5
 import { useDesign } from '@/hooks/web/useDesign'
6 6
 import { useUserStore } from '@/store/modules/user'
7 7
 import router from './router'
8
-import { loginApi, getRsaKey, getTestRoleApi, getAdminRoleApi, getRefreshToken } from '@/api/login'
8
+import { getRefreshToken } from '@/api/login'
9 9
 
10 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 48
   const notSpace = (val: any, callback: Callback, message: string) => {
39 49
     // 用户名不能有空格
40 50
     if (val.indexOf(' ') !== -1) {
@@ -86,6 +96,7 @@ export const useValidator = () => {
86 96
     notSpace,
87 97
     notSpecialCharacters,
88 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 30
 import { useForm } from '@/hooks/web/useForm'
31 31
 import { useValidator } from '@/hooks/web/useValidator'
32 32
 import { BaseButton } from '@/components/Button'
33
-import { Search, Edit, Delete } from '@element-plus/icons-vue'
34 33
 import { getRsaKey } from '@/api/login'
35 34
 import { cloneDeep } from 'lodash-es'
36
-const { required, noSpaceOrSpecialChars } = useValidator()
35
+const { required, noSpaceOrSpecialChars, validateMobile } = useValidator()
37 36
 
38 37
 defineOptions({
39 38
   name: 'TemplateManage'
@@ -47,6 +46,11 @@ const rules = reactive<{
47 46
       validator: (rule, value, callback) =>
48 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 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 151
     field: 'hasManage',
148 152
     label: '是否进入后台',
@@ -209,7 +213,7 @@ const signIn = async () => {
209 213
       }
210 214
 
211 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 217
       let res = await saveUser(nweformData)
214 218
       if (res) {
215 219
         dialogVisible.value = false
@@ -317,7 +321,7 @@ const editUser = async (data) => {
317 321
         style: {
318 322
           width: '100%'
319 323
         },
320
-        placeholder: '请输入8位数字',
324
+        placeholder: '请输入电话号码',
321 325
         disabled: isedit.value === '添加用户' ? false : true
322 326
       },
323 327
       formItemProps: {
@@ -356,23 +360,23 @@ const editUser = async (data) => {
356 360
       },
357 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 381
       field: 'hasManage',
378 382
       label: '是否进入后台',
@@ -427,7 +431,7 @@ const editUser = async (data) => {
427 431
 
428 432
   let res = await getUserDetail(arr)
429 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 435
   if (res) {
432 436
     dialogVisible.value = true
433 437
     const formRef = await getElFormExpose()
@@ -437,7 +441,7 @@ const editUser = async (data) => {
437 441
     formData.userCode = res.data.userCode
438 442
     formData.displayName = res.data.displayName
439 443
     formData.hasManage = res.data.hasManage
440
-    formData.authorizationCode = res.data.authorizationCode
444
+    // formData.authorizationCode = res.data.authorizationCode
441 445
     formData.roleIds = res.data.roleInfoList[0].roleName
442 446
     formData.userId = res.data.userId
443 447
   }
@@ -517,7 +521,7 @@ const tianjia = async () => {
517 521
         style: {
518 522
           width: '100%'
519 523
         },
520
-        placeholder: '请输入8位数字',
524
+        placeholder: '请输入电话号码',
521 525
         disabled: isedit.value === '添加用户' ? false : true
522 526
       },
523 527
       formItemProps: {
@@ -558,23 +562,23 @@ const tianjia = async () => {
558 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 583
       field: 'hasManage',
580 584
       label: '是否进入后台',
@@ -660,7 +664,7 @@ const tianjia = async () => {
660 664
     />
661 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 668
     <Form label-position="left" :rules="rules" :schema="schema" @register="formRegister" />
665 669
 
666 670
     <template #footer>

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

@@ -47,8 +47,8 @@ const { t } = useI18n()
47 47
 
48 48
 const rules = {
49 49
   username: [required()],
50
-  password: [required()],
51
-  authCode: [required()]
50
+  password: [required()]
51
+  // authCode: [required()]
52 52
 }
53 53
 
54 54
 const schema = reactive<FormSchema[]>([
@@ -96,21 +96,21 @@ const schema = reactive<FormSchema[]>([
96 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 115
     field: 'login',
116 116
     colProps: {
@@ -121,7 +121,7 @@ const schema = reactive<FormSchema[]>([
121 121
         default: () => {
122 122
           return (
123 123
             <>
124
-              <div class="w-[100%]">
124
+              <div style="    margin-top: 50px;" class="w-[100%]">
125 125
                 <BaseButton
126 126
                   style="font-size: 1.3rem; height: 2.5rem; "
127 127
                   loading={loading.value}
@@ -193,7 +193,8 @@ const signIn = async () => {
193 193
 
194 194
         nweformData.password = encryptedData(res2.data, formData.password)
195 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 198
         const res = await loginApi(nweformData)
198 199
 
199 200
         if (res) {
@@ -291,7 +292,7 @@ const getRole = async () => {
291 292
       userStore.setRoleRouters([])
292 293
       formData.username = ''
293 294
       formData.password = ''
294
-      formData.authCode = ''
295
+      // formData.authCode = ''
295 296
       ElMessage.error('暂无权限,请联系管理员')
296 297
     }
297 298
   }

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

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

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

@@ -216,7 +216,7 @@ const schema = reactive<FormSchema[]>([
216 216
       },
217 217
       beforeUpload: (rawFile) => {
218 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 220
           ElMessage.error('只能上传ZIP文件')
221 221
           return false
222 222
         } else if (rawFile.size / 1024 / 1024 > 2048) {