mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
feat: update upload license key and support csv
This commit is contained in:
@@ -42,10 +42,12 @@ const tableList = ref<any>([])
|
||||
const excelUploadSuccess = ref(false)
|
||||
const tableListLoading = ref(false)
|
||||
const token = wsCache.get('user.token')
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
// eslint-disable-next-line no-undef
|
||||
const request_key = LicenseGenerator.generate()
|
||||
const request_key = computed(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
// eslint-disable-next-line no-undef
|
||||
return LicenseGenerator.generate()
|
||||
})
|
||||
const headers = ref<any>({ 'X-SQLBOT-TOKEN': `Bearer ${token}`, 'X-SQLBOT-KEY': request_key })
|
||||
const dialogTitle = ref('')
|
||||
const getUploadURL = import.meta.env.VITE_API_BASE_URL + '/datasource/uploadExcel'
|
||||
@@ -495,7 +497,7 @@ defineExpose({
|
||||
<el-upload
|
||||
v-if="form.filename"
|
||||
class="upload-user"
|
||||
accept=".xlsx,.xls"
|
||||
accept=".xlsx,.xls,.csv"
|
||||
:headers="headers"
|
||||
:action="getUploadURL"
|
||||
:before-upload="beforeUpload"
|
||||
@@ -511,7 +513,7 @@ defineExpose({
|
||||
<el-upload
|
||||
v-else
|
||||
class="upload-user"
|
||||
accept=".xlsx,.xls"
|
||||
accept=".xlsx,.xls,.csv"
|
||||
:headers="headers"
|
||||
:action="getUploadURL"
|
||||
:before-upload="beforeUpload"
|
||||
|
||||
Reference in New Issue
Block a user