feat: There is no way the, 配置公开搜索中心 外部访问

This commit is contained in:
super_liu
2022-04-14 14:08:56 +08:00
parent 2e7186cb78
commit d6cdf051ae
7 changed files with 3328 additions and 9 deletions
+111
View File
@@ -0,0 +1,111 @@
<!-- 长城项目 登录页 -->
<template>
</template>
<script>
import { mapMutations, mapActions } from 'vuex'
import axios from 'axios'
import util from 'util'
import { get_verify_by_instance,loginIdm,getMenu,checkPageNoEncryption } from 'api/process'
import { ssoLoginUrlDev,ssoLogoutUrlDev,ssoLoginUrl,webLoginType,devWebUrl } from '@/sysConfig'
export default {
name: 'LoginVerifyNoEncryption',
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', {
userId: this.$store.getters.userInfo.userId,
}, {
_this: this,
}, res => {
if (res.ok) {
resolve(res.data)
}
}, e => {
reject(e)
})
})
},
loginNew (res) {
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
// this.$router.push('/home1')
let routerUrl = localStorage.getItem("routerUrl");
let routerParam = localStorage.getItem("routerParam");
// 路由跳转
if(routerParam && routerParam !== ''){
const UA = navigator.userAgent.toLocaleLowerCase()
if (UA.match(/msie/) != null || UA.match(/trident/) != null) {
alert('为了最佳显示效果 请使用google chrome')
}
this.$router.push('/'+routerUrl)
}
},
...mapMutations(['setToken', 'setUserInfo', 'resetTime', 'rememberPwd', 'setJESSCookie']),
...mapActions(['setMenu'])
},
computed: {
},
mounted () {
let userName = localStorage.getItem("routerParam");
if(userName !== undefined && userName !== ""){
checkPageNoEncryption({
username: userName
}, {
_this: this
}).then(res => {
if (res.ok) {
this.loginNew(res)
} else {
if(res.respCode && res.respCode === 'r0011'){
this.$store.dispatch('logout')
this.$alert('您没有系统访问权限,请联系管理员进行授权', '提示', {
confirmButtonText: '确定',
type: 'warning',
showClose: false,
showCancelButton: false,
}).then(() => {
window.location.href = ssoLogoutUrlDev
})
}
}
})
}else {
window.location.href = ssoLogoutUrlDev
}
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>
File diff suppressed because it is too large Load Diff
@@ -19,10 +19,14 @@
<div class="search-btn" @click="searchSarByInputKeyByCondition"></div>
</div>
</div>
<router-link to="/advancedSearch" class="router-link">
<!-- 外部访问点击高级检索搜索中心跳入指定页面 -->
<router-link v-if="externalStatus === 'external'" to="/advancedSearchExternal" class="router-link">
<div>高级检索</div>
</router-link>
<router-link to="/home2" class="router-link1">
<router-link v-if="externalStatus !== 'external'" to="/advancedSearch" class="router-link">
<div>高级检索</div>
</router-link>
<router-link v-if="externalStatus !== 'external'" to="/home2" class="router-link1">
<div>首页</div>
</router-link>
</div>
@@ -339,6 +343,7 @@
},
data () {
return {
externalStatus:'',
itermsConditionsTitle1: '',
itermsConditionsTitle2: '',
itermsConditionsFlag: false,
@@ -2663,6 +2668,10 @@
}
},
mounted () {
let external = localStorage.getItem("external");
if(external !== undefined && external !== null){
this.externalStatus = external
}
let globalInputSearch = this.$route.params.searchValue
if (globalInputSearch !== 'allvalue') {
this.keywords = globalInputSearch