|
@@ -8,6 +8,7 @@ import { saveAs } from 'file-saver'
|
|
|
import useUserStore from '@/store/modules/user'
|
|
|
import useSettingsStore from '@/store/modules/settings'
|
|
|
import Notification from '../plugins/notification'
|
|
|
+import auth from '@/plugins/auth'
|
|
|
// import emitter from '../eventBus'
|
|
|
// import { getCurrentInstance } from 'vue';
|
|
|
// import { reject } from 'lodash-es'
|
|
@@ -66,7 +67,7 @@ service.interceptors.request.use(
|
|
|
// 当登录状态为已登录时才可以获取公告
|
|
|
// console.log(config)
|
|
|
// console.log(checkBeforeUrl(config.url))
|
|
|
- if (getToken() && !isToken && tenantInfo && !checkBeforeUrl(config.url)) {
|
|
|
+ if (getToken() && !isToken && tenantInfo && !checkBeforeUrl(config.url) && !useSettingsStore().closeNotification) {
|
|
|
// 所有条件都具备的情况下需先请求公告
|
|
|
let url = import.meta.env.VITE_APP_BASE_API + '/business/notification/getUnshowedNotification'
|
|
|
const showNotification = useSettingsStore().showNotification
|
|
@@ -84,7 +85,11 @@ service.interceptors.request.use(
|
|
|
if (res.data.code == 200) {
|
|
|
} else if (res.data.code == 202) {
|
|
|
notifications = res.data.data
|
|
|
- requestable = false
|
|
|
+ if (auth.hasPermi('business:notification:close')) {
|
|
|
+ Notification(notifications[0])
|
|
|
+ } else {
|
|
|
+ requestable = false
|
|
|
+ }
|
|
|
// showDialog()
|
|
|
}
|
|
|
}
|