Skip to content

Commit e985b25

Browse files
committed
【功能修复】Editor 无法刷新令牌的问题
1 parent aa37021 commit e985b25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/Editor/src/Editor.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { propTypes } from '@/utils/propTypes'
66
import { isNumber } from '@/utils/is'
77
import { ElMessage } from 'element-plus'
88
import { useLocaleStore } from '@/store/modules/locale'
9-
import { getAccessToken, getTenantId } from '@/utils/auth'
9+
import { getRefreshToken, getTenantId } from '@/utils/auth'
1010
import { getUploadUrl } from '@/components/UploadFile/src/useUpload'
1111
1212
defineOptions({ name: 'Editor' })
@@ -100,7 +100,7 @@ const editorConfig = computed((): IEditorConfig => {
100100
// 自定义增加 http header
101101
headers: {
102102
Accept: '*',
103-
Authorization: 'Bearer ' + getAccessToken(),
103+
Authorization: 'Bearer ' + getRefreshToken(), // 使用 getRefreshToken() 方法,而不使用 getAccessToken() 方法的原因:Editor 无法方便的刷新访问令牌
104104
'tenant-id': getTenantId()
105105
},
106106
@@ -148,7 +148,7 @@ const editorConfig = computed((): IEditorConfig => {
148148
// 自定义增加 http header
149149
headers: {
150150
Accept: '*',
151-
Authorization: 'Bearer ' + getAccessToken(),
151+
Authorization: 'Bearer ' + getRefreshToken(), // 使用 getRefreshToken() 方法,而不使用 getAccessToken() 方法的原因:Editor 无法方便的刷新访问令牌
152152
'tenant-id': getTenantId()
153153
},
154154

0 commit comments

Comments
 (0)