张延森 4 年之前
父節點
當前提交
4e0d6bf877
共有 3 個文件被更改,包括 4 次插入2 次删除
  1. 1
    0
      config/dev.js
  2. 1
    0
      config/prod.js
  3. 2
    2
      src/util/PublicMethod/index.js

+ 1
- 0
config/dev.js 查看文件

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
+    SERVER_API: '"https://dev.fangdeal.cn/liyuanhui/api/wx"'
6
   },
7
   },
7
   mini: {},
8
   mini: {},
8
   h5: {}
9
   h5: {}

+ 1
- 0
config/prod.js 查看文件

3
     NODE_ENV: '"production"'
3
     NODE_ENV: '"production"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
+    SERVER_API: '"https://dev.fangdeal.cn/liyuanhui/api/wx"'
6
   },
7
   },
7
   mini: {},
8
   mini: {},
8
   h5: {
9
   h5: {

+ 2
- 2
src/util/PublicMethod/index.js 查看文件

39
       Header['X-Authorization-Jwt'] = wx.getStorageSync('token')
39
       Header['X-Authorization-Jwt'] = wx.getStorageSync('token')
40
     }
40
     }
41
     wx.request({
41
     wx.request({
42
-      url: `https://dev.fangdeal.cn/liyuanhui/wx${config.url}`,
42
+      url: `${SERVER_API}${config.url}`,
43
       method: config.method,
43
       method: config.method,
44
       ...(config.data || {}),
44
       ...(config.data || {}),
45
       header: { ...Header },
45
       header: { ...Header },
51
           wx.login({ // 微信获取code
51
           wx.login({ // 微信获取code
52
             success (subRes) {
52
             success (subRes) {
53
               wx.request({ // 登录获取token
53
               wx.request({ // 登录获取token
54
-                url: `https://dev.fangdeal.cn/liyuanhui/wx/login?code=${subRes.code}`,
54
+                url: `${SERVER_API}/login?code=${subRes.code}`,
55
                 method: `post`,
55
                 method: `post`,
56
                 success: (cRes) => {
56
                 success: (cRes) => {
57
                   if (cRes.header['X-Authorization-Jwt'] !== undefined) { // 更新本地存储token
57
                   if (cRes.header['X-Authorization-Jwt'] !== undefined) { // 更新本地存储token