|
@@ -17,20 +17,12 @@ const $api = {
|
17
|
17
|
update: {
|
18
|
18
|
method: 'PUT',
|
19
|
19
|
url: `${BaseAPIURl}wx/user`
|
20
|
|
- },
|
21
|
|
- appointment: {
|
22
|
|
- method: 'GET',
|
23
|
|
- url: `${BaseAPIURl}wx/appointment/:openid`
|
24
|
|
- },
|
25
|
|
- delAppointment: {
|
26
|
|
- method: 'DELETE',
|
27
|
|
- url: `${BaseAPIURl}wx/appointment/of/:id`
|
28
|
20
|
}
|
29
|
21
|
},
|
30
|
22
|
dict: {
|
31
|
23
|
list: {
|
32
|
24
|
methods: 'GET',
|
33
|
|
- url: `${BaseAPIURl}dict`
|
|
25
|
+ url: `${BaseAPIURl}/dict`
|
34
|
26
|
}
|
35
|
27
|
},
|
36
|
28
|
banner: {
|
|
@@ -46,7 +38,7 @@ const $api = {
|
46
|
38
|
},
|
47
|
39
|
detail: {
|
48
|
40
|
method: 'GET',
|
49
|
|
- url: `${BaseAPIURl}wx/buildingSelectId/:id`
|
|
41
|
+ url: `${BaseAPIURl}/wx/buildingSelectId/:id`
|
50
|
42
|
}
|
51
|
43
|
},
|
52
|
44
|
dynamic: { // 项目
|
|
@@ -72,25 +64,31 @@ const $api = {
|
72
|
64
|
appointment: {
|
73
|
65
|
getByUser: {
|
74
|
66
|
method: 'GET',
|
75
|
|
- url: `${BaseAPIURl}wx/appointment/:openid`
|
|
67
|
+ url: `${BaseAPIURl}/wx/appointment/:openid`
|
76
|
68
|
},
|
77
|
69
|
save: {
|
78
|
70
|
method: 'POST',
|
79
|
|
- url: `${BaseAPIURl}wx/appointment/:openid`
|
|
71
|
+ url: `${BaseAPIURl}/wx/appointment/:openid`
|
80
|
72
|
}
|
81
|
73
|
},
|
82
|
74
|
collection: {
|
83
|
75
|
getByUser: {
|
84
|
76
|
method: 'GET',
|
85
|
|
- url: `${BaseAPIURl}wx/collection/:openid`
|
|
77
|
+ url: `${BaseAPIURl}/wx/collection/:openid`
|
86
|
78
|
},
|
87
|
79
|
save: {
|
88
|
80
|
method: 'POST',
|
89
|
|
- url: `${BaseAPIURl}wx/collection/:openid`
|
|
81
|
+ url: `${BaseAPIURl}/wx/collection/:openid`
|
90
|
82
|
},
|
91
|
83
|
deleteById: {
|
92
|
84
|
method: 'DELETE',
|
93
|
|
- url: `${BaseAPIURl}wx/collection/:openid`
|
|
85
|
+ url: `${BaseAPIURl}/wx/collection/:openid`
|
|
86
|
+ }
|
|
87
|
+ },
|
|
88
|
+ comment: {
|
|
89
|
+ list: { // 评论列表
|
|
90
|
+ methods: 'GET',
|
|
91
|
+ url: `${BaseAPIURl}/wx/comment/list`
|
94
|
92
|
}
|
95
|
93
|
}
|
96
|
94
|
}
|
|
@@ -98,9 +96,9 @@ const $api = {
|
98
|
96
|
const hasKey = (o, k) => Object.keys(o).indexOf(k) > -1
|
99
|
97
|
|
100
|
98
|
// 获取 api 支持 a.b.c 字符串格式
|
101
|
|
-function get(k = '', urlParams = {}) {
|
|
99
|
+function get(k = '') {
|
102
|
100
|
let found = true
|
103
|
|
- const api = k.split('.').reduce((acc, key) => {
|
|
101
|
+ return k.split('.').reduce((acc, key) => {
|
104
|
102
|
if (!found) return acc;
|
105
|
103
|
|
106
|
104
|
if (acc === 0) {
|
|
@@ -118,27 +116,10 @@ function get(k = '', urlParams = {}) {
|
118
|
116
|
return acc
|
119
|
117
|
}
|
120
|
118
|
}
|
121
|
|
-<<<<<<< HEAD
|
122
|
|
- },
|
123
|
|
- comment: {
|
124
|
|
- list: { // 评论列表
|
125
|
|
- methods: 'GET',
|
126
|
|
- url: `${BaseAPIURl}/wx/comment/list`
|
127
|
|
- }
|
128
|
|
-=======
|
129
|
119
|
}, 0)
|
130
|
|
-
|
131
|
|
- return {
|
132
|
|
- ...api,
|
133
|
|
- url: api.url.split('/').map((item) => {
|
134
|
|
- const key = item.replace(':', '')
|
135
|
|
- return item !== 'https:' && hasKey(urlParams, key) ? urlParams[key] : item
|
136
|
|
- }).join('/')
|
137
|
|
->>>>>>> 654f865abc085b939a020914c39080d00a3ad02a
|
138
|
|
- }
|
139
|
120
|
}
|
140
|
121
|
|
141
|
122
|
module.exports = {
|
142
|
123
|
$api: $api,
|
143
|
124
|
get: get,
|
144
|
|
-}
|
|
125
|
+}
|