Browse Source

chore: update 184

xingyu4j 2 years ago
parent
commit
84cb1bd4db

+ 2 - 2
yudao-ui-admin-vue3/package.json

@@ -1,6 +1,6 @@
 {
   "name": "ruoyi-vue-pro-vue3",
-  "version": "1.6.4.1831",
+  "version": "1.6.4.1841",
   "description": "基于vue3、vite3、element-plus、typesScript",
   "author": "xingyu",
   "private": false,
@@ -31,7 +31,7 @@
     "@wangeditor/editor-for-vue": "^5.1.10",
     "@zxcvbn-ts/core": "^2.1.0",
     "animate.css": "^4.1.1",
-    "axios": "^0.27.2",
+    "axios": "^1.1.3",
     "crypto-js": "^4.1.1",
     "dayjs": "^1.11.6",
     "echarts": "^5.4.0",

+ 9 - 4
yudao-ui-admin-vue3/pnpm-lock.yaml

@@ -23,7 +23,7 @@ specifiers:
   '@zxcvbn-ts/core': ^2.1.0
   animate.css: ^4.1.1
   autoprefixer: ^10.4.13
-  axios: ^0.27.2
+  axios: ^1.1.3
   crypto-js: ^4.1.1
   dayjs: ^1.11.6
   echarts: ^5.4.0
@@ -87,7 +87,7 @@ dependencies:
   '@wangeditor/editor-for-vue': 5.1.12_wrllzy32b3ic46yjdgf3mkhqlq
   '@zxcvbn-ts/core': 2.1.0
   animate.css: 4.1.1
-  axios: 0.27.2
+  axios: 1.1.3
   crypto-js: 4.1.1
   dayjs: 1.11.6
   echarts: 5.4.0
@@ -2072,11 +2072,12 @@ packages:
       - debug
     dev: true
 
-  /axios/0.27.2:
-    resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==}
+  /axios/1.1.3:
+    resolution: {integrity: sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==}
     dependencies:
       follow-redirects: 1.15.2
       form-data: 4.0.0
+      proxy-from-env: 1.1.0
     transitivePeerDependencies:
       - debug
     dev: false
@@ -5709,6 +5710,10 @@ packages:
     engines: {node: '>=6'}
     dev: false
 
+  /proxy-from-env/1.1.0:
+    resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
+    dev: false
+
   /prr/1.0.1:
     resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==}
     dev: true

+ 5 - 0
yudao-ui-admin-vue3/src/components/Form/src/Form.vue

@@ -226,6 +226,11 @@ export default defineComponent({
                   vModel={formModel.value[item.field]}
                   {...(autoSetPlaceholder && setTextPlaceholder(item))}
                   {...setComponentProps(item)}
+                  style={
+                    item?.component === 'Input'
+                      ? { width: '189.5px', ...item.componentProps?.style }
+                      : { ...item.componentProps?.style }
+                  }
                   {...(notRenderOptions.includes(item?.component as string) &&
                   item?.componentProps?.options
                     ? { options: item?.componentProps?.options || [] }

+ 6 - 1
yudao-ui-admin-vue3/src/components/Form/src/components/useRenderCheckbox.tsx

@@ -11,7 +11,12 @@ export const useRenderCheckbox = () => {
       typeof defineComponent
     >
     return item?.componentProps?.options?.map((option) => {
-      return <Com label={option[labelAlias || 'value']}>{option[valueAlias || 'label']}</Com>
+      const { value, ...other } = option
+      return (
+        <Com label={option[labelAlias || 'value']} {...other}>
+          {option[valueAlias || 'label']}
+        </Com>
+      )
     })
   }
 

+ 6 - 1
yudao-ui-admin-vue3/src/components/Form/src/components/useRenderRadio.tsx

@@ -11,7 +11,12 @@ export const useRenderRadio = () => {
       typeof defineComponent
     >
     return item?.componentProps?.options?.map((option) => {
-      return <Com label={option[labelAlias || 'value']}>{option[valueAlias || 'label']}</Com>
+      const { value, ...other } = option
+      return (
+        <Com label={option[labelAlias || 'value']} {...other}>
+          {option[valueAlias || 'label']}
+        </Com>
+      )
     })
   }
 

+ 2 - 2
yudao-ui-admin-vue3/src/components/Menu/src/Menu.vue

@@ -220,10 +220,10 @@ export default defineComponent({
 
   // 水平菜单
   &__horizontal {
-    height: calc(~'var( - -top-tool-height)') !important;
+    height: calc(~'var(--top-tool-height)') !important;
 
     :deep(.@{elNamespace}-menu--horizontal) {
-      height: calc(~'var( - -top-tool-height)');
+      height: calc(~'var(--top-tool-height)');
       border-bottom: none;
       // 重新设置底部高亮颜色
       & > .@{elNamespace}-sub-menu.is-active {

+ 5 - 5
yudao-ui-admin-vue3/src/config/axios/service.ts

@@ -48,7 +48,7 @@ service.interceptors.request.use(
     // 设置租户
     if (tenantEnable) {
       const tenantId = getTenantId()
-      if (tenantId) (config as Recordable).headers.common['tenant-id'] = tenantId
+      if (tenantId) service.defaults.headers.common['tenant-id'] = tenantId
     }
     const params = config.params || {}
     const data = config.data || false
@@ -94,7 +94,7 @@ service.interceptors.request.use(
 
 // response 拦截器
 service.interceptors.response.use(
-  async (response: AxiosResponse<Recordable>) => {
+  async (response: AxiosResponse<any>) => {
     const { data } = response
     const config = response.config
     if (!data) {
@@ -104,7 +104,6 @@ service.interceptors.response.use(
     const { t } = useI18n()
     // 未设置状态码则默认成功状态
     const code = data.code || result_code
-    // 二进制数据则直接返回
     if (
       response.request.responseType === 'blob' ||
       response.request.responseType === 'arraybuffer'
@@ -126,10 +125,11 @@ service.interceptors.response.use(
         }
         // 2. 进行刷新访问令牌
         try {
-          const refreshTokenRes = await refreshToken()
+          const refreshTokenRes = refreshToken()
           // 2.1 刷新成功,则回放队列的请求 + 当前请求
-          setToken(refreshTokenRes.data.data)
+          setToken((await refreshTokenRes).data.data)
           config.headers!.Authorization = 'Bearer ' + getAccessToken()
+          service.defaults.headers.Authorization = 'Bearer ' + getAccessToken()
           requestList.forEach((cb: any) => {
             cb()
           })