From 4588965a8d6f9a06834279d98c57a74450d9e969 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 10 Sep 2021 13:21:18 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=AB=99=E5=86=85?= =?UTF-8?q?=E4=BF=A1=E7=82=B9=E5=87=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + .../components/NavHeader/SiteMessages.vue | 2 +- src/styles/element-ui.scss | 23 +++++++++++++++++++ src/utils/request.js | 11 +++++---- src/views/settings/Auth/WeCom.vue | 2 +- 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index a2de8da1c..c43c5acbe 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -775,6 +775,7 @@ } }, "setting": { + "Radius": "Radius", "Enable": "启用", "AuthLimit": "登录限制", "SMTP": "邮件服务器", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index d76351cae..c4021a183 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -759,6 +759,7 @@ } }, "setting": { + "Radius": "Radius", "Enable": "Enable", "Perm": "Permission", "SMTP": "SMTP server", diff --git a/src/layout/components/NavHeader/SiteMessages.vue b/src/layout/components/NavHeader/SiteMessages.vue index 911bc54f0..b545844a4 100644 --- a/src/layout/components/NavHeader/SiteMessages.vue +++ b/src/layout/components/NavHeader/SiteMessages.vue @@ -19,7 +19,7 @@ v-for="msg of messages" :key="msg.id" class="msg-item" - :class="msg.has_read ? 'msg-read' : 'msg-unread'" + :class="msg['has_read'] ? 'msg-read' : 'msg-unread'" @mouseover="hoverMsgId = msg.id" @mouseleave="hoverMsgId = ''" @click="showMsgDetail(msg)" diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index ed78a7db0..8746423e0 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -458,3 +458,26 @@ a { .el-table-filter__list-item:hover { color: $--color-text-primary; } + +//.el-dialog__wrapper { +// display: flex; +// align-items: center; +// justify-content: center; +//} + +.el-dialog { + display: flex; + flex-direction: column; + margin:0 !important; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + max-height: calc(100vh - 30px); + max-width: calc(100vh - 30px); +} + +.el-dialog .el-dialog__body { + flex: 1; + overflow: auto; +} diff --git a/src/utils/request.js b/src/utils/request.js index 5c72510e7..9a0de05a7 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -6,6 +6,7 @@ import { refreshSessionIdAge } from '@/api/users' import { Message, MessageBox } from 'element-ui' import store from '@/store' import axiosRetry from 'axios-retry' +import router from '@/router' // create an axios instance const service = axios.create({ @@ -17,13 +18,13 @@ const service = axios.create({ function beforeRequestAddToken(config) { const csrfToken = getTokenFromCookie() if (csrfToken) { - // let each request carry token - // ['X-Token'] is a custom headers key - // please modify it according to the actual situation config.headers['X-CSRFToken'] = csrfToken } - if (store.getters.currentOrg) { - config.headers['X-JMS-ORG'] = store.getters.currentOrg.id + const queryOrgId = router.currentRoute.query?.oid + const storeOrgId = store.getters.currentOrg?.id + const orgId = queryOrgId || storeOrgId + if (orgId) { + config.headers['X-JMS-ORG'] = orgId } } diff --git a/src/views/settings/Auth/WeCom.vue b/src/views/settings/Auth/WeCom.vue index 2f27b38a0..768b0e488 100644 --- a/src/views/settings/Auth/WeCom.vue +++ b/src/views/settings/Auth/WeCom.vue @@ -1,5 +1,5 @@