From 844f1e228c179474a115bb890169a480a13a496e Mon Sep 17 00:00:00 2001
From: zhangdaiscott <zhangdaiscott@163.com>
Date: Wed, 7 Apr 2021 14:07:41 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E9=83=A8url=E8=8F=9C=E5=8D=95?=
 =?UTF-8?q?=EF=BC=8C=E5=86=85=E9=83=A8=E6=89=93=E5=BC=80=E6=98=AF=EF=BC=8C?=
 =?UTF-8?q?=E4=B9=9F=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87=20${token}?=
 =?UTF-8?q?=E6=96=B9=E5=BC=8F=E4=BC=A0=E9=80=92=E5=BD=93=E5=89=8D=E7=99=BB?=
 =?UTF-8?q?=E5=BD=95TOKEN?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../src/components/layouts/IframePageView.vue    | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/ant-design-vue-jeecg/src/components/layouts/IframePageView.vue b/ant-design-vue-jeecg/src/components/layouts/IframePageView.vue
index 50434423..dee1ddd9 100644
--- a/ant-design-vue-jeecg/src/components/layouts/IframePageView.vue
+++ b/ant-design-vue-jeecg/src/components/layouts/IframePageView.vue
@@ -38,16 +38,18 @@
         //url = "http://www.baidu.com"
         console.log("------url------"+url)
         if (url !== null && url !== undefined) {
-          this.url = url;
+          //-----------------------------------------------------------------------------------------
+          //url支持通过 ${token}方式传递当前登录TOKEN
+          let tokenStr = "${token}";
+          if(url.indexOf(tokenStr)!=-1) {
+            let token = Vue.ls.get(ACCESS_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();
-            //外部url加入token
-            let tokenStr = "${token}";
-            if(url.indexOf(tokenStr)!=-1){
-              let token = Vue.ls.get(ACCESS_TOKEN);
-               this.url = url.replace(tokenStr,token);
-            }
             window.open(this.url);
           }
           /*update_end author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
-- 
GitLab