金宏单点登录优化;删除用户回显判断

main
xuechunyuan 3 years ago
parent e0a13f6106
commit 3a8774b9ae
  1. 3
      package.json
  2. 8
      src/api/plugin/workflow/form.js
  3. 3
      src/page/index/top/index.vue
  4. 2
      src/page/lock/index.vue
  5. 4
      src/page/login/index.vue
  6. 66
      src/permission.js
  7. 4
      src/router/axios.js
  8. 10
      src/views/maintenance/system.vue
  9. 11
      src/views/plugin/workflow/process/components/detail.vue

@ -8,7 +8,8 @@
"lint": "vue-cli-service lint",
"analyz": "npm_config_report=true npm run build",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e"
"test:e2e": "vue-cli-service test:e2e",
"buildDev": "vue-cli-service build --mode development"
},
"dependencies": {
"avue-plugin-ueditor": "^0.1.4",

@ -78,6 +78,14 @@ export const getCompany = (query) => {
params: query,
});
};
// 运维公司单个详情
export const getCompanyById = (query) => {
return request({
url: "/api/blade-user/client/user-info-by-id",
method: "get",
params: query,
});
};
// 运维部门
export const getDepts = (query) => {
return request({

@ -68,8 +68,7 @@ export default {
}).then(() => {
this.$store.dispatch("LogOut").then(() => {
resetRouter();
// this.$router.push({ path: "/newlogin" });
window.location.href="http://jhoa.qd.gov.cn/Default.aspx";
process.env.NODE_ENV != "production" ? this.$router.push({path: '/newlogin'}) : window.location.href="http://jhoa.qd.gov.cn/Default.aspx";
});
});
},

@ -50,7 +50,7 @@ export default {
}).then(() => {
this.$store.dispatch("LogOut").then(() => {
// this.$router.push({ path: "/newlogin" });
window.location.href="http://jhoa.qd.gov.cn/Default.aspx";
process.env.NODE_ENV != "production" ? this.$router.push({path: '/newlogin'}) : window.location.href="http://jhoa.qd.gov.cn/Default.aspx";
});
});
},

