diff --git a/ruoyi-auth/src/main/resources/bootstrap.yml b/ruoyi-auth/src/main/resources/bootstrap.yml index e7c0bee6..510f65cc 100644 --- a/ruoyi-auth/src/main/resources/bootstrap.yml +++ b/ruoyi-auth/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9200 + port: 12200 # Spring spring: diff --git a/ruoyi-gateway/src/main/resources/bootstrap.yml b/ruoyi-gateway/src/main/resources/bootstrap.yml index 64e149ef..103cfa4c 100644 --- a/ruoyi-gateway/src/main/resources/bootstrap.yml +++ b/ruoyi-gateway/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 8080 + port: 12080 # Spring spring: @@ -35,7 +35,7 @@ spring: eager: true transport: # 控制台地址 - dashboard: 127.0.0.1:8718 + dashboard: 127.0.0.1:12718 # nacos配置持久化 datasource: ds1: diff --git a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml index 5b50fb38..06c92640 100644 --- a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9300 + port: 12300 # Spring spring: diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml index b919923c..666e5317 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9202 + port: 12202 # Spring spring: diff --git a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml index 1d3dfda9..f6ba3b65 100644 --- a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9203 + port: 12203 # Spring spring: diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml index b65fe295..e8fb1628 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9201 + port: 12201 # Spring spring: diff --git a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml index efc9b998..7fe827ca 100644 --- a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml +++ b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9100 + port: 12100 # Spring spring: diff --git a/ruoyi-vue3/.env.development b/ruoyi-vue3/.env.development index f10b47c3..af0712c4 100644 --- a/ruoyi-vue3/.env.development +++ b/ruoyi-vue3/.env.development @@ -6,3 +6,6 @@ VITE_APP_ENV = 'development' # pinn个人管理系统/开发环境 VITE_APP_BASE_API = '/dev-api' + +#路由守卫的虚拟目录 +VITE_APP_BASE_DIR = '/dConsole' diff --git a/ruoyi-vue3/.env.production b/ruoyi-vue3/.env.production index 9f15b051..3ffe9e26 100644 --- a/ruoyi-vue3/.env.production +++ b/ruoyi-vue3/.env.production @@ -7,5 +7,8 @@ VITE_APP_ENV = 'production' # pinn个人管理系统/生产环境 VITE_APP_BASE_API = '/prod-api' +#路由守卫的虚拟目录 +VITE_APP_BASE_DIR = '/pConsole' + # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/ruoyi-vue3/public/favicon.ico b/ruoyi-vue3/public/favicon.ico index 121ffe20..0f59d18a 100644 Binary files a/ruoyi-vue3/public/favicon.ico and b/ruoyi-vue3/public/favicon.ico differ diff --git a/ruoyi-vue3/src/permission.js b/ruoyi-vue3/src/permission.js index accdcf7a..b497ce5d 100644 --- a/ruoyi-vue3/src/permission.js +++ b/ruoyi-vue3/src/permission.js @@ -9,15 +9,16 @@ import { isRelogin } from '@/utils/request' NProgress.configure({ showSpinner: false }); -const whiteList = ['/login', '/auth-redirect', '/bind', '/register']; +const baseDir = import.meta.env.VITE_APP_BASE_DIR; +const whiteList = [baseDir+'/login', baseDir+'/auth-redirect', baseDir+'/bind', baseDir+'/register']; router.beforeEach((to, from, next) => { NProgress.start() if (getToken()) { to.meta.title && store.dispatch('settings/setTitle', to.meta.title) /* has token*/ - if (to.path === '/login') { - next({ path: '/' }) + if (to.path === baseDir+'/login') { + next({ path: baseDir+'/' }) NProgress.done() } else { if (store.getters.roles.length === 0) { @@ -37,7 +38,7 @@ router.beforeEach((to, from, next) => { }).catch(err => { store.dispatch('LogOut').then(() => { ElMessage.error(err) - next({ path: '/' }) + next({ path: baseDir+'/' }) }) }) } else { @@ -50,7 +51,7 @@ router.beforeEach((to, from, next) => { // 在免登录白名单,直接进入 next() } else { - next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 + next( baseDir + `/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 NProgress.done() } } diff --git a/ruoyi-vue3/src/router/index.js b/ruoyi-vue3/src/router/index.js index 89017e4d..13f29934 100644 --- a/ruoyi-vue3/src/router/index.js +++ b/ruoyi-vue3/src/router/index.js @@ -21,10 +21,12 @@ import Layout from '@/layout' } */ +const baseDir = import.meta.env.VITE_APP_BASE_DIR; + // 公共路由 export const constantRoutes = [ { - path: '/redirect', + path: baseDir+'/redirect', component: Layout, hidden: true, children: [ @@ -35,29 +37,29 @@ export const constantRoutes = [ ] }, { - path: '/login', + path: baseDir+'/login', component: () => import('@/views/login'), hidden: true }, { - path: '/register', + path: baseDir+'/register', component: () => import('@/views/register'), hidden: true }, { - path: "/:pathMatch(.*)*", + path: baseDir+"/:pathMatch(.*)*", component: () => import('@/views/error/404'), hidden: true }, { - path: '/401', + path: baseDir+'/401', component: () => import('@/views/error/401'), hidden: true }, { - path: '', + path: baseDir+'', component: Layout, - redirect: '/index', + redirect: baseDir+'/index', children: [ { path: '/index', @@ -68,7 +70,7 @@ export const constantRoutes = [ ] }, { - path: '/user', + path: baseDir+'/user', component: Layout, hidden: true, redirect: 'noredirect', @@ -82,7 +84,7 @@ export const constantRoutes = [ ] }, { - path: '/system/user-auth', + path: baseDir+'/system/user-auth', component: Layout, hidden: true, children: [ @@ -95,7 +97,7 @@ export const constantRoutes = [ ] }, { - path: '/system/role-auth', + path: baseDir+'/system/role-auth', component: Layout, hidden: true, children: [ @@ -108,7 +110,7 @@ export const constantRoutes = [ ] }, { - path: '/system/dict-data', + path: baseDir+'/system/dict-data', component: Layout, hidden: true, children: [ diff --git a/ruoyi-vue3/vite.config.js b/ruoyi-vue3/vite.config.js index 2b6f847c..fce1ed18 100644 --- a/ruoyi-vue3/vite.config.js +++ b/ruoyi-vue3/vite.config.js @@ -5,12 +5,12 @@ import createVitePlugins from './vite/plugins' // https://vitejs.dev/config/ export default defineConfig(({ mode, command }) => { const env = loadEnv(mode, process.cwd()) - const { VITE_APP_ENV } = env + const { VITE_APP_ENV, VITE_APP_BASE_DIR } = env return { // 部署生产环境和开发环境下的URL。 // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 - base: VITE_APP_ENV === 'production' ? '/' : '/', + base: VITE_APP_ENV === 'production' ? VITE_APP_BASE_DIR : VITE_APP_BASE_DIR, plugins: createVitePlugins(env, command === 'build'), resolve: { // https://cn.vitejs.dev/config/#resolve-alias @@ -25,13 +25,13 @@ export default defineConfig(({ mode, command }) => { }, // vite 相关配置 server: { - port: 80, + port: 12008, host: true, open: true, proxy: { // https://cn.vitejs.dev/config/#server-proxy '/dev-api': { - target: 'http://localhost:8080', + target: 'http://localhost:12080', changeOrigin: true, rewrite: (p) => p.replace(/^\/dev-api/, '') }