fix: 🐛 打包tauri时修复下载文件的路径错误
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "log-lottery",
|
||||
"private": true,
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.3",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "app"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
license = ""
|
||||
@@ -21,5 +21,5 @@ tauri-build = { version = "2.5.3", features = [] }
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = { version = "2.9.4", features = [] }
|
||||
tauri = { version = "2.9.4", features = ["devtools"] }
|
||||
tauri-plugin-log = "2"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "log-lottery",
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.3",
|
||||
"identifier": "to2026.xyz",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -18,7 +18,7 @@ type IBasePersonConfig = Pick<IPersonConfig, 'uid' | 'name' | 'department' | 'id
|
||||
|
||||
export function useViewModel({ exportInputFileRef }: { exportInputFileRef: Ref<HTMLInputElement> }) {
|
||||
const { t } = useI18n()
|
||||
const baseUrl = import.meta.env.BASE_URL
|
||||
const baseUrl = import.meta.env.BASE_URL.replace('./', '/')
|
||||
const toast = useToast()
|
||||
const worker: Worker | null = new ImportExcelWorker()
|
||||
const loading = inject(loadingKey)
|
||||
@@ -36,11 +36,11 @@ export function useViewModel({ exportInputFileRef }: { exportInputFileRef: Ref<H
|
||||
async function getExcelTemplateContent() {
|
||||
const locale = i18n.global.locale.value
|
||||
if (locale === 'zhCn') {
|
||||
const templateData = await readLocalFileAsArraybuffer(`${import.meta.env.BASE_URL}人口登记表-zhCn.xlsx`)
|
||||
const templateData = await readLocalFileAsArraybuffer(`${baseUrl}人口登记表-zhCn.xlsx`)
|
||||
return templateData
|
||||
}
|
||||
else {
|
||||
const templateData = await readLocalFileAsArraybuffer(`${import.meta.env.BASE_URL}personListTemplate-en.xlsx`)
|
||||
const templateData = await readLocalFileAsArraybuffer(`${baseUrl}personListTemplate-en.xlsx`)
|
||||
return templateData
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user