base url 更改

This commit is contained in:
ray_wuhao 2023-04-06 15:19:22 +08:00
parent a236fef068
commit 47fe7853c5
4 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,7 @@
## 预览地址 ## 预览地址
- [点击预览](https://xiaodaigua-ray.github.io/#/) - [点击预览](https://xiaodaigua-ray.github.io/ray-template/#/)
- [点击预览(加速地址)](https://ray-template.yunkuangao.com/#/) - [点击预览(加速地址)](https://ray-template.yunkuangao.com/#/)
## 文档地址 ## 文档地址

1
cfg.ts
View File

@ -47,6 +47,7 @@ import {
import type { AppConfigExport } from './src/types/cfg' import type { AppConfigExport } from './src/types/cfg'
const config: AppConfigExport = { const config: AppConfigExport = {
base: '/ray-template/',
/** 配置首屏加载信息 */ /** 配置首屏加载信息 */
preloadingConfig: { preloadingConfig: {
title: 'Ray Template', title: 'Ray Template',

View File

@ -42,6 +42,7 @@ export interface Config {
rootRoute?: RootRoute rootRoute?: RootRoute
primaryColor?: string primaryColor?: string
preloadingConfig?: PreloadingConfig preloadingConfig?: PreloadingConfig
base?: string
} }
export type Recordable<T = unknown> = Record<string, T> export type Recordable<T = unknown> = Record<string, T>
@ -66,6 +67,7 @@ export interface AppConfig {
} }
rootRoute: RootRoute rootRoute: RootRoute
primaryColor: string primaryColor: string
base?: string
} }
export type AppConfigExport = Config & UserConfigExport export type AppConfigExport = Config & UserConfigExport

View File

@ -35,6 +35,7 @@ const {
rootRoute, rootRoute,
primaryColor, primaryColor,
preloadingConfig, preloadingConfig,
base,
} = config } = config
/** /**
@ -60,6 +61,7 @@ const __APP_CFG__ = {
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(async ({ mode }) => { export default defineConfig(async ({ mode }) => {
return { return {
base,
define: { define: {
__APP_CFG__: JSON.stringify(__APP_CFG__), __APP_CFG__: JSON.stringify(__APP_CFG__),
}, },