外部url菜单,内部打开是,也支持通过 ${token}方式传递当前登录TOKEN
This commit is contained in:
parent
cf5fde80d4
commit
844f1e228c
|
@ -38,16 +38,18 @@
|
||||||
//url = "http://www.baidu.com"
|
//url = "http://www.baidu.com"
|
||||||
console.log("------url------"+url)
|
console.log("------url------"+url)
|
||||||
if (url !== null && url !== undefined) {
|
if (url !== null && url !== undefined) {
|
||||||
this.url = url;
|
//-----------------------------------------------------------------------------------------
|
||||||
/*update_begin author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
|
//url支持通过 ${token}方式传递当前登录TOKEN
|
||||||
if(this.$route.meta.internalOrExternal != undefined && this.$route.meta.internalOrExternal==true){
|
|
||||||
this.closeCurrent();
|
|
||||||
//外部url加入token
|
|
||||||
let tokenStr = "${token}";
|
let tokenStr = "${token}";
|
||||||
if(url.indexOf(tokenStr)!=-1) {
|
if(url.indexOf(tokenStr)!=-1) {
|
||||||
let token = Vue.ls.get(ACCESS_TOKEN);
|
let token = Vue.ls.get(ACCESS_TOKEN);
|
||||||
this.url = url.replace(tokenStr, token);
|
this.url = url.replace(tokenStr, token);
|
||||||
}
|
}
|
||||||
|
//-----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/*update_begin author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
|
||||||
|
if(this.$route.meta.internalOrExternal != undefined && this.$route.meta.internalOrExternal==true){
|
||||||
|
this.closeCurrent();
|
||||||
window.open(this.url);
|
window.open(this.url);
|
||||||
}
|
}
|
||||||
/*update_end author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
|
/*update_end author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
|
||||||
|
|
Loading…
Reference in New Issue