Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pic-reader
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
pic-reader
Commits
016d0c67
提交
016d0c67
authored
6月 19, 2025
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改api配置文件
上级
6565e098
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
62 行增加
和
63 行删除
+62
-63
.env.development
.env.development
+4
-2
.env.production
.env.production
+4
-2
components.d.ts
src/components.d.ts
+0
-9
index.js
src/router/index.js
+1
-1
vite.config.js
vite.config.js
+53
-49
没有找到文件。
.env.development
浏览文件 @
016d0c67
VITE_API_BASE_URL = '/api'
\ No newline at end of file
VITE_API_BASE_URL = '/api'
VITE_API_ROUTE_URL = '/'
\ No newline at end of file
.env.production
浏览文件 @
016d0c67
VITE_API_BASE_URL = '/'
\ No newline at end of file
VITE_API_BASE_URL = '/api'
VITE_API_ROUTE_URL = '/'
\ No newline at end of file
src/components.d.ts
浏览文件 @
016d0c67
...
...
@@ -10,13 +10,9 @@ declare module 'vue' {
export
interface
GlobalComponents
{
BookMarks
:
typeof
import
(
'./components/BookMarks.vue'
)[
'default'
]
BookReader
:
typeof
import
(
'./components/BookReader/index.vue'
)[
'default'
]
BookReaderV2
:
typeof
import
(
'./components/BookReaderV2/index.vue'
)[
'default'
]
copy
:
typeof
import
(
'./components/Guide copy.vue'
)[
'default'
]
ElButton
:
typeof
import
(
'element-plus/es'
)[
'ElButton'
]
ElCol
:
typeof
import
(
'element-plus/es'
)[
'ElCol'
]
ElFooter
:
typeof
import
(
'element-plus/es'
)[
'ElFooter'
]
ElHeader
:
typeof
import
(
'element-plus/es'
)[
'ElHeader'
]
ElIcon
:
typeof
import
(
'element-plus/es'
)[
'ElIcon'
]
ElRow
:
typeof
import
(
'element-plus/es'
)[
'ElRow'
]
FileUpload
:
typeof
import
(
'./components/FileUpload.vue'
)[
'default'
]
Guide
:
typeof
import
(
'./components/BookReader/guide.vue'
)[
'default'
]
...
...
@@ -28,14 +24,9 @@ declare module 'vue' {
RouterLink
:
typeof
import
(
'vue-router'
)[
'RouterLink'
]
RouterView
:
typeof
import
(
'vue-router'
)[
'RouterView'
]
SvgIcon
:
typeof
import
(
'./components/SvgIcon/index.vue'
)[
'default'
]
Test
:
typeof
import
(
'./components/test.vue'
)[
'default'
]
VanCell
:
typeof
import
(
'vant/es'
)[
'Cell'
]
VanCol
:
typeof
import
(
'vant/es'
)[
'Col'
]
VanIcon
:
typeof
import
(
'vant/es'
)[
'Icon'
]
VanList
:
typeof
import
(
'vant/es'
)[
'List'
]
VanNavBar
:
typeof
import
(
'vant/es'
)[
'NavBar'
]
VanPopup
:
typeof
import
(
'vant/es'
)[
'Popup'
]
VanRow
:
typeof
import
(
'vant/es'
)[
'Row'
]
VanTabbar
:
typeof
import
(
'vant/es'
)[
'Tabbar'
]
}
}
src/router/index.js
浏览文件 @
016d0c67
...
...
@@ -38,7 +38,7 @@ export const constantRoutes = [
* 创建路由
*/
const
router
=
createRouter
({
history
:
createWebHistory
(
'/'
),
history
:
createWebHistory
(
import
.
meta
.
env
.
VITE_API_ROUTE_URL
),
routes
:
constantRoutes
,
// 刷新时,滚动条位置还原
scrollBehavior
(
to
,
from
,
savedPosition
)
{
...
...
vite.config.js
浏览文件 @
016d0c67
import
{
fileURLToPath
,
URL
}
from
'node:url'
import
{
defineConfig
}
from
'vite'
import
{
defineConfig
,
loadEnv
}
from
'vite'
import
vue
from
'@vitejs/plugin-vue'
import
vueDevTools
from
'vite-plugin-vue-devtools'
import
AutoImport
from
'unplugin-auto-import/vite'
...
...
@@ -11,57 +11,61 @@ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import
path
from
'path'
// https://vite.dev/config/
export
default
defineConfig
({
optimizeDeps
:
{
exclude
:
[
'modernizr'
,
'src/assets/js/modernizr.2.5.3.min.js'
]
},
build
:
{
rollupOptions
:
{
external
:
[
/modernizr/
,
/requirejs/
export
default
defineConfig
(({
mode
,
command
})
=>
{
const
env
=
loadEnv
(
mode
,
process
.
cwd
());
return
{
base
:
env
.
VITE_API_ROUTE_URL
,
optimizeDeps
:
{
exclude
:
[
'modernizr'
,
'src/assets/js/modernizr.2.5.3.min.js'
]
}
},
plugins
:
[
vue
(),
vueDevTools
(),
AutoImport
({
// 自动导入 Vue 相关函数,如:ref, reactive, toRef 等
imports
:
[
'vue'
,
'vue-router'
,
'pinia'
],
// 自动导入 Element Plus 相关函数
resolvers
:
[
ElementPlusResolver
(),
VantResolver
()],
// 生成自动导入的TS声明文件
dts
:
'src/auto-imports.d.ts'
,
}),
Components
({
// 自动导入组件
resolvers
:
[
ElementPlusResolver
(),
VantResolver
()],
// 生成自动导入的TS声明文件
dts
:
'src/components.d.ts'
,
}),
createSvgIconsPlugin
({
iconDirs
:
[
path
.
resolve
(
process
.
cwd
(),
'src/assets/svg'
)],
// SVG 存放路径
symbolId
:
'icon-[name]'
})
],
resolve
:
{
alias
:
{
'@'
:
fileURLToPath
(
new
URL
(
'./src'
,
import
.
meta
.
url
))
},
},
server
:
{
proxy
:
{
'/api'
:
{
target
:
'http://222.85.214.245:9666'
,
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
)
build
:
{
rollupOptions
:
{
external
:
[
/modernizr/
,
/requirejs/
]
}
},
host
:
'0.0.0.0'
,
port
:
8089
,
plugins
:
[
vue
(),
vueDevTools
(),
AutoImport
({
// 自动导入 Vue 相关函数,如:ref, reactive, toRef 等
imports
:
[
'vue'
,
'vue-router'
,
'pinia'
],
// 自动导入 Element Plus 相关函数
resolvers
:
[
ElementPlusResolver
(),
VantResolver
()],
// 生成自动导入的TS声明文件
dts
:
'src/auto-imports.d.ts'
,
}),
Components
({
// 自动导入组件
resolvers
:
[
ElementPlusResolver
(),
VantResolver
()],
// 生成自动导入的TS声明文件
dts
:
'src/components.d.ts'
,
}),
createSvgIconsPlugin
({
iconDirs
:
[
path
.
resolve
(
process
.
cwd
(),
'src/assets/svg'
)],
// SVG 存放路径
symbolId
:
'icon-[name]'
})
],
resolve
:
{
alias
:
{
'@'
:
fileURLToPath
(
new
URL
(
'./src'
,
import
.
meta
.
url
))
},
},
server
:
{
proxy
:
{
'/api'
:
{
target
:
'http://222.85.214.245:9666'
,
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
)
}
},
host
:
'0.0.0.0'
,
port
:
8089
,
}
}
})
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论