Commit 3eb712379a56169cc898a4ad94d4d1d23d232df2
1 parent
4d5cf991
App外需要登录检测优化~
Showing
2 changed files
with
23 additions
and
19 deletions
index.html
| 1 | 1 | <!DOCTYPE html> |
| 2 | 2 | <html> |
| 3 | - <head> | |
| 4 | - <meta charset="utf-8"> | |
| 5 | - <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"> | |
| 6 | - <link rel="Shortcut Icon" href="static/img/favicon.png" /> | |
| 7 | - <!-- HTTP 1.1 --> | |
| 3 | + <head> | |
| 4 | + <meta charset="utf-8"> | |
| 5 | + <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"> | |
| 6 | + <link rel="Shortcut Icon" href="static/img/favicon.png" /> | |
| 7 | + <!-- HTTP 1.1 --> | |
| 8 | 8 | <meta http-equiv="pragma" content="no-cache"> |
| 9 | 9 | <!-- HTTP 1.0 --> |
| 10 | 10 | <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> |
| 11 | 11 | <!-- Prevent caching at the proxy server --> |
| 12 | 12 | <meta http-equiv="expires" content="0"> |
| 13 | 13 | <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" /> |
| 14 | - <title> </title> | |
| 14 | + <title> </title> | |
| 15 | 15 | |
| 16 | - <!-- Crypto.js AES加密 CDN引用方式 --> | |
| 16 | + <!-- Crypto.js AES加密 CDN引用方式 --> | |
| 17 | 17 | <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/core.min.js"></script> |
| 18 | 18 | <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/enc-base64.min.js"></script> |
| 19 | 19 | <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/md5.min.js"></script> --> |
| ... | ... | @@ -30,10 +30,10 @@ |
| 30 | 30 | <script type="text/javascript" charset="UTF-8" src="https://wjj.ys1.cnliveimg.com/769/h5/js/jquery.min.js"></script> |
| 31 | 31 | <script type="text/javascript" charset="UTF-8" src="//res.cdn.openinstall.io/openinstall.js"></script> |
| 32 | 32 | <script type="text/javascript" src="static/js/cnLive_openinstall.js"></script> |
| 33 | - </head> | |
| 34 | - <body> | |
| 35 | - <div class="warpper"> | |
| 36 | - <div id="app"></div> | |
| 37 | - </div> | |
| 38 | - </body> | |
| 39 | -</html> | |
| 33 | + </head> | |
| 34 | + <body> | |
| 35 | + <div class="warpper"> | |
| 36 | + <div id="app"></div> | |
| 37 | + </div> | |
| 38 | + </body> | |
| 39 | +</html> | |
| 40 | 40 | \ No newline at end of file | ... | ... |
src/pages/common/common.vue
| ... | ... | @@ -116,7 +116,7 @@ |
| 116 | 116 | }, 100); |
| 117 | 117 | } |
| 118 | 118 | }, |
| 119 | - | |
| 119 | + | |
| 120 | 120 | /** |
| 121 | 121 | * 设置访问设备 |
| 122 | 122 | */ |
| ... | ... | @@ -285,11 +285,15 @@ |
| 285 | 285 | // 如果不在App内,未登录,调用mall项目登录页面 |
| 286 | 286 | } else { |
| 287 | 287 | |
| 288 | - // 设置跳转登录域名 | |
| 289 | - let loginUrl = (this.mode == "prod") ? "https://managemall.cnlive.com/html/mall/1/#/pages/users/login/login" : "https://wjjshop.cnlive.com/html/mall/1/#/pages/users/login/login"; | |
| 288 | + // 判断是否要调用App内登录,默认调用 | |
| 289 | + if (doLogin) { | |
| 290 | 290 | |
| 291 | - // 跳转mall项目登录 | |
| 292 | - window.location.href = loginUrl + "?processing=redirect&pages=" + encodeURIComponent(window.location.href); | |
| 291 | + // 设置跳转登录域名 | |
| 292 | + let loginUrl = (this.mode == "prod") ? "https://managemall.cnlive.com/html/mall/1/#/pages/users/login/login" : "https://wjjshop.cnlive.com/html/mall/1/#/pages/users/login/login"; | |
| 293 | + | |
| 294 | + // 跳转mall项目登录 | |
| 295 | + window.location.href = loginUrl + "?processing=redirect&pages=" + encodeURIComponent(window.location.href); | |
| 296 | + } | |
| 293 | 297 | |
| 294 | 298 | return false; |
| 295 | 299 | } | ... | ... |