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

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", "lint": "vue-cli-service lint",
"analyz": "npm_config_report=true npm run build", "analyz": "npm_config_report=true npm run build",
"test:unit": "vue-cli-service test:unit", "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": { "dependencies": {
"avue-plugin-ueditor": "^0.1.4", "avue-plugin-ueditor": "^0.1.4",

@ -78,6 +78,14 @@ export const getCompany = (query) => {
params: 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) => { export const getDepts = (query) => {
return request({ return request({

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

@ -50,7 +50,7 @@ export default {
}).then(() => { }).then(() => {
this.$store.dispatch("LogOut").then(() => { this.$store.dispatch("LogOut").then(() => {
// this.$router.push({ path: "/newlogin" }); // 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; // this.loading = false;
console.log('err=======res',err) console.log('err=======res',err)
if(err.error == 'invalid_request') { if(err.error == 'invalid_request') {
// let url = err.error_description+'?SSOToken=' + encodeURIComponent(window.location);
window.location.href = err.error_description;// 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') { }else if(err.error == 'invalid_grant') {
this.$confirm(err.error_description, '提示', { this.$confirm(err.error_description, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -58,7 +56,6 @@ export default {
type: 'warning', type: 'warning',
closeOnClickModal: false closeOnClickModal: false
}).then(() => { }).then(() => {
// this.$router.replace({ path: '/newlogin' });
window.location.href = 'http://jhoa.qd.gov.cn/Default.aspx'; window.location.href = 'http://jhoa.qd.gov.cn/Default.aspx';
}) })
}else { }else {
@ -69,7 +66,6 @@ export default {
type: 'warning', type: 'warning',
closeOnClickModal: false closeOnClickModal: false
}).then(() => { }).then(() => {
// this.$router.replace({ path: '/newlogin' });
window.location.href = 'http://jhoa.qd.gov.cn/Default.aspx'; window.location.href = 'http://jhoa.qd.gov.cn/Default.aspx';
}) })
} }

@ -4,11 +4,12 @@
*/ */
import router from './router/router' import router from './router/router'
import store from './store' import store from './store'
import {validatenull} from '@/util/validate' import { validatenull } from '@/util/validate'
import {getToken} from '@/util/auth' import { getToken } from '@/util/auth'
import NProgress from 'nprogress' // progress bar import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style 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; //锁屏页 const lockPage = store.getters.website.lockPage; //锁屏页
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
const meta = to.meta || {}; const meta = to.meta || {};
@ -16,14 +17,14 @@ router.beforeEach((to, from, next) => {
store.commit('SET_IS_MENU', isMenu === undefined); store.commit('SET_IS_MENU', isMenu === undefined);
if (getToken()) { if (getToken()) {
if (store.getters.isLock && to.path !== lockPage) { //如果系统激活锁屏,全部跳转到锁屏页 if (store.getters.isLock && to.path !== lockPage) { //如果系统激活锁屏,全部跳转到锁屏页
next({path: lockPage}) next({ path: lockPage })
} else if (to.path === '/newlogin') { //如果登录成功访问登录页跳转到主页 } else if (to.path === '/newlogin') { //如果登录成功访问登录页跳转到主页
next({path: '/wel/index'}) next({ path: '/wel/index' })
} else { } else {
//如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页 //如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页
if (store.getters.token.length === 0) { if (store.getters.token.length === 0) {
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
next({path: '/newlogin'}) next({ path: '/newlogin' })
}) })
} else { } else {
const value = to.query.src || to.fullPath; const value = to.query.src || to.fullPath;
@ -53,9 +54,58 @@ router.beforeEach((to, from, next) => {
} }
} }
} else { } 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() next()
} else { } else {
next('/newlogin') next('/newlogin')

@ -66,7 +66,9 @@ axios.interceptors.response.use(res => {
if (statusWhiteList.includes(status)) return Promise.reject(res); if (statusWhiteList.includes(status)) return Promise.reject(res);
//如果是401则跳转到登录页面 //如果是401则跳转到登录页面
// if (status === 401) store.dispatch('FedLogOut').then(() => router.push({path: '/newlogin'})); // 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否者默认统一处理 // 如果请求为非200否者默认统一处理
if(res.data.error != undefined && res.config.params != undefined && res.config.params.grant_type != undefined && res.config.params.grant_type == 'yawei') { 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) return Promise.reject(res.data)

@ -323,6 +323,7 @@ export default {
const { const {
dataBaseAlias, dataBaseAlias,
company, company,
companyName,
dataBaseIp, dataBaseIp,
dataBasePort, dataBasePort,
deptId, deptId,
@ -338,7 +339,14 @@ export default {
this.findObject(this.option.column,"systemName").disabled = true; this.findObject(this.option.column,"systemName").disabled = true;
this.form.dataBaseAlias = dataBaseAlias; 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.dataBaseIp = dataBaseIp;
this.form.dataBasePort = dataBasePort; this.form.dataBasePort = dataBasePort;
this.form.deptId = deptId; this.form.deptId = deptId;

@ -232,7 +232,8 @@ import {
getTaskAndDataBase, getTaskAndDataBase,
getModuleAndDataTable, getModuleAndDataTable,
getDatabasePro, getDatabasePro,
getDatabaseTab getDatabaseTab,
getCompanyById
} from "@/api/plugin/workflow/form.js"; } from "@/api/plugin/workflow/form.js";
import {repeatMode} from "@/api/plugin/workflow/workorder.js"; import {repeatMode} from "@/api/plugin/workflow/workorder.js";
import WfExamineForm from "./examForm.vue"; import WfExamineForm from "./examForm.vue";
@ -611,6 +612,14 @@ export default {
setTimeout(() => { setTimeout(() => {
this.form = variables; this.form = variables;
// this.form.renwuzhonglei = variables.renwuzhonglei // 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; this.waiting = false;
}, 100); }, 100);
}); });

Loading…
Cancel
Save