fix(auth): move admin session to HttpOnly cookies

This commit is contained in:
Kroytz committed 2026-07-19 00:25:39 +08:00
1 parent 0d2165cf80
commit 17b2ba49a8
39 files changed
+191 -219

No files matched your search

@@ -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 { getTenantId } from '@/utils/auth'
defineOptions({ name: 'Editor' })
@@ -104,10 +104,8 @@ const editorConfig = computed((): IEditorConfig => {
// 自定义增加 http header
headers: {
Accept: '*',
Authorization: 'Bearer ' + getAccessToken(),
'tenant-id': getTenantId()
},
// 跨域是否传递 cookie ,默认为 false
withCredentials: true,
@@ -99,7 +99,7 @@
<el-col :span="12" style="text-align: right">
<el-upload
:action="uploadApi"
:headers="headers"
:with-credentials="true"
:file-list="[]"
:on-progress="handleProgress"
:before-upload="beforeUpload"
@@ -182,7 +182,6 @@ import {
putObj as materialgroupEdit
} from '@/api/tools/materialgroup'
import { getPage, addObj, delObj } from '@/api/tools/material'
import { getAccessToken } from '@/utils/auth'
const props = defineProps({
modelValue: {
@@ -218,10 +217,6 @@ const props = defineProps({
}
})
const headers = ref({
// Authorization: getToken()
Authorization: 'Bearer ' + getAccessToken(),
})
//const value = ref(props.value)
const dialogVisible = ref(false)
const url = ref('')
@@ -50,7 +50,7 @@
<el-col :span="12" style="text-align: right">
<el-upload
:action="uploadApi"
:headers="headers"
:with-credentials="true"
:file-list="[]"
:on-progress="handleProgress"
:before-upload="beforeUpload"
@@ -133,7 +133,6 @@ import {
putObj as materialgroupEdit
} from '@/api/tools/materialgroup'
import { getPage, addObj, delObj } from '@/api/tools/material'
import { getAccessToken } from '@/utils/auth'
import '../../../../public/UEditor/dialogs/internal'
const props = defineProps({
@@ -170,10 +169,6 @@ const props = defineProps({
}
})
const headers = ref({
// Authorization: getToken()
Authorization: 'Bearer ' + getAccessToken(),
})
const value = ref(props.value)
// const dialogVisible = ref(false)
// const url = ref('')