diff --git a/src/utils/auth.js b/src/utils/auth.js index 2fe05d8..748f3c5 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -4,6 +4,12 @@ const TokenKey = 'Admin-Token' export function getToken() { console.log('getToken') + // 先从 sessionStorage 获取 + const token = sessionStorage.getItem(TokenKey) + if (token) { + return token + } + // 如果 sessionStorage 没有,再从 Cookie 获取 return Cookies.get(TokenKey) } diff --git a/src/views/routine/disciplinaryApplication/index.vue b/src/views/routine/disciplinaryApplication/index.vue index e83c059..50d43df 100644 --- a/src/views/routine/disciplinaryApplication/index.vue +++ b/src/views/routine/disciplinaryApplication/index.vue @@ -244,6 +244,7 @@ :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" + :with-credentials="true" drag > @@ -510,6 +511,9 @@ export default { handleImport() { this.upload.title = "学生处分导入"; this.upload.open = true; + console.log('Token:', getToken()); + console.log('Upload headers:', this.upload.headers); + console.log('Upload url:', this.upload.url); }, /** 下载模板操作 */ importTemplate() { diff --git a/src/views/routine/relieve/index.vue b/src/views/routine/relieve/index.vue index 3b94a09..e7268e4 100644 --- a/src/views/routine/relieve/index.vue +++ b/src/views/routine/relieve/index.vue @@ -29,6 +29,9 @@ 导出 + + 解除处分导入 + @@ -189,11 +192,40 @@ 取 消 + + + + + + 将文件拖到此处,或点击上传 + + 仅允许导入 xls、xlsx 格式文件。 + 下载模板 + + + +