瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

yangyuxuan 5 天之前
父節點
當前提交
daf538e7d6
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 3 1
      src/components/FileUpload/index.vue
  2. 1 1
      src/store/modules/user.ts

+ 3 - 1
src/components/FileUpload/index.vue

@@ -50,6 +50,7 @@
 
 <script setup lang="ts" name="FileUpload">
 import { propTypes } from '@/utils/propTypes';
+import { getToken } from '@/utils/auth';
 import { download2, globalHeaders } from '@/utils/request';
 import { v1 as uuidv1 } from 'uuid';
 import axios from 'axios';
@@ -183,7 +184,8 @@ const uploadByPieces = async (url, { fileName, file }) => {
         data,
         params,
         headers: {
-          'Content-Type': 'multipart/form-data'
+          'Content-Type': 'multipart/form-data',
+          'Authorization': 'Bearer ' + getToken()
         }
       })
         .then((res) => {

+ 1 - 1
src/store/modules/user.ts

@@ -15,7 +15,7 @@ export const useUserStore = defineStore('user', () => {
   const roles = ref<Array<string>>([]); // 用户角色编码集合 → 判断路由权限
   const permissions = ref<Array<string>>([]); // 用户权限编码集合 → 判断按钮权限
   // 空闲超时时间
-  const idleTimeout = ref<number>(15 * 60 * 1000);
+  const idleTimeout = ref<number>(60 * 60 * 1000);
   // 最后操作时间
   const lastRequestTime = ref<number>();