فهرست منبع

3.0.2 请求头取消 cookie

杨志杰 3 سال پیش
والد
کامیت
8713f2166c
3فایلهای تغییر یافته به همراه8 افزوده شده و 18 حذف شده
  1. 5 0
      bat/publish.bat
  2. 1 1
      package.json
  3. 2 17
      src/common/Common.js

+ 5 - 0
bat/publish.bat

@@ -0,0 +1,5 @@
+set current_path="%~dp0"
+cd %current_path%
+cd ..
+npm publish --registry http://wuzhixin.vip:4873/
+pause

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
-  "version": "3.0.1",
+  "version": "3.0.2",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",

+ 2 - 17
src/common/Common.js

@@ -274,23 +274,8 @@ export default {
 
   // 给请求头中加上account和token信息
   addTokenToRequest: function (request) {
-    var token = $.cookie('token');
-    var account = $.cookie('accountId');
-    if (token == undefined) {
-      var localStorageToken = localStorage.getItem('#token');
-      if (localStorageToken != undefined) {
-        token = localStorageToken;
-      }
-    }
-    if (account == undefined) {
-      var localStorageAccount = localStorage.getItem('#accountId');
-      if (localStorageAccount != undefined) {
-        account = localStorageAccount;
-      }
-    }
-    request.setRequestHeader('#accountId', account);
-    request.setRequestHeader('token', token);
-
+    // request.setRequestHeader('#accountId', localStorage.getItem('#accountId'));
+    request.setRequestHeader('token', localStorage.getItem('#token'));
   },
 
   /**