Ver Fonte

微信登录优化3

chao há 4 anos atrás
pai
commit
a1daacff1b

+ 0 - 15
src/main/resources/static/js/base.js

@@ -11,21 +11,6 @@ if(localStorage.getItem('userInfo')){
     GLOBAL_USER_ID = globalUserData.userId*1;
     GLOBAL_USER_IDENTITY = globalUserData.userIdentity*1;
     GLOBAL_SHOP_ID = globalUserData.shopId*1;
-} else {
-    if(Number(getBaseCookie("weChatAutoLogin"))!==1){
-        var userAgent = navigator.userAgent.toLowerCase();
-        if (userAgent.match(/MicroMessenger/i)) {
-            // 微信浏览器自动授权登录
-            var urlForWeChat = 'https://www.caimei365.com/we_chat/redirect_uri.html';
-            $.get(spiServer+'/user/authorizationLink?redirectUri='+urlForWeChat, function(r){
-                if(r.code===0 && r.data){
-                    setBaseCookie("loginBeforePath", window.location.href);
-                    setBaseCookie("weChatAutoLogin", 1);
-                    window.location.href = r.data;
-                }
-            });
-        }
-    }
 }
 // 头部
 var globalHead = new Vue({

+ 0 - 22
src/main/resources/static/js/error/404.js

@@ -1,22 +0,0 @@
-var errorPage = new Vue({
-    el: "#errorPage",
-    data: {
-        errorDatas: []
-    },
-    methods: {
-        getErrorData: function () {
-            var _self = this;
-            $.getJSON("https://api.isoyu.com/gy/").done(function (r) {
-                _self.errorDatas = r;
-            });
-        },
-
-    },
-    created: function () {
-        // 获取列表数据
-        this.getErrorData();
-    },
-    mounted: function () {
-        var _self = this;
-    }
-});

+ 0 - 1
src/main/resources/templates/error/404.html

@@ -19,7 +19,6 @@
 <!-- 引入底部 -->
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/error/404.js(v=${version})}"></script>
 <script type="text/javascript" src="//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js" charset="utf-8" homePageUrl="/" homePageName="返回首页"></script>
 </body>
 </html>

+ 2 - 0
src/main/resources/templates/we_chat/redirect_uri.html

@@ -4,6 +4,8 @@
 <head>
     <meta charset="UTF-8">
     <title>微信授权</title>
+    <input type="hidden" th:value="${spiServer}" id="spiServer">
+    <input type="hidden" th:value="${agent}" id="userAgent">
 </head>
 <body>
 <template th:replace="components/foot-link"></template>