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

接口优化

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