This commit is contained in:
zyronon
2023-10-15 16:07:56 +08:00
parent 886142e946
commit 5fb837774e
4 changed files with 9 additions and 10 deletions

View File

@@ -12,8 +12,7 @@
"commit": "git-cz",
"prepare": "husky install",
"test": "",
"deploy": "push-dir --dir=dist --branch=gh-pages --cleanup",
"d2": "git subtree push --prefix dist Web gh-pages"
"deploy": "push-dir --dir=dist --branch=gh-pages --cleanup"
},
"dependencies": {
"@opentranslate/baidu": "^1.4.2",

View File

@@ -101,13 +101,13 @@ export function usePlayAudio(url: string) {
export function getAudioFileUrl(name: string) {
if (name === '机械') {
return [
`/sound/key-sounds/jixie/机械0.mp3`,
`/sound/key-sounds/jixie/机械1.mp3`,
`/sound/key-sounds/jixie/机械2.mp3`,
`/sound/key-sounds/jixie/机械3.mp3`,
`./sound/key-sounds/jixie/机械0.mp3`,
`./sound/key-sounds/jixie/机械1.mp3`,
`./sound/key-sounds/jixie/机械2.mp3`,
`./sound/key-sounds/jixie/机械3.mp3`,
]
} else {
return [`/sound/key-sounds/${name}.mp3`]
return [`./sound/key-sounds/${name}.mp3`]
}
}

View File

@@ -192,7 +192,7 @@ export const useBaseStore = defineStore('base', {
DictType.customDict,
].includes(this.current.dictType)) {
if (!this.currentDict.originWords.length) {
let r = await fetch(`${this.currentDict.url}`)
let r = await fetch(`.${this.currentDict.url}`)
r.json().then(v => {
this.currentDict.originWords = cloneDeep(v)
this.currentDict.words = cloneDeep(v)
@@ -207,7 +207,7 @@ export const useBaseStore = defineStore('base', {
DictType.customArticle,
].includes(this.current.dictType)) {
if (!this.currentDict.articles.length) {
let r = await fetch(`${this.currentDict.url}`)
let r = await fetch(`.${this.currentDict.url}`)
r.json().then((v: any[]) => {
this.currentDict.articles = cloneDeep(v.map(v => {
v.id = uuidv4()

View File

@@ -36,7 +36,7 @@ export default defineConfig({
open: true //如果存在本地服务端口,将在打包后自动展示
}) : null,
],
base:'./',
base: './',
resolve: {
alias: {
"@": pathResolve("src"),