sys 2 lat temu
rodzic
commit
57068d002a
2 zmienionych plików z 21 dodań i 2 usunięć
  1. 4 2
      service/ajax.js
  2. 17 0
      service/tools.js

+ 4 - 2
service/ajax.js

@@ -1,6 +1,9 @@
 import tools from "@/service/tools";
 import store from '@/store'
-let BASE_URL ='https://' + process.uniEnv.baseUrl;
+let BASE_URL =''
+//#ifdef APP-PLUS
+BASE_URL ='https://' + process.uniEnv.baseUrl;
+//#endif
 
 
 /**
@@ -25,7 +28,6 @@ export const request = (url, method, data, show = false) => {
       method: method || 'post',
       header: {
         'content-type': 'application/json',
-        'apikey': '01ABA77B8BA6F26243D85B5A50FFB88624951C7B3A4078B3F9971983E667D5B8',
         'hversion': '1.0',
         'Authorization': token
       },

+ 17 - 0
service/tools.js

@@ -208,5 +208,22 @@ tools.getPlatform = function () {
 
 }
 
+/**
+ * 记录用户登录信息
+ * @param data
+ * @param type
+ */
+tools.setLoginData = function (data) {
+    uni.setStorageSync('m_id', data.m_id)
+    uni.setStorageSync('token', data.token)
+    tools.success('登陆成功')
+    setTimeout(() => {
+        uni.reLaunch({
+            url: '/pages/index/index'
+        });
+    }, 1500)
+
+}
+
 
 export default tools