提交 0f9403b4 authored 作者: huaxinzhu's avatar huaxinzhu

Merge branch 'dev_hxz' into test

...@@ -284,6 +284,8 @@ ...@@ -284,6 +284,8 @@
}, },
data() { data() {
return { return {
// 动态获取 sso 域名
ssourl: '',
// meta 信息 // meta 信息
keyTitle: '', keyTitle: '',
keyWords: '', keyWords: '',
...@@ -390,11 +392,13 @@ ...@@ -390,11 +392,13 @@
{ {
id:5, title:'新闻动态' id:5, title:'新闻动态'
} }
] ],
} }
}, },
created() { created() {
let isPc = this.IsPc() let isPc = this.IsPc()
/** 动态获取 sso配置域名 */
this.getssourl();
// console.log(111,isPc); // console.log(111,isPc);
// console.log(222,navigator.userAgent); // console.log(222,navigator.userAgent);
}, },
...@@ -408,6 +412,18 @@ ...@@ -408,6 +412,18 @@
}, },
methods: { methods: {
/** 动态获取 sso 配置域名 */
getssourl(){
var ssa = window.location.host
let data = { domain:ssa }
this.$store.dispatch('getssourl', data)
.then((res) => {
if(res.code==1){
this.ssourl = res.data.sso_url
//this.gotosso()
}
}).catch(() => {})
},
IsPc() { IsPc() {
let userAgent = navigator.userAgent let userAgent = navigator.userAgent
let Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"]; let Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"];
...@@ -520,16 +536,20 @@ ...@@ -520,16 +536,20 @@
window.location.href = '//' + completeWebsite window.location.href = '//' + completeWebsite
} }
}, },
// 去注册 // 去注册 ssourl
toRegister() { toRegister() {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
var ssa = window.location.host; let ssa = window.location.host;
window.location.href = 'http://sso.jxhh.com/login?redirect=http://' + window.location.host + '/platformlogin' let ht = document.location.protocol;
window.location.href = ht + '//' + this.ssourl + '/login?redirect=' + ht + '//' + ssa + '/platformlogin'
}) })
}, },
// 去登录 // 去登录
toLogin() { toLogin() {
window.location.href = 'http://sso.jxhh.com/login?redirect=http://' + window.location.host + '/platformlogin' let ssa = window.location.host;
let ht = document.location.protocol;
window.location.href = ht + '//' + this.ssourl + '/login?redirect=' + ht + '//' + ssa + '/platformlogin'
// window.location.href = 'http://sso.jxhh.com/login?redirect=http://' + window.location.host + '/platformlogin'
} }
} // methods end } // methods end
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论