部署
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
liukang 2025-02-12 09:42:44 +08:00
parent b9240fa75b
commit ba60234933
7 changed files with 53 additions and 40 deletions

View File

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 代申
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
@ -9,4 +9,4 @@ VUE_APP_BASE_API = '/dev-api'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
VITE_BASE_PATH = '' VUE_APP_VITE_BASE_PATH = '/weverse/'

View File

@ -1,9 +1,9 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 代申
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'
# 若依管理系统/生产环境 # 若依管理系统/生产环境
VUE_APP_BASE_API = '/weverse-prod-api' VUE_APP_BASE_API = '/weverse-prod-api'
VITE_BASE_PATH = '/weverse/' VUE_APP_VITE_BASE_PATH = '/weverse/'

View File

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 代申
BABEL_ENV = production BABEL_ENV = production

View File

@ -1,6 +1,7 @@
<template> <template>
<div class="navbar"> <div class="navbar">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
@toggleClick="toggleSideBar"/>
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/> <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
@ -102,9 +103,10 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$store.dispatch('LogOut').then(() => { this.$store.dispatch('LogOut').then(() => {
location.href = process.env.VITE_BASE_PATH; location.href = process.env.VITE_BASE_PATH + "/index";
}) })
}).catch(() => {}); }).catch(() => {
});
} }
} }
} }

View File

@ -79,7 +79,7 @@ Vue.use(Element, {
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({
base: process.env.VUE_APP_SUB_PATH, base: process.env.VUE_APP_VITE_BASE_PATH,
el: '#app', el: '#app',
router, router,
store, store,

View File

@ -182,6 +182,7 @@ Router.prototype.replace = function push(location) {
} }
export default new Router({ export default new Router({
base: process.env.VUE_APP_VITE_BASE_PATH,
mode: 'history', // 去掉url中的# mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes routes: constantRoutes

View File

@ -84,10 +84,14 @@ service.interceptors.response.use(res => {
if (code === 401) { if (code === 401) {
if (!isRelogin.show) { if (!isRelogin.show) {
isRelogin.show = true; isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
isRelogin.show = false; isRelogin.show = false;
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
location.href = process.env.VITE_BASE_PATH; location.href = process.env.VITE_BASE_PATH + '/index';
}) })
}).catch(() => { }).catch(() => {
isRelogin.show = false; isRelogin.show = false;
@ -124,9 +128,15 @@ service.interceptors.response.use(res => {
// 通用下载方法 // 通用下载方法
export function download(url, params, filename, config) { export function download(url, params, filename, config) {
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) downloadLoadingInstance = Loading.service({
text: "正在下载数据,请稍候",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
})
return service.post(url, params, { return service.post(url, params, {
transformRequest: [(params) => { return tansParams(params) }], transformRequest: [(params) => {
return tansParams(params)
}],
headers: {'Content-Type': 'application/x-www-form-urlencoded'}, headers: {'Content-Type': 'application/x-www-form-urlencoded'},
responseType: 'blob', responseType: 'blob',
...config ...config