From b91ba452051b1bd34347a81e6a139433f510be9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Tue, 7 Nov 2023 11:17:06 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=A4=84=E7=90=86=E5=86=85=E9=83=A8?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E5=9C=B0=E5=9D=80=E8=B7=B3?= =?UTF-8?q?=E8=BD=ACIAM=E7=99=BB=E5=BD=95=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 3 ++- .env.development | 3 ++- .env.production | 3 ++- .env.test | 3 ++- src/common/lang/businessSupport/zh.js | 3 ++- src/components/tools/UserMenu.vue | 2 +- src/enums/commonEnums.js | 6 ++++++ src/permission.js | 9 +++++++++ src/store/modules/user.js | 2 +- src/utils/request.js | 2 +- 10 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 5f08198f..e4126439 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ NODE_ENV=production VUE_APP_PLATFORM_NAME=JeroBoot 企业级快速开发平台 VUE_APP_SSO=false -VUE_TAG_FLAG=0 \ No newline at end of file +VUE_TAG_FLAG=0 +VUE_APP_LOGIN_PAGE='/user/login' \ No newline at end of file diff --git a/.env.development b/.env.development index aa76a6ef..1b4245b4 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,3 @@ NODE_ENV=development -VUE_APP_TAG_FLAG=0 \ No newline at end of file +VUE_APP_TAG_FLAG=0 +VUE_APP_LOGIN_PAGE='/user/login' \ No newline at end of file diff --git a/.env.production b/.env.production index 7a5c58b2..edbc4077 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,3 @@ NODE_ENV=production -VUE_APP_TAG_FLAG=1 \ No newline at end of file +VUE_APP_TAG_FLAG=1 +VUE_APP_LOGIN_PAGE='https://iam-uat.sinotruk.com:7011/idp/oauth2/authorize?redirect_uri=http://laws-test.sinotruk.com/dashboard/analysis&state=123&client_id=SRMS&response_type=code' \ No newline at end of file diff --git a/.env.test b/.env.test index b7941266..ebe3cdc3 100644 --- a/.env.test +++ b/.env.test @@ -2,4 +2,5 @@ NODE_ENV=production VUE_APP_API_BASE_URL=http://boot.jero.com:8080/laws-sinotruk VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jero.com/onlinePreview -VUE_APP_TAG_FLAG=1 \ No newline at end of file +VUE_APP_TAG_FLAG=1 +VUE_APP_LOGIN_PAGE='/user/login' \ No newline at end of file diff --git a/src/common/lang/businessSupport/zh.js b/src/common/lang/businessSupport/zh.js index aa2a5b2e..c2cfd81f 100644 --- a/src/common/lang/businessSupport/zh.js +++ b/src/common/lang/businessSupport/zh.js @@ -27,7 +27,8 @@ module.exports = { paymentMethod: '缴费方式', expenseReimbursement: '费用列支', meetingMaterial: '会议资料', - pleaseEnterCorrectPhone: '请输入正确格式的电话' + pleaseEnterCorrectPhone: '请输入正确格式的电话', + addUpToFourLevels: '该节点无法添加子节点' }, // 问答库 questionAnswer: { diff --git a/src/components/tools/UserMenu.vue b/src/components/tools/UserMenu.vue index a5d304e0..3981dc14 100644 --- a/src/components/tools/UserMenu.vue +++ b/src/components/tools/UserMenu.vue @@ -215,7 +215,7 @@ export default { content: '真的要注销登录吗 ?', onOk () { return that.Logout({}).then(() => { - window.location.replace('/user/login') + window.location.replace(process.env.VUE_APP_LOGIN_PAGE) }).catch(err => { that.$message.warning({ title: '错误', diff --git a/src/enums/commonEnums.js b/src/enums/commonEnums.js index 7877a95a..a5e43c2a 100644 --- a/src/enums/commonEnums.js +++ b/src/enums/commonEnums.js @@ -172,3 +172,9 @@ export const StandardizedActivityType = new EsEnums({ workingTeam: { text: '工作组', value: '3' }, fourLevelBiddingCommittee: { text: '分标委', value: '4' } }) + +// 支付状态 +export const PayState = new EsEnums({ + 已支付: { text: '已支付', value: '1' }, + 未支付: { text: '未支付', value: '2' } +}) diff --git a/src/permission.js b/src/permission.js index 73825db5..05a76568 100644 --- a/src/permission.js +++ b/src/permission.js @@ -116,13 +116,22 @@ router.beforeEach(async (to, from, next) => { if (to.path === '/user/login' && isOAuth2AppEnv()) { next({ path: OAUTH2_LOGIN_PAGE_PATH }) } else { + let path = to.path // 在免登录白名单,直接进入 + if (to.path === '/user/login' && to.path !== process.env.VUE_APP_LOGIN_PAGE) { + window.location.replace(process.env.VUE_APP_LOGIN_PAGE) + return + } next() } NProgress.done() } else { // 如果当前是在OAuth2APP环境,就跳转到OAuth2登录页面 const path = isOAuth2AppEnv() ? OAUTH2_LOGIN_PAGE_PATH : '/user/login' + if (path === '/user/login' && path !== process.env.VUE_APP_LOGIN_PAGE) { + window.location.replace(process.env.VUE_APP_LOGIN_PAGE) + return + } next({ path: path, query: { redirect: to.fullPath } }) NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 36a6f446..1de3e685 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -178,7 +178,7 @@ const user = { window.location.href = process.env.VUE_APP_CAS_BASE_URL + '/logout?service=' + serviceUrl } resolve() - window.location.replace('/user/login') + window.location.replace(process.env.VUE_APP_LOGIN_PAGE) }).catch(() => { resolve() }) diff --git a/src/utils/request.js b/src/utils/request.js index ad78e94d..1a0c97cd 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -39,7 +39,7 @@ const err = (error) => { break } // update-end- --- author:liusq ------ date:20200910 ---- for:处理Blob情况---- - if (token && data.includes('Token失效')) { + if (data.includes('Token失效')) { // update-begin- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转---- if (/wxwork|dingtalk/i.test(navigator.userAgent)) { Vue.prototype.$Jmessage.loading('登录已过期,正在重新登陆', 0)