This commit is contained in:
coward 2024-05-24 17:31:20 +08:00
parent 66982f3a7b
commit 5dc64da214
3 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,5 @@
# 线上环境平台打包路径
VITE_PUBLIC_PATH = /
VITE_PUBLIC_PATH = /web
# 线上环境路由历史模式Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数"
VITE_ROUTER_HISTORY = "hash"
@ -10,4 +10,4 @@ VITE_CDN = false
# 是否启用gzip压缩或brotli压缩分两种情况删除原始文件和不删除原始文件
# 压缩时不删除原始文件的配置gzip、brotli、both同时开启 gzip 与 brotli 压缩、none不开启压缩默认
# 压缩时删除原始文件的配置gzip-clear、brotli-clear、both-clear同时开启 gzip 与 brotli 压缩、none不开启压缩默认
VITE_COMPRESSION = "none"
VITE_COMPRESSION = "both"

6
app/static.go Normal file
View File

@ -0,0 +1,6 @@
package web
import "embed"
//go:embed index.html logo.svg favicon.ico platform-config.json public/platform-config.json static assets
var Static embed.FS

View File

@ -31,7 +31,7 @@ export const getPlatformConfig = async (app: App): Promise<undefined> => {
app.config.globalProperties.$config = getConfig();
return axios({
method: "get",
url: `${VITE_PUBLIC_PATH}platform-config.json`
url: `${VITE_PUBLIC_PATH}/platform-config.json`
})
.then(({ data: config }) => {
let $config = app.config.globalProperties.$config;