@ -47,9 +47,7 @@ export default {
// this.loading = false;
console.log('err=======res',err)
if(err.error == 'invalid_request') {
// let url = err.error_description+'?SSOToken=' + encodeURIComponent(window.location);
window.location.href = err.error_description;//
// window.location.href = 'http://jhoa.qd.gov.cn/Keeper.aspx?SSOToken=PSOSite%24TjZXxbcic5BDwCphjqib%2BVEWXFe1JX5N1VBWsX%2FNAapJ5MHEKOyR0Jf24C09C1NdofaFCYjfNvA%3D';
}else if(err.error == 'invalid_grant') {
this.$confirm(err.error_description, '提示', {
confirmButtonText: '确定',
@ -58,7 +56,6 @@ export default {
type: 'warning',
closeOnClickModal: false
}).then(() => {
// this.$router.replace({ path: '/newlogin' });
window.location.href = 'http://jhoa.qd.gov.cn/Default.aspx';
})
}else {
@ -69,7 +66,6 @@ export default {
type: 'warning',
closeOnClickModal: false
}).then(() => {
// this.$router.replace({ path: '/newlogin' });
window.location.href = 'http://jhoa.qd.gov.cn/Default.aspx';
})
}

@ -4,11 +4,12 @@
*/
import router from './router/router'
import store from './store'
import {validatenull} from '@/util/validate'
import {getToken} from '@/util/auth'
import { validatenull } from '@/util/validate'
import { getToken } from '@/util/auth'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
NProgress.configure({showSpinner: false});
import { MessageBox } from 'element-ui';
NProgress.configure({ showSpinner: false });
const lockPage = store.getters.website.lockPage; //锁屏页
router.beforeEach((to, from, next) => {
const meta = to.meta || {};
@ -16,14 +17,14 @@ router.beforeEach((to, from, next) => {
store.commit('SET_IS_MENU', isMenu === undefined);
if (getToken()) {
if (store.getters.isLock && to.path !== lockPage) { //如果系统激活锁屏,全部跳转到锁屏页
next({path: lockPage})
next({ path: lockPage })
} else if (to.path === '/newlogin') { //如果登录成功访问登录页跳转到主页
next({path: '/wel/index'})
next({ path: '/wel/index' })
} else {
//如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页
if (store.getters.token.length === 0) {
store.dispatch('FedLogOut').then(() => {
next({path: '/newlogin'})
next({ path: '/newlogin' })
})
} else {
const value = to.query.src || to.fullPath;
@ -53,9 +54,58 @@ router.beforeEach((to, from, next) => {
}
}
} else {
console.log('nologin===permission===========',to.path)
console.log('nologin===permission===========', to,from)
const ssotoken = to.query.SSOToken;
if (process.env.NODE_ENV == "production" && to.path != '/newlogin') {
//过滤ssotoken重新拼接回调地址
let newQuery = JSON.parse(JSON.stringify(to.query));
delete newQuery.SSOToken;
let fallbackUrl = window.location.href.substring(0, window.location.href.indexOf("?"));
let keys = Object.keys(newQuery);
for (let i = 0; i < keys.length; i++) {
if (i === 0) {
fallbackUrl = fallbackUrl + '?' + keys[i] + '=' + newQuery[keys[i]]
} else {
fallbackUrl = fallbackUrl + '&' + keys[i] + '=' + newQuery[keys[i]]
}
}
// alert(fallbackUrl)
// router.replace({path: fallbackUrl})
store.dispatch("LoginBySso", { SSOToken: ssotoken, grantType: 'yawei', fallbackUrl: fallbackUrl })
.then(() => {
// this.loading = false;
console.log('=============登录成功')
router.replace({ path: fallbackUrl })
}, err => {
// this.loading = false;
console.log('err=======res', err)
if (err.error == 'invalid_request') {
window.location.href = err.error_description;//重定向
} else if (err.error == 'invalid_grant') {
MessageBox.confirm(err.error_description, '提示', {
confirmButtonText: '确定',
showClose: false,
showCancelButton: false,
type: 'warning',
closeOnClickModal: false
}).then(() => {
window.location.href = 'http://jhoa.qd.gov.cn/Default.aspx';
})
} else {
MessageBox.confirm(err.error_description || '登录失败', '提示', {
confirmButtonText: '确定',
showClose: false,
showCancelButton: false,
type: 'warning',
closeOnClickModal: false
}).then(() => {
window.location.href = 'http://jhoa.qd.gov.cn/Default.aspx';
})
}
});
}
//判断是否需要认证,没有登录访问去登录页
if (meta.isAuth === false) {
else if (meta.isAuth === false) {
next()
} else {
next('/newlogin')

@ -66,7 +66,9 @@ axios.interceptors.response.use(res => {
if (statusWhiteList.includes(status)) return Promise.reject(res);
//如果是401则跳转到登录页面
// if (status === 401) store.dispatch('FedLogOut').then(() => router.push({path: '/newlogin'}));
if (status === 401) store.dispatch('FedLogOut').then(() => {window.location.href="http://jhoa.qd.gov.cn/Default.aspx";});
if (status === 401) store.dispatch('FedLogOut').then(() => {
process.env.NODE_ENV == "production" ? window.location.href="http://jhoa.qd.gov.cn/Default.aspx" : router.push({path: '/newlogin'});
});
// 如果请求为非200否者默认统一处理
if(res.data.error != undefined && res.config.params != undefined && res.config.params.grant_type != undefined && res.config.params.grant_type == 'yawei') {
return Promise.reject(res.data)

@ -323,6 +323,7 @@ export default {
const {
dataBaseAlias,
company,
companyName,
dataBaseIp,
dataBasePort,
deptId,
@ -338,7 +339,14 @@ export default {
this.findObject(this.option.column,"systemName").disabled = true;
this.form.dataBaseAlias = dataBaseAlias;
this.form.company = company;
//
const _idx = this.findObject(this.option.column,"company").dicData.findIndex(item => item.id == company);
if(_idx > -1){
this.form.company = company;
}
else{
this.form.company = companyName;
}
this.form.dataBaseIp = dataBaseIp;
this.form.dataBasePort = dataBasePort;
this.form.deptId = deptId;

@ -232,7 +232,8 @@ import {
getTaskAndDataBase,
getModuleAndDataTable,
getDatabasePro,
getDatabaseTab
getDatabaseTab,
getCompanyById
} from "@/api/plugin/workflow/form.js";
import {repeatMode} from "@/api/plugin/workflow/workorder.js";
import WfExamineForm from "./examForm.vue";
@ -611,6 +612,14 @@ export default {
setTimeout(() => {
this.form = variables;
// this.form.renwuzhonglei = variables.renwuzhonglei
//
const _idx = this.companyList.findIndex(item => item.id == variables.yunweigongsi);
if(_idx < 0){
getCompanyById({userId: variables.yunweigongsi}).then(res => {
this.form.yunweigongsi = res.data.data.name;
// console.log(this.form,"================")
})
}
this.waiting = false;
}, 100);
});

Loading…
Cancel
Save