update taskName改为从接口获取
This commit is contained in:
+6
-1
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user