diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 861765276..000000000 --- a/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -dist/ -.vscode/ diff --git a/.env b/.env index 9bb2d12b2..fdbf08b82 100644 --- a/.env +++ b/.env @@ -2,13 +2,13 @@ VITE_GLOB_APP_TITLE=DaxPay服务端 # 发布路径 -VITE_PUBLIC_PATH=/ +VITE_PUBLIC_PATH=/web # 接口地址 VITE_GLOB_API_URL=/server # 接口前缀 -VITE_GLOB_API_URL_PREFIX = +VITE_GLOB_API_URL_PREFIX= # 终端类型 VITE_GLOB_APP_CLIENT=dax-pay diff --git a/.env.build b/.env.build index db1f02307..b0059a4de 100644 --- a/.env.build +++ b/.env.build @@ -1,20 +1,28 @@ -# 名称 +# 名称 不可为空 VITE_GLOB_APP_TITLE=DaxPay服务端 -# 压缩方式 -VITE_BUILD_COMPRESS='gzip' +# 独立部署模式 +#VITE_PUBLIC_PATH=/ +# API 接口前缀 +#VITE_GLOB_API_URL_PREFIX=/api -# 发布路径 -VITE_PUBLIC_PATH=/ +# 嵌入式模式 与网关部署在一起 +VITE_PUBLIC_PATH=/web +# API 接口前缀 +VITE_GLOB_API_URL_PREFIX= + + +# 是否启用gzip压缩或brotli压缩, 可选: gzip | brotli | none, 如果你需要多种形式,你可以用','来分隔 +VITE_BUILD_COMPRESS='none' # 接口地址 -VITE_GLOB_API_URL=/server - -# 接口前缀 -VITE_GLOB_API_URL_PREFIX= +VITE_GLOB_API_URL= # 终端类型 VITE_GLOB_APP_CLIENT=dax-pay # 超时时间 VITE_GLOB_API_TIMEOUT=30000 + +# 是否开启打包分析 +VITE_ENABLE_ANALYZE=false diff --git a/package.json b/package.json index 6bfa43383..0c85f788b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "bootstrap": "pnpm install", - "build": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build", + "build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode build", "build:analyze": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode analyze", "build:no-cache": "pnpm store prune && npm run build", "dev": "pnpm vite --mode admin --port=13000", diff --git a/src/router/helper/routeHelper.ts b/src/router/helper/routeHelper.ts index 70ef33513..5d1341da3 100644 --- a/src/router/helper/routeHelper.ts +++ b/src/router/helper/routeHelper.ts @@ -4,7 +4,7 @@ import type { Router, RouteRecordNormalized } from 'vue-router' import { getParentLayout, LAYOUT, EXCEPTION_COMPONENT } from '@/router/constant' import { cloneDeep, omit } from 'lodash-es' import { warn } from '@/utils/log' -import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' +import {createRouter, createWebHistory, RouteRecordRaw} from 'vue-router' import XEUtils from 'xe-utils' const IFRAME = () => import('@/views/sys/iframe/FrameBlank.vue') @@ -141,7 +141,7 @@ function promoteRouteLevel(routeModule: AppRouteModule) { // createRouter 创建一个可以被 Vue 应用程序使用的路由实例 let router: Router | null = createRouter({ routes: [routeModule as RouteRecordRaw], - history: createWebHashHistory(), + history: createWebHistory(), }) // getRoutes: 获取所有 路由记录的完整列表。 const routes = router.getRoutes() diff --git a/src/router/index.ts b/src/router/index.ts index 0c0203acd..73d52ba7e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,7 +1,7 @@ import type { RouteRecordRaw } from 'vue-router' import type { App } from 'vue' -import { createRouter, createWebHashHistory } from 'vue-router' +import {createRouter, createWebHistory} from 'vue-router' import { basicRoutes } from './routes' // 白名单应该包含基本静态路由 @@ -17,7 +17,7 @@ getRouteNames(basicRoutes) // 创建一个可以被 Vue 应用程序使用的路由实例 export const router = createRouter({ // 创建一个 hash 历史记录。 - history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH), + history: createWebHistory(import.meta.env.VITE_PUBLIC_PATH), // 应该添加到路由的初始路由列表。 routes: basicRoutes as unknown as RouteRecordRaw[], // 是否应该禁止尾部斜杠。默认为假