喻文俊 %!s(int64=3) %!d(string=hai) anos
pai
achega
81d6b0595c

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

@@ -1,5 +1,4 @@
 var coreServer = $("#coreServer").val();
-var spiServer = $("#spiServer").val();
 var isPC = ($(window).width()>768);
 var globalUserData = '';
 var GLOBAL_TOKEN = 'X-Token';
@@ -573,35 +572,6 @@ function updateUrlParam(params) {
     }
 }
 
-function tokenAjax(type, url, params, callback, errorBack){
-    $.ajax({
-        type: type,
-        url: spiServer + url,
-        xhrFields: {
-            withCredentials: true
-        },
-        data: params,
-        headers:{
-            'Content-Type': type=='post'?'application/x-www-form-urlencoded':'application/json;charset=utf8',
-            'X-Token':GLOBAL_TOKEN
-        },
-        success : function (res) {
-            if(res.code === -99){
-                localStorage.removeItem('userInfo');
-                delBaseCookie("loginBeforePath");
-                // window.location.href ='/login.html';
-            }else{
-                callback(res);
-            }
-        },
-        error : function (res) {
-           alertInfo("网络连接超时,请重试!",function (res) {
-               console.log(res)
-           });
-        }
-    });
-}
-
 function setSearchProductList(list, userId, callback) {//处理搜索
     var productIdArr = [];
     var resultData = [];
@@ -790,43 +760,3 @@ function dialog(txt,callback) {
     });
 }
 
-// 加入购物车
-function addShoppingCart(userId, productId, count, callback){
-    tokenAjax("post", "/shoppingCart/addCart", {
-        userID: userId,
-        productID: productId,
-        productCount: count
-    },function (res) {
-        if(res && res.code*1 === 0){
-            globalHead.getHeadCart(userId);
-            $.confirm({
-                useBootstrap: false,
-                boxWidth: (isPC?'338px':'74.6vw'),
-                title: false,
-                content:'<div class="cartAlert"><h6>商品已成功加入购物车!</h6><p>当前购物车共<em>'+res.data+'</em>种商品</p></div>',
-                closeIcon: true,
-                animation: 'opacity',
-                closeAnimation: 'opacity',
-                animateFromElement: false,
-                scrollToPreviousElement: false,
-                buttons: {
-                    login: {
-                        text: '去结算',
-                        btnClass: 'btn-to-cart',
-                        action: function(){
-                            window.location.href = '/shopping/cart.html';
-                        }
-                    },
-                    close: {
-                        text: '继续购物',
-                        btnClass: 'btn-to-goon',
-                        action: callback?callback():function(){}
-                    }
-                }
-            });
-        } else {
-            dialog("加入购物车失败!");
-        }
-    });
-}
-

+ 0 - 1
src/main/resources/static/js/document/base.js

@@ -1,4 +1,3 @@
-var spiServer = $("#spiServer").val();
 var isPC = ($(window).width()>768);
 /** 表单输入框校验 */
 function verifyHandle(obj){

+ 1 - 1
src/main/resources/static/js/single-page/live.js

@@ -50,7 +50,7 @@ var livePage = new Vue({
         },
         getLiveArticle: function(){
             var _self = this;
-            $.getJSON(coreServer+"/search/query/article/type" ,{
+            $.getJSON(coreServer+"/commodity/search/query/article/type" ,{
                 id: 8,
                 pageSize: 4,
                 pageNum: 1

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

@@ -89,7 +89,7 @@
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
 <script type="text/javascript">
-    if(!($('#spiServer').val() && $('#spiServer').val().length>0)){
+    if(!($('#coreServer').val() && $('#coreServer').val().length>0)){
         window.location.href = '/404.html';
     }
 </script>