From ad3c05911574c704bc42f388ad67efdd7cc77ec2 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Wed, 30 Apr 2025 17:55:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BC=98=E5=8C=96=20?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=AD=89=E4=BF=A1=E6=81=AF=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 2 +- src/components/UploadImg/index.vue | 10 +- src/layout/components/Navbar.vue | 320 +++++++++--------- src/router/index.js | 271 +++++++-------- src/utils/request.js | 2 +- .../key-person/components/addAndEditForm.vue | 10 +- .../components/addAndEditForm.vue | 10 +- .../components/addAndEditForm.vue | 33 +- .../sub-manage/components/addAndEditForm.vue | 4 +- .../components/addAndEditForm.vue | 4 +- .../components/addAndEditForm.vue | 14 +- 11 files changed, 362 insertions(+), 318 deletions(-) diff --git a/.env.production b/.env.production index d67083d..21fa24c 100644 --- a/.env.production +++ b/.env.production @@ -5,4 +5,4 @@ VUE_APP_TITLE = 市场部投标信息检索工具 ENV = 'production' # 市场部投标信息检索工具/生产环境 -VUE_APP_BASE_API = '/prod-api' +VUE_APP_BASE_API = '/search-tool-api' diff --git a/src/components/UploadImg/index.vue b/src/components/UploadImg/index.vue index 130fd15..e1f5763 100644 --- a/src/components/UploadImg/index.vue +++ b/src/components/UploadImg/index.vue @@ -136,12 +136,12 @@ export default { this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('、')}格式的文件!`) return false } - const isLt = file.size / 1024 / 1024 < this.fileSize - if (!isLt) { - this.$modal.msgError(`图片大小不能超过 ${this.fileSize} MB`) + // const isLt = file.size / 1024 / 1024 < this.fileSize + // if (!isLt) { + // this.$modal.msgError(`图片大小不能超过 ${this.fileSize} MB`) - return false - } + // return false + // } this.$modal.loading('图片正在上传,请稍候...') }, diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index e74dd0b..072b940 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -1,49 +1,53 @@ diff --git a/src/router/index.js b/src/router/index.js index 71907b6..059c6f8 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -30,154 +30,155 @@ import Layout from '@/layout' // 公共路由 export const constantRoutes = [ - { - path: '/redirect', - component: Layout, - hidden: true, - children: [ - { - path: '/redirect/:path(.*)', - component: () => import('@/views/redirect') - } - ] - }, - { - path: '/login', - component: () => import('@/views/login'), - hidden: true - }, - { - path: '/register', - component: () => import('@/views/register'), - hidden: true - }, - { - path: '/404', - component: () => import('@/views/error/404'), - hidden: true - }, - { - path: '/401', - component: () => import('@/views/error/401'), - hidden: true - }, - { - path: '', - component: Layout, - redirect: 'index', - children: [ - { - path: 'index', - component: () => import('@/views/index'), - name: 'Index', - meta: { title: '首页', icon: 'dashboard', affix: true } - } - ] - }, - { - path: '/user', - component: Layout, - hidden: true, - redirect: 'noredirect', - children: [ - { - path: 'profile', - component: () => import('@/views/system/user/profile/index'), - name: 'Profile', - meta: { title: '个人中心', icon: 'user' } - } - ] - } + { + path: '/redirect', + component: Layout, + hidden: true, + children: [ + { + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect'), + }, + ], + }, + { + path: '/login', + component: () => import('@/views/login'), + hidden: true, + }, + { + path: '/register', + component: () => import('@/views/register'), + hidden: true, + }, + { + path: '/404', + component: () => import('@/views/error/404'), + hidden: true, + }, + { + path: '/401', + component: () => import('@/views/error/401'), + hidden: true, + }, + { + path: '', + component: Layout, + redirect: 'index', + children: [ + { + path: 'index', + component: () => import('@/views/index'), + name: 'Index', + meta: { title: '首页', icon: 'dashboard', affix: true }, + }, + ], + }, + { + path: '/user', + component: Layout, + hidden: true, + redirect: 'noredirect', + children: [ + { + path: 'profile', + component: () => import('@/views/system/user/profile/index'), + name: 'Profile', + meta: { title: '个人中心', icon: 'user' }, + }, + ], + }, ] // 动态路由,基于用户权限动态去加载 export const dynamicRoutes = [ - { - path: '/system/user-auth', - component: Layout, - hidden: true, - permissions: ['system:user:edit'], - children: [ - { - path: 'role/:userId(\\d+)', - component: () => import('@/views/system/user/authRole'), - name: 'AuthRole', - meta: { title: '分配角色', activeMenu: '/system/user' } - } - ] - }, - { - path: '/system/role-auth', - component: Layout, - hidden: true, - permissions: ['system:role:edit'], - children: [ - { - path: 'user/:roleId(\\d+)', - component: () => import('@/views/system/role/authUser'), - name: 'AuthUser', - meta: { title: '分配用户', activeMenu: '/system/role' } - } - ] - }, - { - path: '/system/dict-data', - component: Layout, - hidden: true, - permissions: ['system:dict:list'], - children: [ - { - path: 'index/:dictId(\\d+)', - component: () => import('@/views/system/dict/data'), - name: 'Data', - meta: { title: '字典数据', activeMenu: '/system/dict' } - } - ] - }, - { - path: '/monitor/job-log', - component: Layout, - hidden: true, - permissions: ['monitor:job:list'], - children: [ - { - path: 'index/:jobId(\\d+)', - component: () => import('@/views/monitor/job/log'), - name: 'JobLog', - meta: { title: '调度日志', activeMenu: '/monitor/job' } - } - ] - }, - { - path: '/tool/gen-edit', - component: Layout, - hidden: true, - permissions: ['tool:gen:edit'], - children: [ - { - path: 'index/:tableId(\\d+)', - component: () => import('@/views/tool/gen/editTable'), - name: 'GenEdit', - meta: { title: '修改生成配置', activeMenu: '/tool/gen' } - } - ] - } + { + path: '/system/user-auth', + component: Layout, + hidden: true, + permissions: ['system:user:edit'], + children: [ + { + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole'), + name: 'AuthRole', + meta: { title: '分配角色', activeMenu: '/system/user' }, + }, + ], + }, + { + path: '/system/role-auth', + component: Layout, + hidden: true, + permissions: ['system:role:edit'], + children: [ + { + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser'), + name: 'AuthUser', + meta: { title: '分配用户', activeMenu: '/system/role' }, + }, + ], + }, + { + path: '/system/dict-data', + component: Layout, + hidden: true, + permissions: ['system:dict:list'], + children: [ + { + path: 'index/:dictId(\\d+)', + component: () => import('@/views/system/dict/data'), + name: 'Data', + meta: { title: '字典数据', activeMenu: '/system/dict' }, + }, + ], + }, + { + path: '/monitor/job-log', + component: Layout, + hidden: true, + permissions: ['monitor:job:list'], + children: [ + { + path: 'index/:jobId(\\d+)', + component: () => import('@/views/monitor/job/log'), + name: 'JobLog', + meta: { title: '调度日志', activeMenu: '/monitor/job' }, + }, + ], + }, + { + path: '/tool/gen-edit', + component: Layout, + hidden: true, + permissions: ['tool:gen:edit'], + children: [ + { + path: 'index/:tableId(\\d+)', + component: () => import('@/views/tool/gen/editTable'), + name: 'GenEdit', + meta: { title: '修改生成配置', activeMenu: '/tool/gen' }, + }, + ], + }, ] // 防止连续点击多次路由报错 -let routerPush = Router.prototype.push; -let routerReplace = Router.prototype.replace; +let routerPush = Router.prototype.push +let routerReplace = Router.prototype.replace // push Router.prototype.push = function push(location) { - return routerPush.call(this, location).catch(err => err) + return routerPush.call(this, location).catch((err) => err) } // replace Router.prototype.replace = function push(location) { - return routerReplace.call(this, location).catch(err => err) + return routerReplace.call(this, location).catch((err) => err) } export default new Router({ - mode: 'history', // 去掉url中的# - scrollBehavior: () => ({ y: 0 }), - routes: constantRoutes + mode: 'history', // 去掉url中的# + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes, + base: process.env.NODE_ENV === 'production' ? '/search-tool' : '', //根据运行环境设置 }) diff --git a/src/utils/request.js b/src/utils/request.js index c68372b..bef6bd0 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -96,7 +96,7 @@ service.interceptors.response.use( .then(() => { isRelogin.show = false store.dispatch('LogOut').then(() => { - location.href = '/index' + location.href = process.env.NODE_ENV === 'production' ? '/search-tool/index' : '/index' }) }) .catch(() => { diff --git a/src/views/company-manage/key-person/components/addAndEditForm.vue b/src/views/company-manage/key-person/components/addAndEditForm.vue index 6b5d876..3ecc274 100644 --- a/src/views/company-manage/key-person/components/addAndEditForm.vue +++ b/src/views/company-manage/key-person/components/addAndEditForm.vue @@ -224,6 +224,7 @@