瀏覽代碼

修改为hash模式,增加前缀pxf-risk-monitor-web

wukai 5 月之前
父節點
當前提交
874d524eed

+ 21 - 19
src/layout/index.vue

@@ -2,29 +2,29 @@
   <div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }">
 
     <div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
-    <sidebar v-if="!sidebar.hide" class="sidebar-container"  v-show="!layoutHide"/>
-    <div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide,'layout-hide':layoutHide }" class="main-container">
+    <sidebar v-if="!sidebar.hide" class="sidebar-container" v-show="!layoutHide"/>
+    <div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide,'layout-hide':layoutHide }"
+         class="main-container">
       <div :class="{ 'fixed-header': fixedHeader }">
         <navbar @setLayout="setLayout" v-show="!layoutHide"/>
-        <tags-view v-if="needTagsView"  v-show="!layoutHide"/>
+        <tags-view v-if="needTagsView" v-show="!layoutHide"/>
       </div>
-      <app-main />
-      <settings ref="settingRef" />
+      <app-main/>
+      <settings ref="settingRef"/>
     </div>
   </div>
 </template>
 
 <script setup>
-import { useWindowSize } from '@vueuse/core'
+import {useWindowSize} from '@vueuse/core'
 import Sidebar from './components/Sidebar/index.vue'
-import { AppMain, Navbar, Settings, TagsView } from './components'
-import defaultSettings from '@/settings'
-import { useRoute } from 'vue-router';
-const route = useRoute();
-
+import {AppMain, Navbar, Settings, TagsView} from './components'
+import {useRoute} from 'vue-router';
 import useAppStore from '@/store/modules/app'
 import useSettingsStore from '@/store/modules/settings'
 
+const route = useRoute();
+
 const settingsStore = useSettingsStore()
 const theme = computed(() => settingsStore.theme);
 const sideTheme = computed(() => settingsStore.sideTheme);
@@ -41,34 +41,35 @@ const classObj = computed(() => ({
   mobile: device.value === 'mobile'
 }))
 
-const { width, height } = useWindowSize();
+const {width, height} = useWindowSize();
 const WIDTH = 992; // refer to Bootstrap's responsive design
 
 watchEffect(() => {
   if (device.value === 'mobile' && sidebar.value.opened) {
-    useAppStore().closeSideBar({ withoutAnimation: false })
+    useAppStore().closeSideBar({withoutAnimation: false})
   }
   if (width.value - 1 < WIDTH) {
     useAppStore().toggleDevice('mobile')
-    useAppStore().closeSideBar({ withoutAnimation: true })
+    useAppStore().closeSideBar({withoutAnimation: true})
   } else {
     useAppStore().toggleDevice('desktop')
   }
 })
 
 function handleClickOutside() {
-  useAppStore().closeSideBar({ withoutAnimation: false })
+  useAppStore().closeSideBar({withoutAnimation: false})
 }
 
 const settingRef = ref(null);
+
 function setLayout() {
   settingRef.value.openSetting();
 }
 </script>
 
 <style lang="scss" scoped>
