合并分支 'fix_foton_20230613' 到 'master'

Fix foton 20230613

查看合并请求 laws-foton-slrs/foton-laws-system-front!98
This commit is contained in:
高嵩
2023-07-17 18:51:07 +08:00
+51 -2
View File
@@ -62,17 +62,29 @@ import VConsole from 'vuex'
import isMobile from "./store/isMobile";
import { Loading } from 'element-ui';
// 路由拦截
router.beforeEach(function (to, from, next) {
let loading = Loading.service({
text: '加载中...',
background: '#fff'
});
function closeLoading(){
loading.close()
loading = null
}
let fromName = from.name
if(fromName === undefined || fromName === null){
window.sessionStorage.clear()
}
console.log(to)
console.log(from)
let toName = to.name
if (toName === 'CheckPage' || toName === 'loginStandDetails' || toName === 'error'
|| toName === 'LoginVerifyPhone') {
next()
closeLoading()
return
}
@@ -150,13 +162,16 @@ router.beforeEach(function (to, from, next) {
window.sessionStorage.clear()
localStorage.setItem("routerName","phoneHome")
next('/loginVerifyPhone')
closeLoading()
}else if(toName === 'phoneHome' && token != null && (fromName === undefined || fromName === null)){
localStorage.removeItem('token')
token = localStorage.getItem("token")
window.sessionStorage.clear()
next()
closeLoading()
}else if(toName === 'phoneHome' && token != null){
next()
closeLoading()
} else if(toName === 'processCenter'){
// hwh5.close();
//关闭当前窗口
@@ -183,17 +198,21 @@ router.beforeEach(function (to, from, next) {
window.sessionStorage.clear()
localStorage.setItem("routerName","phoneHome")
next('/loginVerifyPhone')
closeLoading()
}else if(toName === 'databaseSearch' || toName === 'standDynamics' ||
toName === 'domesticStand' || toName === 'domesticDetails' || toName === 'zlzxDetails'){
localStorage.setItem("routerName",toName)
next('/loginVerifyPhone')
closeLoading()
}else {
if(fromName === 'phoneHome'){
next()
closeLoading()
}else {
localStorage.removeItem("param");
localStorage.setItem('param',JSON.stringify(param4))
next('/phoneIndex')
closeLoading()
}
}
}else {
@@ -202,14 +221,17 @@ router.beforeEach(function (to, from, next) {
fromName === 'domesticStand' || fromName === 'domesticDetails' || toName === 'zlzxDetails'){
localStorage.setItem("routerName",toName)
next('/loginVerifyPhone')
closeLoading()
}else {
next()
closeLoading()
}
}
} else {
if(toName === 'databaseSearch' || toName === 'standDynamics' || toName === 'zlzxDetails' ||
toName === 'domesticStand' || toName === 'domesticDetails'){
next()
closeLoading()
}else if (toName.slice(0,5) !== 'phone') {
if(toName === 'LoginVerify'){
if(toName === 'phoneHome'){
@@ -219,13 +241,18 @@ router.beforeEach(function (to, from, next) {
window.sessionStorage.clear()
localStorage.setItem("routerName","phoneHome")
next('/loginVerifyPhone')
closeLoading()
}else{
next('/blankPage')
closeLoading()
}
}else {
if(toName === 'blankPage' || toName === 'processedPage') {
next()
closeLoading()
}else {
console.log('-bussLibrary4-')
extractedVerify()
}
}
@@ -239,14 +266,19 @@ router.beforeEach(function (to, from, next) {
window.sessionStorage.clear()
localStorage.setItem("routerName","phoneHome")
next('/loginVerifyPhone')
closeLoading()
}else{
next('/blankPage')
closeLoading()
}
}else {
console.log('-phoneBussLibrary4-')
next()
closeLoading()
}
}else {
next()
closeLoading()
}
}
}
@@ -255,6 +287,7 @@ router.beforeEach(function (to, from, next) {
if ((token === null || token === '' ) && toName === 'OtherStandardDetails') {
if (document.cookie) {
next()
closeLoading()
return
}
}
@@ -262,6 +295,7 @@ router.beforeEach(function (to, from, next) {
if(webLoginType != null && webLoginType === 'idm' ){
if(code){
next()
closeLoading()
}else {
if (taskId !== undefined && taskId !== null && prcId !== undefined && prcId !== null) {
extractedVerify(token)
@@ -270,9 +304,11 @@ router.beforeEach(function (to, from, next) {
extractedLocalStorage("standardSearch/All",userName)
localStorage.setItem('external', "external")
next('/LoginVerifyNoEncryption')
closeLoading()
}else {
if (toName === 'LoginVerifyNoEncryption') {
next()
closeLoading()
}else {
if(path === '/standardSearch/All'){
extractedLocalStorage('standardSearch/All','');
@@ -290,6 +326,7 @@ router.beforeEach(function (to, from, next) {
extractedVerify(token)
} else {
next('/Login')
closeLoading()
}
}
@@ -324,8 +361,10 @@ router.beforeEach(function (to, from, next) {
if ((hisCount && hisCount > 0)) { // 业务系统 当前节点已完成
if(isMobile()){
next('/processedPage')
closeLoading()
}else {
next()
closeLoading()
}
} else { // 业务系统 当前节点未完成
// commitStatus 大于0 表示当前节点存在未完成干活流程
@@ -379,6 +418,7 @@ router.beforeEach(function (to, from, next) {
window.location.href = ssoLoginUrlDev
} else {
next({path: routerPath + '?' +param})
closeLoading()
}
}
@@ -389,6 +429,7 @@ router.beforeEach(function (to, from, next) {
window.location.href = ssoLoginUrlDev
} else {
next()
closeLoading()
}
}
@@ -396,7 +437,9 @@ router.beforeEach(function (to, from, next) {
let paramPhone = 'taskIds=' + taskId + '&prcId=' + prcId + '&prcNum=' + prcNum +
'&taskAssignee=' + toName + '&prcName=' + prcName + '&prcType=' + prcType
let phoneRouter = 'phone' + toName.charAt(0).toUpperCase() + toName.slice(1)
next({path: phoneRouter + '?' + paramPhone})
console.log(phoneRouter);
next({path: phoneRouter + '?' + paramPhone})
closeLoading()
}
function extracted2(routerPath,param2) {
if (token === null || token === '') {
@@ -405,6 +448,7 @@ router.beforeEach(function (to, from, next) {
window.location.href = ssoLoginUrlDev
} else {
next({path: routerPath + '?' + param2})
closeLoading()
}
}
function extracted4(routerPath,param4) {
@@ -414,6 +458,7 @@ router.beforeEach(function (to, from, next) {
window.location.href = ssoLoginUrlDev
} else {
next({path: routerPath + '?' + param4})
closeLoading()
}
}
})
@@ -421,16 +466,20 @@ router.beforeEach(function (to, from, next) {
if(path === '/loginVerify'){
if(webLoginType != null && webLoginType === 'dev'){
next('/Login')
closeLoading()
}else {
next()
closeLoading()
}
}else {
if((fromName === undefined || fromName === null) && (path.indexOf("/standardSearch/All&userName") !== -1 || (path.indexOf("/standardSearch/All") !== -1 && userName !== undefined))) {
extractedLocalStorage("standardSearch/All",userName)
localStorage.setItem('external', "external")
next('/LoginVerifyNoEncryption')
closeLoading()
}else {
next()
closeLoading()
}
}
}