Skip to content

Commit 34bad0e

Browse files
committed
fix: i18n not working when uploading Excel files
1 parent 3acdcba commit 34bad0e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/src/views/system/excel-upload/Uploader.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { genFileId, type UploadInstance, type UploadProps, type UploadRawFile }
99
import { useCache } from '@/utils/useCache.ts'
1010
import { settingsApi } from '@/api/setting.ts'
1111
import ccmUpload from '@/assets/svg/icon_ccm-upload_outlined.svg'
12+
import { getLocale } from '@/utils/utils.ts'
1213
1314
const { t } = useI18n()
1415
const { wsCache } = useCache()
@@ -25,7 +26,8 @@ const uploadRef = ref<UploadInstance>()
2526
const uploadLoading = ref(false)
2627
2728
const token = wsCache.get('user.token')
28-
const headers = ref<any>({ 'X-SQLBOT-TOKEN': `Bearer ${token}` })
29+
const locale = getLocale()
30+
const headers = ref<any>({ 'X-SQLBOT-TOKEN': `Bearer ${token}`, 'Accept-Language': locale })
2931
const getUploadURL = () => {
3032
return import.meta.env.VITE_API_BASE_URL + props.uploadPath
3133
}

0 commit comments

Comments
 (0)