|
@@ -84,7 +84,7 @@ const getNotice = [ |
|
@@ -84,7 +84,7 @@ const getNotice = [ |
84
|
|
84
|
|
85
|
export default {
|
85
|
export default {
|
86
|
// 支持值为 Object 和 Array
|
86
|
// 支持值为 Object 和 Array
|
87
|
- 'GET /api/currentUser': {
|
87
|
+ 'GET /api/BLOCK_NAME/currentUser': {
|
88
|
name: 'Serati Ma',
|
88
|
name: 'Serati Ma',
|
89
|
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
|
89
|
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
|
90
|
userid: '00000001',
|
90
|
userid: '00000001',
|
|
@@ -135,88 +135,4 @@ export default { |
|
@@ -135,88 +135,4 @@ export default { |
135
|
address: '西湖区工专路 77 号',
|
135
|
address: '西湖区工专路 77 号',
|
136
|
phone: '0752-268888888',
|
136
|
phone: '0752-268888888',
|
137
|
},
|
137
|
},
|
138
|
- // GET POST 可省略
|
|
|
139
|
- 'GET /api/users': [
|
|
|
140
|
- {
|
|
|
141
|
- key: '1',
|
|
|
142
|
- name: 'John Brown',
|
|
|
143
|
- age: 32,
|
|
|
144
|
- address: 'New York No. 1 Lake Park',
|
|
|
145
|
- },
|
|
|
146
|
- {
|
|
|
147
|
- key: '2',
|
|
|
148
|
- name: 'Jim Green',
|
|
|
149
|
- age: 42,
|
|
|
150
|
- address: 'London No. 1 Lake Park',
|
|
|
151
|
- },
|
|
|
152
|
- {
|
|
|
153
|
- key: '3',
|
|
|
154
|
- name: 'Joe Black',
|
|
|
155
|
- age: 32,
|
|
|
156
|
- address: 'Sidney No. 1 Lake Park',
|
|
|
157
|
- },
|
|
|
158
|
- ],
|
|
|
159
|
- 'POST /api/login/account': (req, res) => {
|
|
|
160
|
- const { password, userName, type } = req.body;
|
|
|
161
|
- if (password === 'ant.design' && userName === 'admin') {
|
|
|
162
|
- res.send({
|
|
|
163
|
- status: 'ok',
|
|
|
164
|
- type,
|
|
|
165
|
- currentAuthority: 'admin',
|
|
|
166
|
- });
|
|
|
167
|
- return;
|
|
|
168
|
- }
|
|
|
169
|
- if (password === 'ant.design' && userName === 'user') {
|
|
|
170
|
- res.send({
|
|
|
171
|
- status: 'ok',
|
|
|
172
|
- type,
|
|
|
173
|
- currentAuthority: 'user',
|
|
|
174
|
- });
|
|
|
175
|
- return;
|
|
|
176
|
- }
|
|
|
177
|
- res.send({
|
|
|
178
|
- status: 'error',
|
|
|
179
|
- type,
|
|
|
180
|
- currentAuthority: 'guest',
|
|
|
181
|
- });
|
|
|
182
|
- },
|
|
|
183
|
- 'POST /api/register': (req, res) => {
|
|
|
184
|
- res.send({ status: 'ok', currentAuthority: 'user' });
|
|
|
185
|
- },
|
|
|
186
|
- 'GET /api/500': (req, res) => {
|
|
|
187
|
- res.status(500).send({
|
|
|
188
|
- timestamp: 1513932555104,
|
|
|
189
|
- status: 500,
|
|
|
190
|
- error: 'error',
|
|
|
191
|
- message: 'error',
|
|
|
192
|
- path: '/base/category/list',
|
|
|
193
|
- });
|
|
|
194
|
- },
|
|
|
195
|
- 'GET /api/404': (req, res) => {
|
|
|
196
|
- res.status(404).send({
|
|
|
197
|
- timestamp: 1513932643431,
|
|
|
198
|
- status: 404,
|
|
|
199
|
- error: 'Not Found',
|
|
|
200
|
- message: 'No message available',
|
|
|
201
|
- path: '/base/category/list/2121212',
|
|
|
202
|
- });
|
|
|
203
|
- },
|
|
|
204
|
- 'GET /api/403': (req, res) => {
|
|
|
205
|
- res.status(403).send({
|
|
|
206
|
- timestamp: 1513932555104,
|
|
|
207
|
- status: 403,
|
|
|
208
|
- error: 'Unauthorized',
|
|
|
209
|
- message: 'Unauthorized',
|
|
|
210
|
- path: '/base/category/list',
|
|
|
211
|
- });
|
|
|
212
|
- },
|
|
|
213
|
- 'GET /api/401': (req, res) => {
|
|
|
214
|
- res.status(401).send({
|
|
|
215
|
- timestamp: 1513932555104,
|
|
|
216
|
- status: 401,
|
|
|
217
|
- error: 'Unauthorized',
|
|
|
218
|
- message: 'Unauthorized',
|
|
|
219
|
- path: '/base/category/list',
|
|
|
220
|
- });
|
|
|
221
|
- },
|
|
|
222
|
}; |
138
|
}; |