chore: 集成github pages发布环境
This commit is contained in:
parent
e7fc403c77
commit
17928cbc57
16
.env.github
Normal file
16
.env.github
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# 自定义域名CNAME
|
||||||
|
# VITE_APP_GLOB_CNAME = 'template.qszone.com'
|
||||||
|
|
||||||
|
# 资源公共路径,需要以 /开头和结尾
|
||||||
|
VITE_PUBLIC_PATH = '/vue-naive-admin/'
|
||||||
|
|
||||||
|
VITE_APP_USE_HASH = true
|
||||||
|
|
||||||
|
# 是否启用MOCK
|
||||||
|
VITE_APP_USE_MOCK = true
|
||||||
|
|
||||||
|
# base api
|
||||||
|
VITE_APP_GLOB_BASE_API = '/api'
|
||||||
|
|
||||||
|
# test base api
|
||||||
|
VITE_APP_GLOB_BASE_API_TEST = '/api-test'
|
11
.env.staging
11
.env.staging
@ -1,11 +0,0 @@
|
|||||||
# 资源公共路径,需要以 /开头和结尾
|
|
||||||
VITE_PUBLIC_PATH = '/'
|
|
||||||
|
|
||||||
# 是否启用MOCK
|
|
||||||
VITE_APP_USE_MOCK = false
|
|
||||||
|
|
||||||
# base api
|
|
||||||
VITE_APP_GLOB_BASE_API = 'http://localhost:8080/api'
|
|
||||||
|
|
||||||
# test base api
|
|
||||||
VITE_APP_GLOB_BASE_API_TEST = 'http://localhost:8080/api-test'
|
|
@ -7,7 +7,7 @@
|
|||||||
"lint:fix": "eslint --fix --ext .js,.vue .",
|
"lint:fix": "eslint --fix --ext .js,.vue .",
|
||||||
"build": "vite build && esno ./build/script",
|
"build": "vite build && esno ./build/script",
|
||||||
"build:test": "vite build --mode test && esno ./build/script",
|
"build:test": "vite build --mode test && esno ./build/script",
|
||||||
"build:staging": "vite build --mode staging && esno ./build/script",
|
"build:github": "vite build --mode github && esno ./build/script",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
|
||||||
import { setupRouterGuard } from './guard'
|
import { setupRouterGuard } from './guard'
|
||||||
import { basicRoutes } from './routes'
|
import { basicRoutes } from './routes'
|
||||||
|
|
||||||
|
const isHash = !!import.meta.env.VITE_APP_USE_HASH
|
||||||
export const router = createRouter({
|
export const router = createRouter({
|
||||||
history: createWebHistory('/'),
|
history: isHash ? createWebHashHistory('/') : createWebHistory('/'),
|
||||||
routes: basicRoutes,
|
routes: basicRoutes,
|
||||||
scrollBehavior: () => ({ left: 0, top: 0 }),
|
scrollBehavior: () => ({ left: 0, top: 0 }),
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user