update taskName改为从接口获取

This commit is contained in:
赵霄
2024-02-22 13:45:44 +08:00
parent 85360e24df
commit 5904190722
2 changed files with 19 additions and 4 deletions
+6 -1
View File
@@ -261,6 +261,9 @@ const queryStandardCompliance = (params) => getAction('/process/projectStandard/
// 在线编辑-通过在线编辑的文件id获取文件信息
const queryFileInfoByEditId = (params) => getAction('/onlyOffice/queryById', params)
// 获取taskName
const queryTaskNameByTaskId = (params) => getAction('/workCenter/getByTaskId', params)
export {
queryPermissionsByUser,
getFormDictTreeList,
@@ -385,5 +388,7 @@ export {
rejectStandardCompliance,
queryStandardCompliance,
queryFileInfoByEditId
queryFileInfoByEditId,
queryTaskNameByTaskId
}
+13 -3
View File
@@ -3,7 +3,7 @@ import router from './router'
import store from './store'
import { ACCESS_TOKEN, UI_CACHE_DB_DICT_DATA, USER_INFO, USER_NAME } from '@/store/mutation-types'
import { welcome } from '@/utils/util'
import { getSSOUserInfo } from './api/api'
import { getSSOUserInfo, queryTaskNameByTaskId } from './api/api'
const whiteList = ['/user/login'] // no redirect whitelist
@@ -26,10 +26,20 @@ router.beforeEach(async (to, from, next) => {
if (to.path === '/user/login') {
next('/')
} else {
if (to.query.taskName) {
if (to.query.taskId) {
queryTaskNameByTaskId({ taskId: to.query.taskId }).then(res => {
if (res.success) {
to.meta.title = res.result.taskName
}
}).finally(() => {
next()
})
} else if (to.query.taskName) {
to.meta.title = to.query.taskName
next()
} else {
next()
}
next()
}
} else {
if (whiteList.indexOf(to.path) !== -1) {