-  @import "@/assets/styles/mixin.scss";
-  @import "@/assets/styles/variables.module.scss";
+@import "@/assets/styles/mixin.scss";
+@import "@/assets/styles/variables.module.scss";
 
 .app-wrapper {
   @include clearfix;
@@ -112,7 +113,8 @@ function setLayout() {
 .mobile .fixed-header {
   width: 100%;
 }
-.layout-hide{
-  margin-left:0!important;
+
+.layout-hide {
+  margin-left: 0 !important;
 }
 </style>

+ 7 - 7
src/router/index.js

@@ -1,4 +1,4 @@
-import {createRouter, createWebHistory} from 'vue-router'
+import {createRouter, createWebHashHistory} from 'vue-router'
 /* Layout */
 import Layout from '@/layout'
 
@@ -101,7 +101,7 @@ export const constantRoutes = [
 // 动态路由,基于用户权限动态去加载
 export const dynamicRoutes = [
     {
-        path: '/system/user-auth',
+        path: '/pxf-risk-monitor-web/system/user-auth',
         component: Layout,
         hidden: true,
         permissions: ['system:user:edit'],
@@ -115,7 +115,7 @@ export const dynamicRoutes = [
         ]
     },
     {
-        path: '/system/role-auth',
+        path: '/pxf-risk-monitor-web/system/role-auth',
         component: Layout,
         hidden: true,
         permissions: ['system:role:edit'],
@@ -129,7 +129,7 @@ export const dynamicRoutes = [
         ]
     },
     {
-        path: '/system/dict-data',
+        path: '/pxf-risk-monitor-web/system/dict-data',
         component: Layout,
         hidden: true,
         permissions: ['system:dict:list'],
@@ -143,7 +143,7 @@ export const dynamicRoutes = [
         ]
     },
     {
-        path: '/monitor/job-log',
+        path: '/pxf-risk-monitor-web/monitor/job-log',
         component: Layout,
         hidden: true,
         permissions: ['monitor:job:list'],
@@ -157,7 +157,7 @@ export const dynamicRoutes = [
         ]
     },
     {
-        path: '/tool/gen-edit',
+        path: '/pxf-risk-monitor-web/tool/gen-edit',
         component: Layout,
         hidden: true,
         permissions: ['tool:gen:edit'],
@@ -173,7 +173,7 @@ export const dynamicRoutes = [
 ]
 
 const router = createRouter({
-    history: createWebHistory(import.meta.env.BASE_URL),
+    history: createWebHashHistory('/pxf-risk-monitor-web/'),
     routes: constantRoutes,
     scrollBehavior(to, from, savedPosition) {
         if (savedPosition) {

+ 1 - 1
src/views/alarm/record/bizAccess.vue

@@ -146,7 +146,7 @@ function jumpPP(row) {
   num = num.toFixed(0);
   const last = formatDate(now);
   const suffix = '/main/' + row.code + '@SPRING_BOOT/' + num + '分钟/' + last;
-  router.push({path: '/link/pp-link/', query: {suffix: suffix}})
+  router.push({path: '/pxf-risk-monitor-web/link/pp-link/', query: {suffix: suffix}})
 }
 
 function formatDate(date) {

+ 1 - 1
src/views/index/widget/accessError.vue

@@ -56,7 +56,7 @@ const getBiz = async () => {
 
 
 function target() {
-  router.push({path: "/alarm/bizAccess", query: {today: "true"}})
+  router.push({path: "/pxf-risk-monitor-web/alarm/bizAccess", query: {today: "true"}})
 }
 
 </script>

+ 1 - 1
src/views/index/widget/alarmRanking.vue

@@ -52,6 +52,6 @@ async function getAlarm(){
 }
 
 function target(){
-  router.push({path:"/alarm/bizSort",query:{today:"true"}})
+  router.push({path:"/pxf-risk-monitor-web/alarm/bizSort",query:{today:"true"}})
 }
 </script>

+ 1 - 1
src/views/index/widget/appHealth.vue

@@ -41,7 +41,7 @@ async function getHl(){
 
 function handleDetails(item){
   const {modelId,hlScoreId} = item
-  router.push({path: '/hl/bm',query:{modelId,hlScoreId}})
+  router.push({path: '/pxf-risk-monitor-web/hl/bm',query:{modelId,hlScoreId}})
 }
 
 </script>

+ 1 - 1
src/views/index/widget/runResult.vue

@@ -30,7 +30,7 @@ const interval = ref(null)
 const router = useRouter()
 
 const handleTarget = () => {
-  router.push("/risk/heterogeneous")
+  router.push("/pxf-risk-monitor-web/risk/heterogeneous")
 }
 
 onMounted(() => {

+ 1 - 1
src/views/index/widget/runTendency.vue

@@ -45,7 +45,7 @@ const visible = ref(false)
 const interval = ref(null)
 
 const handleTarget=()=>{
-  router.push("/obj/obj")
+  router.push("/pxf-risk-monitor-web/obj/obj")
 }
 
 onMounted(() => {

+ 1 - 1
src/views/index/widget/titleNav.vue

@@ -32,7 +32,7 @@ function getWeek(){
 }
 
 function toTarget(){
-  router.push({path:"/link/pp-link"})
+  router.push({path:"/pxf-risk-monitor-web/link/pp-link"})
 }
 
 </script>

+ 2 - 2
src/views/index/widget/topScrollBar.vue

@@ -23,9 +23,9 @@ const interval = ref(null)
 
 const nowCheck = (query) => {
   if (query) {
-    router.push({path: '/hl/check', query: {check: 'true'}})
+    router.push({path: '/pxf-risk-monitor-web/hl/check', query: {check: 'true'}})
   } else {
-    router.push({path: '/hl/check'})
+    router.push({path: '/pxf-risk-monitor-web/hl/check'})
   }
 }
 const result = ref({})

+ 1 - 1
src/views/monitor/job/index.vue

@@ -424,7 +424,7 @@ function crontabFill(value) {
 /** 任务日志列表查询 */
 function handleJobLog(row) {
   const jobId = row.jobId || 0;
-  router.push('/monitor/job-log/index/' + jobId)
+  router.push('/pxf-risk-monitor-web/monitor/job-log/index/' + jobId)
 }
 /** 新增按钮操作 */
 function handleAdd() {

+ 1 - 1
src/views/system/role/index.vue

@@ -364,7 +364,7 @@ function handleCommand(command, row) {
 }
 /** 分配用户 */
 function handleAuthUser(row) {
-  router.push("/system/role-auth/user/" + row.roleId);
+  router.push("/pxf-risk-monitor-web/system/role-auth/user/" + row.roleId);
 }
 /** 查询菜单树结构 */
 function getMenuTreeselect() {

+ 1 - 1
src/views/system/user/index.vue

@@ -484,7 +484,7 @@ function handleCommand(command, row) {
 /** 跳转角色分配 */
 function handleAuthRole(row) {
   const userId = row.userId;
-  router.push("/system/user-auth/role/" + userId);
+  router.push("/pxf-risk-monitor-web/system/user-auth/role/" + userId);
 };
 /** 重置密码按钮操作 */
 function handleResetPwd(row) {

+ 1 - 1
src/views/tool/gen/index.vue

@@ -282,7 +282,7 @@ function handleSelectionChange(selection) {
 /** 修改按钮操作 */
 function handleEditTable(row) {
   const tableId = row.tableId || ids.value[0];
-  router.push({ path: "/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } });
+  router.push({ path: "/pxf-risk-monitor-web/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } });
 }
 /** 删除按钮操作 */
 function handleDelete(row) {

+ 2 - 2
vite.config.js

@@ -10,7 +10,7 @@ export default defineConfig(({ mode, command }) => {
     // 部署生产环境和开发环境下的URL。
     // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
     // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
-    base: VITE_APP_ENV === 'production' ? '/pxf-risk-monitor-web' : '/',
+    base: VITE_APP_ENV === 'production' ? '/pxf-risk-monitor-web' : '/pxf-risk-monitor-web',
     plugins: createVitePlugins(env, command === 'build'),
     resolve: {
       // https://cn.vitejs.dev/config/#resolve-alias
@@ -31,7 +31,7 @@ export default defineConfig(({ mode, command }) => {
       proxy: {
         // https://cn.vitejs.dev/config/#server-proxy
         '/dev-api': {
-          target: 'http://localhost:8080',
+          target: 'http://localhost:18081',
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, '')
         }