提交 8a7e558f authored 作者: 郑伟娜's avatar 郑伟娜

接口优化

上级 2c25e951
......@@ -44,11 +44,11 @@ export function getallCloudList(params) {
//获取sso域名
export function getssoUrl(data) {
return request({
url: '//sysapi.jxhh.com/api/v1/oem/webSite/ssoChannel',
url: '/channelSite/domain/info',
// url: '//192.168.26.179:6601/api/v1/oem/webSite/ssoChannel',
// url: '//newsys.jxhh.com/api/v1/oem/webSite/ssoChannel',
method: 'get',
params: data
method: 'post',
data
})
}
......
......@@ -110,7 +110,7 @@ export default {
const data = {
type: 2,
site_type: 4,
domain: ssa,
// domain: ssa,
}
indexInfo(data).then(res=> {
if (res.code == 1) {
......@@ -125,11 +125,13 @@ export default {
ssooutinfo(){
var ssa = window.location.host
let data={
type: 2,
site_type: 7,
domain:ssa
}
this.$store.dispatch('getssourl',data).then((res) => {
if(res.code==1){
this.ssourl = res.data.sso_url
this.ssourl = res.data.channel_site[0].domain
this.logout()
}
})
......
......@@ -47,6 +47,7 @@ export default {
if (res.code == 1) {
this.title = res.data.channel_site[0].base_setting_res.name
this.logo = res.data.channel_site[0].base_setting_res.logo
document.title = res.data.channel_site[0].base_setting_res.title
}
})
}
......
......@@ -16,11 +16,11 @@ router.beforeEach((to, from, next) => {
const hasToken = getToken()
// console.log("getToken()",getToken())
if (hasToken) {
if (sessionStorage.getItem('saveTitle')) {
document.title = sessionStorage.getItem('saveTitle')
} else {
getPageTitle()
}
// if (sessionStorage.getItem('saveTitle')) {
// document.title = sessionStorage.getItem('saveTitle')
// } else {
// getPageTitle()
// }
/* has token*/
if (to.path === '/platformlogin') {
......
......@@ -54,10 +54,10 @@ const user = {
getssourl({commit},data){
return new Promise((resolve, reject) => {
getssoUrl(data).then(response => {
const date = response.data
const date = response.data.channel_site[0]
//debugger
if (response.code == 1) {
commit('SET_SSOURL', date.access_token)
commit('SET_SSOURL', date.domain)
}
resolve(response)
}).catch(error => {
......
......@@ -613,7 +613,7 @@
// console.log(222,navigator.userAgent);
},
mounted() {
this.getIndexInfo()
// this.getIndexInfo()
window.addEventListener('scroll', this.handleScroll, true);
},
destroyed() {
......@@ -624,11 +624,23 @@
/** 动态获取 sso 配置域名 */
getssourl() {
var ssa = window.location.host
let data = {domain: ssa}
let data = {
type: 2,
site_type: 7,
domain: ssa
}
this.$store.dispatch('getssourl', data)
.then((res) => {
if (res.code == 1) {
this.ssourl = res.data.sso_url
this.ssourl = res.data.channel_site[0].domain
this.channel_id = res.data.channel.id
this.keyTitle = res.data.channel_site[0].title;
this.keyWords = res.data.channel_site[0].keywords;
this.keyDescriptions = res.data.channel_site[0].describe;
this.getWebSite()
this.getDomain()
this.getAllcloud()
//this.gotosso()
}
}).catch(() => {
......@@ -653,7 +665,7 @@
// domain: 'newsys.jxhh.com',
type: 2,
site_type: 4,
domain: ssa,
// domain: ssa,
// field: op
}
indexInfo(data).then(res => {
......
......@@ -52,7 +52,7 @@
const data = {
type: 2,
site_type: 4,
domain: ssa,
// domain: ssa,
}
indexInfo(data).then(res => {
if (res.code == 1) {
......
......@@ -45,12 +45,14 @@ export default {
var ssa = window.location.host
// var ssa = 'scm.jxhh.com'
let data = {
type: 2,
site_type: 7,
domain:ssa
}
this.$store.dispatch('getssourl', data)
.then((res) => {
if(res.code==1){
this.ssourl = res.data.sso_url
this.ssourl = res.data.channel_site[0].domain
this.tiaozuan()
}
})
......
......@@ -20,12 +20,14 @@
var ssa = window.location.host
// var ssa = 'scm.jxhh.com'
let data = {
type: 2,
site_type: 7,
domain:ssa
}
this.$store.dispatch('getssourl', data)
.then((res) => {
if(res.code==1){
this.ssourl = res.data.sso_url
this.ssourl = res.data.channel_site[0].domain
this.gotosso()
}
})
......
......@@ -410,7 +410,7 @@
const data = {
type: 2,
site_type: 4,
domain: ssa,
// domain: ssa,
}
indexInfo(data).then(res=> {
if (res.code == 1) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论