Skip to content

Commit 783717e

Browse files
committed
feat: update upload license key and support csv
1 parent beabcbc commit 783717e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

frontend/src/views/ds/DatasourceForm.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ const tableList = ref<any>([])
4242
const excelUploadSuccess = ref(false)
4343
const tableListLoading = ref(false)
4444
const token = wsCache.get('user.token')
45-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
46-
// @ts-expect-error
47-
// eslint-disable-next-line no-undef
48-
const request_key = LicenseGenerator.generate()
45+
const request_key = computed(() => {
46+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
47+
// @ts-expect-error
48+
// eslint-disable-next-line no-undef
49+
return LicenseGenerator.generate()
50+
})
4951
const headers = ref<any>({ 'X-SQLBOT-TOKEN': `Bearer ${token}`, 'X-SQLBOT-KEY': request_key })
5052
const dialogTitle = ref('')
5153
const getUploadURL = import.meta.env.VITE_API_BASE_URL + '/datasource/uploadExcel'
@@ -495,7 +497,7 @@ defineExpose({
495497
<el-upload
496498
v-if="form.filename"
497499
class="upload-user"
498-
accept=".xlsx,.xls"
500+
accept=".xlsx,.xls,.csv"
499501
:headers="headers"
500502
:action="getUploadURL"
501503
:before-upload="beforeUpload"
@@ -511,7 +513,7 @@ defineExpose({
511513
<el-upload
512514
v-else
513515
class="upload-user"
514-
accept=".xlsx,.xls"
516+
accept=".xlsx,.xls,.csv"
515517
:headers="headers"
516518
:action="getUploadURL"
517519
:before-upload="beforeUpload"

0 commit comments

Comments
 (0)