Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
zhaokaiyao@91isoft.com
2021-10-13 11:20:55 +08:00
14 changed files with 527 additions and 319 deletions
+1 -1
View File
@@ -31,7 +31,7 @@
</el-table-column>
<el-table-column
width="120"
label="结束时间">
label="发布时间">
<template slot-scope="scope">
<span>{{scope.row.issueTime ? $moment(scope.row.issueTime).format('YYYY-MM-DD') : '' }}</span>
</template>
+1 -1
View File
@@ -117,7 +117,7 @@ export default {
display: flex;
flex: 1;
flex-direction: column;
width: 48vw;
width: 47vw;
height: calc(~'100% - 10px');
margin-right: 10px;
.more {
+1 -144
View File
@@ -81,150 +81,7 @@
prefix: '/foton'
}, res => {
if (res.ok) {
const JSESSIONID = document.cookie
this.setJESSCookie(JSESSIONID)
if (res.data.orgId === null || res.data.orgId === '') {
this.$message.warning('未分配组织机构,请联系管理员分配后重新登录')
return
}
// debugger
let Base64 = require('js-base64').Base64
let userInfoStr = Base64.decode(res.data)
let userInfo2 = decodeURIComponent(userInfoStr)
let userInfoObj = JSON.parse(userInfo2)
userInfoObj.userId = userInfoObj.usid
this.setToken(userInfoObj.usid) // vuex存储token
this.getByUserInfoCode(userInfoObj.usid).then((userInfo) => {
if (userInfo !== '' && userInfo !== null) {
userInfo.workNum = userInfoObj.workNum
if (userInfo.userPic !== null) {
this.getUserPic(userInfo.userPic).then((userPic) => {
// 把图片信息挂到用户信息中
userInfo.avator = 'uploadPath' + userPic.filePath + userPic.fileName
this.setUserInfo((JSON.stringify(userInfo)))
this.resetTime()
if (this.isRemember) {
this.rememberPwd({
username: this.username,
password: this.password
})
} else {
this.rememberPwd({
username: '',
password: ''
})
}
// 获取用户菜单
this.getMenu().then((menuList) => {
let hasHomeMenu = menuList.some((menuItem) => {
// return menuItem.id === 'G72J4WNFM8'
return menuItem.id === 'asdfadf'
})
if (hasHomeMenu) {
this.setMenu(JSON.stringify(menuList)).then(res => {
this.loading = false
this.$router.push('/home2')
}, e => {
this.loading = false
this.$message.warning('未获取到菜单')
})
} else {
this.$http.get('/logout', {}, {}, res => {
this.loading = false
this.$message.warning('无权访问')
this.$store.dispatch('logout')
}, e => {})
}
})
}, e => {
this.loading = false
this.$notify.error('用户信息拉取失败')
})
} else {
this.setUserInfo((JSON.stringify(userInfo)))
this.resetTime()
if (this.isRemember) {
this.rememberPwd({
username: this.username,
password: this.password
})
} else {
this.rememberPwd({
username: '',
password: ''
})
}
// 获取用户菜单
this.getMenu().then((menuList) => {
let hasHomeMenu = false
menuList.map((menuItem) => {
if (menuItem.id === 'asdfadf') {
hasHomeMenu = true
}
})
if (hasHomeMenu) {
this.setMenu(JSON.stringify(menuList)).then(res => {
this.$router.push('/home2')
}, e => {
this.$message.warning('未获取到菜单')
})
} else {
this.$http.get('/logout', {}, {}, res => {
this.$message.warning('无权访问')
}, e => {})
}
})
}
} else {
let userInfo = {}
for (let key in userInfoObj) {
if (key !== 'uname') {
userInfo[key] = userInfoObj[key]
} else {
userInfo.uName = userInfoObj[key]
}
}
this.setUserInfo(JSON.stringify((userInfo)))
this.resetTime()
if (this.isRemember) {
this.rememberPwd({
username: this.username,
password: this.password
})
} else {
this.rememberPwd({
username: '',
password: ''
})
}
// 获取用户菜单
this.getMenu().then((menuList) => {
let hasHomeMenu = false
menuList.map((menuItem) => {
if (menuItem.id === 'asdfadf') {
hasHomeMenu = true
}
})
if (hasHomeMenu) {
this.setMenu(JSON.stringify(menuList)).then(res => {
this.$router.push('/home2')
}, e => {
this.$message.warning('未获取到菜单')
})
} else {
this.$http.get('/logout', {}, {}, res => {
console.log('logout')
this.$message.warning('无权访问')
}, e => {
console.log(e)
})
}
})
}
}, e => {
this.$message.warning('获取用户信息失败')
})
this.loginNew(res)
} else if (res.respCode === 'r0012') {
this.loading = false
this.$message.error(res.message)
+151
View File
@@ -0,0 +1,151 @@
<!-- 长城项目 登录页 -->
<template>
</template>
<script>
import { mapMutations, mapActions } from 'vuex'
import axios from 'axios'
import util from 'util'
import { get_verify_by_instance,loginIdm,getMenu } from 'api/process'
import { ssoLoginUrlDev,ssoLoginUrl,webLoginType,devWebUrl } from '@/sysConfig'
export default {
name: 'LoginVerify',
data () {
return {
username: this.$store.state.laws_urm || '', // 用户名
password: this.$store.state.laws_prm || '', // 密码
loading: false,
isRemember: false, // 记住密码
showIETips: false
}
},
methods: {
/**
* @description: 获取菜单logout
* @author: chenxiaoxi
* @date: 2018/11/11 13:42:14
*/
getMenu () {
return new Promise((resolve, reject) => {
this.$http.get('sarUser/user/menu', {}, {
_this: this,
}, res => {
if (res.ok) {
resolve(res.data)
}
}, e => {
reject(e)
})
})
},
loginNew (res) {
if (res.data.orgId === null || res.data.orgId === '') {
this.$message.warning('未分配组织机构,请联系管理员分配后重新登录')
return
}
let Base64 = require('js-base64').Base64
let userInfoStr = Base64.decode(res.data)
let userInfo2 = decodeURIComponent(userInfoStr)
let userInfoObj = JSON.parse(userInfo2)
userInfoObj.userId = userInfoObj.usid
window.sessionStorage.setItem('userInfoObj', userInfoObj); // del
this.setToken(userInfoObj.token) // vuex存储token
let userInfo = {}
for (let key in userInfoObj) {
if (key !== 'uname') {
userInfo[key] = userInfoObj[key]
} else {
userInfo.uName = userInfoObj[key]
}
}
this.setUserInfo(JSON.stringify((userInfo)))
// this.resetTime()
// 获取用户菜单
window.sessionStorage.setItem('userInfo', userInfo); // del
this.getMenu().then((menuList) => {
let hasHomeMenu = false
menuList.map((menuItem) => {
if (menuItem.id === 'asdfadf') {
hasHomeMenu = true
}
})
window.sessionStorage.setItem('hasHomeMenu', hasHomeMenu); // del
window.sessionStorage.setItem('menuList', menuList); // del
if (hasHomeMenu) {
this.setMenu(JSON.stringify(menuList)).then(res => {
// this.$router.push('/home1')
let routerUrl = localStorage.getItem("routerUrl");
let routerParam = localStorage.getItem("routerParam");
// 路由跳转
if(routerParam && routerParam != ''){
const param = routerParam.split("&");
this.$router.push({
name: routerUrl,
query: {
taskIds: param[0].split("=")[1],
prcId: param[1].split("=")[1],
prcNum: param[2].split("=")[1],
prcName: param[3].split("=")[1],
prcType: param[4].split("=")[1]
}
})
}else {
this.$router.push('/'+routerUrl)
}
}, e => {
this.$message.warning('未获取到菜单')
})
} else {
alert('无系统权限')
// window.location.href = 'http://testsso1.foton.com.cn/oauth2.0/authorize?client_id=app_slrs&redirect_uri=http://127.0.0.1:9090&response_type=code';
}
})
},
...mapMutations(['setToken', 'setUserInfo', 'resetTime', 'rememberPwd', 'setJESSCookie']),
...mapActions(['setMenu'])
},
computed: {
},
mounted () {
let url = window.location.search
let code = "";
if(url){
url = url.substr(1);
url = url.split('&');
let info = [];
let obj = {};
for (let i = 0,len = url.length; i < len; i++) {
info = url[i].split('=')
obj[info[0]] = decodeURI(info[1]);
url[i] = obj;
}
code = url[0].code
}
let _formData = new FormData()
_formData.append('code', code === undefined ? "" : code)
loginIdm(_formData).then(res => {
if (res.ok) {
this.loginNew(res)
} else {
window.location.href = ssoLoginUrlDev
}
})
if (this.$store.state.laws_urm !== '') {
this.isRemember = true
}
const UA = navigator.userAgent.toLocaleLowerCase()
if (UA.match(/msie/) != null || UA.match(/trident/) != null) {
this.showIETips = true
}
}
}
</script>
<style lang="less" scoped>
</style>
@@ -44,10 +44,8 @@
class="common-button-primary add-button"
size="mini"
@click="openModal(null,'addOpt')"
v-btn-permission="'389d3690eeea9d3808bdff4d02dddbd8'">
<i class="el-icon-plus"></i>
v-btn-permission="'389d3690eeea9d3808bdff4d02dddbd8'"><i class="el-icon-plus"></i>新增
<!-- <i class="el-icon-plus"></i>-->
新增
</el-button>
<el-button
class="common-button-default delete-button"