Skip to content

Commit a0dcef4

Browse files
committed
fix:【MP 公众号】上传资源时,无法刷新令牌的问题
1 parent 49e5fc3 commit a0dcef4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/views/mp/material/components/upload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { UploadProps, UploadRawFile } from 'element-plus'
2-
import { getAccessToken } from '@/utils/auth'
2+
import { getRefreshToken } from '@/utils/auth'
33
import { UploadType, useBeforeUpload } from '@/views/mp/hooks/useUpload'
44

5-
const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } // 请求头
5+
const HEADERS = { Authorization: 'Bearer ' + getRefreshToken() } // 请求头(解决 el-upload 上传过程中,无法刷新令牌的问题)
66
const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-permanent' // 上传地址
77

88
interface UploadData {

0 commit comments

Comments
 (0)