|
@@ -6,7 +6,7 @@ import { propTypes } from '@/utils/propTypes'
|
|
|
import { isNumber } from '@/utils/is'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import { useLocaleStore } from '@/store/modules/locale'
|
|
|
-import { getAccessToken, getTenantId } from '@/utils/auth'
|
|
|
+import { getRefreshToken, getTenantId } from '@/utils/auth'
|
|
|
import { getUploadUrl } from '@/components/UploadFile/src/useUpload'
|
|
|
|
|
|
defineOptions({ name: 'Editor' })
|
|
@@ -100,7 +100,7 @@ const editorConfig = computed((): IEditorConfig => {
|
|
|
// 自定义增加 http header
|
|
|
headers: {
|
|
|
Accept: '*',
|
|
|
- Authorization: 'Bearer ' + getAccessToken(),
|
|
|
+ Authorization: 'Bearer ' + getRefreshToken(), // 使用 getRefreshToken() 方法,而不使用 getAccessToken() 方法的原因:Editor 无法方便的刷新访问令牌
|
|
|
'tenant-id': getTenantId()
|
|
|
},
|
|
|
|
|
@@ -148,7 +148,7 @@ const editorConfig = computed((): IEditorConfig => {
|
|
|
// 自定义增加 http header
|
|
|
headers: {
|
|
|
Accept: '*',
|
|
|
- Authorization: 'Bearer ' + getAccessToken(),
|
|
|
+ Authorization: 'Bearer ' + getRefreshToken(), // 使用 getRefreshToken() 方法,而不使用 getAccessToken() 方法的原因:Editor 无法方便的刷新访问令牌
|
|
|
'tenant-id': getTenantId()
|
|
|
},
|
|
|
|