1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
import Vue from 'vue';
import {post,fetch,patch,put,del,upload} from './index'
const _baseUrl=process.env.API_URL;
Vue.prototype.$post=post;
Vue.prototype.$fetch=fetch;
Vue.prototype.$patch=patch;
Vue.prototype.$put=put;
Vue.prototype.$del=del;
Vue.prototype.$upload = upload;
//登录
const loginURL = `${_baseUrl}api/admin/login`;
export const loginApi = function(json) {
return Vue.prototype.$post(loginURL,{"username":json.username,"passwd":json.password})
};
//退出登录
const logOutUrl = `${_baseUrl}api/admin/logout`;
export const logoutApi = function() {
return Vue.prototype.$post(logOutUrl)
};
//查询账号列表
const getAdminListUrl = `${_baseUrl}api/admin/user/list`;
export const getAdminListApi = function () {
return Vue.prototype.$fetch(getAdminListUrl)
};
//修改账号信息
const editAdminUrl = `${_baseUrl}api/admin/user/info`;
export const editAdminListApi = function (id,json) {
return Vue.prototype.$put(`${editAdminUrl}/${id}`,json)
};
//添加账号
const addAdminUrl = `${_baseUrl}api/admin/user/add`;
export const addAdminListApi = function (json) {
return Vue.prototype.$post(addAdminUrl,json)
};
//删除账号
const delAdminUrl = `${_baseUrl}api/admin/user`;
export const delAdminListApi = function (id) {
return Vue.prototype.$del(`${delAdminUrl}/${id}`)
};
//修改密码
const editPasswordUrl = `${_baseUrl}api/admin/user/passwd`;
export const editPasswordApi = function (id,json) {
return Vue.prototype.$patch(`${editPasswordUrl}/${id}`,json)
};
//获取用户列表
const getUserListUrl = `${_baseUrl}api/admin/student/list`;
export const getUserListApi = function (json) {
return Vue.prototype.$fetch(getUserListUrl,json)
};
//获取用户详情
const getUserDetailUrl = `${_baseUrl}api/admin/student/info`;
export const getUserDetailApi = function (id) {
return Vue.prototype.$fetch(`${getUserDetailUrl}/${id}`)
};
//获取教师列表
const getTeacherListUrl = `${_baseUrl}api/admin/teacher/list`;
export const getTeacherListApi = function (json) {
return Vue.prototype.$fetch(`${getTeacherListUrl}`,json)
};
//获取教师详情
const getTeacherDetailUrl = `${_baseUrl}api/admin/teacher/info`;
export const getTeacherDetailApi = function (id) {
return Vue.prototype.$fetch(`${getTeacherDetailUrl}/${id}`)
};
//添加教师
const addTeacherUrl = `${_baseUrl}api/admin/teacher/add`;
export const addTeacherApi = function (json) {
return Vue.prototype.$post(addTeacherUrl,json)
};
//更新教师信息
const editTeacherUrl = `${_baseUrl}api/admin/teacher/info`;
export const editTeacherApi = function (id, json) {
return Vue.prototype.$put(`${editTeacherUrl}/${id}`,json)
};
//删除教师
const delTeacherUrl = `${_baseUrl}api/admin/teacher`;
export const delTeacherApi = function (id) {
return Vue.prototype.$del(`${delTeacherUrl}/${id}`)
};
//获取课程列表
const getLessonUrl = `${_baseUrl}api/admin/course/list`;
export const getLessonApi = function (json) {
return Vue.prototype.$fetch(getLessonUrl,json)
};
//获取课程详情
const getLessonDetailUrl = `${_baseUrl}api/admin/course/info`;
export const getLessonDetailApi = function (id, json) {
return Vue.prototype.$fetch(`${getLessonDetailUrl}/${id}`,json)
};
//编辑课程详情
const editLessonDetailUrl = `${_baseUrl}api/admin/course/info`;
export const editLessonApi = function (id,json) {
return Vue.prototype.$put(`${editLessonDetailUrl}/${id}`,json)
};
//删除课程
const deleteLessonUrl = `${_baseUrl}api/admin/course`;
export const deleteLessonAPI = function (id) {
return Vue.prototype.$del(`${deleteLessonUrl}/${id}`)
};
//新增课程
const addLessonUrl = `${_baseUrl}api/admin/course/add`;
export const addLessonApi = function (json) {
return Vue.prototype.$post(addLessonUrl,json)
};
//获取商品列表
const getGoodsListUrl = `${_baseUrl}api/admin/goods/list`;
export const getGoodsListApi = function (json) {
return Vue.prototype.$fetch(getGoodsListUrl,json)
};
//获取商品详情
const getGoodsDetailUrl = `${_baseUrl}api/admin/goods/info`;
export const getGoodsDetailApi = function (id, json) {
return Vue.prototype.$fetch(`${getGoodsDetailUrl}/${id}`,json)
};
//添加商品
const addGoodsUrl = `${_baseUrl}api/admin/goods/add`;
export const addGoodsApi = function (json) {
return Vue.prototype.$post(addGoodsUrl,json)
};
//编辑商品
const editGoodsUrl = `${_baseUrl}api/admin/goods/info`;
export const editGoodsApi = function (id, json) {
return Vue.prototype.$put(`${editGoodsUrl}/${id}`,json)
};
//删除商品
const deleteGoodsUrl = `${_baseUrl}api/admin/goods`;
export const deleteGoodsApi = function (id) {
return Vue.prototype.$del(`${deleteGoodsUrl}/${id}`)
};
// 商品上架
const upGoodsUrl = `${_baseUrl}api/admin/goods/putaway/`;
export const upGoodsApi = function (id) {
return Vue.prototype.$patch(`${upGoodsUrl}/${id}`)
};
// 商品下架
const downGoodsUrl = `${_baseUrl}api/admin/goods/soldout/`;
export const downGoodsApi = function (id) {
return Vue.prototype.$patch(`${downGoodsUrl}/${id}`)
};
//查询元素、菜单分类
const getCategoryUrl = `${_baseUrl}api/admin/category/list/0`;
export const getCategoryApi = function (pid) {
return Vue.prototype.$fetch(getCategoryUrl,{'pid':pid})
};
// 添加教材菜单
const addCategoryUrl = `${_baseUrl}api/admin/category/add/0`;
export const addCategoryApi = function (json) {
return Vue.prototype.$post(addCategoryUrl,json)
};
//删除分类
const delCategoryUrl = `${_baseUrl}api/admin/category`;
export const delCategoryApi = function (id) {
return Vue.prototype.$del(`${delCategoryUrl}/${id}`)
};
//分类排序修改
const sortCategoryUrl = `${_baseUrl}api/admin/category/sort`;
export const sortCategoryApi = function (json) {
return Vue.prototype.$patch(sortCategoryUrl,json)
};
//获取分类下的元素列表
const getCateDetailListUrl = `${_baseUrl}api/admin/element/list/0`;
export const getCateListApi = function (id) {
return Vue.prototype.$fetch(getCateDetailListUrl,id)
};
// 添加元素
const addElementUrl = `${_baseUrl}api/admin/element/add/`;
export const addElementApi = function (json, type) {
console.log(type)
return Vue.prototype.$post(`${addElementUrl}${type}`,json)
};
// 查询元素详情
const getElemenetDetailUrl = `${_baseUrl}api/admin/element/`;
export const getElemenetDetailApi = function (id) {
return Vue.prototype.$fetch(`${getElemenetDetailUrl}${id}`)
};
// 编辑元素
const editElementUrl = `${_baseUrl}api/admin/element/`;
export const editElementApi = function (json, id) {
return Vue.prototype.$put(`${editElementUrl}${id}`, json)
};
// 删除元素
const delElementUrl = `${_baseUrl}api/admin/element/`;
export const delElementApi = function (id) {
return Vue.prototype.$del(`${delElementUrl}${id}`)
}
// 获取单品列表
const getSingleListUrl = `${_baseUrl}api/admin/item/stock/list`;
export const getSingleListApi = function (json) {
return Vue.prototype.$fetch(`${getSingleListUrl}`,json)
};
// 获取单品详情
const getSingleDetailUrl = `${_baseUrl}api/admin/item/stock/info/`;
export const getSingleDetailApi = function (id) {
return Vue.prototype.$fetch(`${getSingleDetailUrl}${id}`)
};
// 删除单品
const delSingleUrl = `${_baseUrl}api/admin/item/stock/`;
export const delSingleApi = function (id) {
return Vue.prototype.$del(`${delSingleUrl}${id}`)
};
// 新增单品
const addSingleUrl = `${_baseUrl}api/admin/item/stock/add`;
export const addSingleApi = function (json) {
return Vue.prototype.$post(addSingleUrl,json)
};
// 修改单品
const editSingleUrl = `${_baseUrl}api/admin/item/stock/info/`;
export const editSingleApi = function (id,json) {
return Vue.prototype.$put(`${editSingleUrl}${id}`,json)
};
// 获取盒子分类
const getBoxTypeListUrl = `${_baseUrl}api/admin/category/list/1`;
export const getBoxTypeListApi = function () {
return Vue.prototype.$fetch(getBoxTypeListUrl)
};
// 获取盒子列表
const getBoxListUrl = `${_baseUrl}api/admin/item/box/list/`;
export const getBoxListApi = function (id) {
return Vue.prototype.$fetch(`${getBoxListUrl}${id}`)
};
// 添加盒子
const addBoxUrl = `${_baseUrl}api/admin/item/box/add/`;
export const addBoxApi = function (id, json) {
return Vue.prototype.$post(`${addBoxUrl}${id}`,json)
};
// 删除盒子
const delBoxUrl = `${_baseUrl}api/admin/item/box/`;
export const delBoxApi = function (id) {
return Vue.prototype.$del(`${delBoxUrl}${id}`)
};
// 获取盒子详情
const getBoxDetailUrl = `${_baseUrl}api/admin/item/box/info/`;
export const getBoxDetailApi = function (id) {
return Vue.prototype.$fetch(`${getBoxDetailUrl}${id}`)
};
// 更新盒子
const editBoxUrl = `${_baseUrl}api/admin/item/box/info/`;
export const editBoxApi = function (id, json) {
return Vue.prototype.$put(`${editBoxUrl}${id}`,json)
};
// 获取公众号菜单
const getPublicMenuUrl = `${_baseUrl}api/admin/open/menu`;
export const getPublicMenuApi = function () {
return Vue.prototype.$fetch(getPublicMenuUrl)
};
// 添加公众号菜单
export const savePublicMenuApi = function (json) {
return Vue.prototype.$post(getPublicMenuUrl,json)
};
// 获取配置列表
const getConfigListUrl = `${_baseUrl}api/admin/sys/config/list`;
export const getConfigListApi = function (json) {
return Vue.prototype.$fetch(getConfigListUrl, json)
};
// 新增系统配置
const saveConfigUrl = `${_baseUrl}api/admin/sys/config`;
export const saveConfigApi = function (json) {
return Vue.prototype.$post(saveConfigUrl, json)
};
// 更新关键词
const updateConfigUrl = `${_baseUrl}api/admin/sys/config`;
export const updateConfigApi = function (config_id,json) {
return Vue.prototype.$put(`${updateConfigUrl}/${config_id}`, json)
};
// 删除配置
const delConfigUrl = `${_baseUrl}api/admin/sys/config/`;
export const deleteConfigApi = function (config_id) {
return Vue.prototype.$del(`${delConfigUrl}${config_id}`)
};
// 获取配置详情
const getConfigDetailUrl = `${_baseUrl}api/admin/sys/config/`;
export const getConfigDetailApi = function (id) {
return Vue.prototype.$fetch(`${getConfigDetailUrl}${id}`)
};
// 获取素材列表
const getMediaListUrl = `${_baseUrl}api/admin/open/media/list`;
export const getMediaListApi = function (json) {
return Vue.prototype.$fetch(getMediaListUrl, json)
};
// 文件上传
const uploadFileUrl = `${_baseUrl}api/public/upload/zone`;
export const uploadFileApi = function (json) {
return Vue.prototype.$upload(uploadFileUrl,json)
};
// 获取菜单列表
const getMenuListUrl = `${_baseUrl}api/admin/category/list/2`;
export const getMenuListApi = function () {
return Vue.prototype.$fetch(`${getMenuListUrl}`)
};
// 新增菜单
const addMenuListUrl = `${_baseUrl}api/admin/category/add/2`;
export const saveMenuApi = function (json) {
return Vue.prototype.$post(addMenuListUrl, json)
};
// 更改菜单
const updateMenuUrl = `${_baseUrl}api/admin/category/`;
export const updateMenuApi = function (id,json) {
return Vue.prototype.$put(`${updateMenuUrl}${id}`, json)
};
// 删除菜单
export const delMenuApi = function (id) {
return Vue.prototype.$del(`${updateMenuUrl}${id}`)
};
// 获取权限列表
const getRoleListUrl = `${_baseUrl}api/admin/role/list`;
export const getRoleListApi = function (json) {
return Vue.prototype.$fetch(`${getRoleListUrl}`, json)
};
// 新增角色
const addRoleUrl = `${_baseUrl}api/admin/role/add`;
export const saveRoleApi = function (json) {
return Vue.prototype.$post(addRoleUrl, json)
};
// 更新权限
const updateRoleUrl = `${_baseUrl}api/admin/role/info/`;
export const updateRoleApi = function (id,json) {
return Vue.prototype.$put(`${updateRoleUrl}${id}`, json)
};
// 获取权限详情
export const getRoleDetailApi = function (id) {
return Vue.prototype.$fetch(`${updateRoleUrl}${id}`)
};
// 删除权限
const delRoleUrl = `${_baseUrl}api/admin/role/`;
export const delRoleApi = function (id) {
return Vue.prototype.$del(`${delRoleUrl}${id}`)
};
// 获取banner列表
const getBannerListUrl = `${_baseUrl}api/admin/banner/list`;
export const getBannerListApi = function () {
return Vue.prototype.$fetch(`${getBannerListUrl}`)
};
// 添加banner
const addBannerUrl = `${_baseUrl}api/admin/banner/add`;
export const addBannerApi = function (json) {
return Vue.prototype.$post(addBannerUrl, json)
};
// 编辑banner
const editBannerUrl = `${_baseUrl}api/admin/banner/info/`;
export const editBannerApi = function (id,json) {
return Vue.prototype.$put(`${editBannerUrl}${id}`, json)
};
// 获取banner详情
export const getBannerDetailApi = function (id) {
return Vue.prototype.$fetch(`${editBannerUrl}${id}`)
};
// 删除banner
const delBannerUrl = `${_baseUrl}api/admin/banner/`;
export const delBannerApi = function (id) {
return Vue.prototype.$del(`${delBannerUrl}${id}`)
};
// 移动顺序
const moveUrl = `${_baseUrl}api/admin/banner/sort`;
export const moveApi = function (upId, downId) {
return Vue.prototype.$patch(`${moveUrl}`, {banner_up_id: upId, banner_down_id: downId})
};
// 获取期数列表
const getPeriodsUrl = `${_baseUrl}api/admin/periods/list`;
export const getPeriodsApi = function (json) {
return Vue.prototype.$fetch(getPeriodsUrl,json)
};
// 添加期数
const getAddPeriodsUrl = `${_baseUrl}api/admin/periods/add/`;
export const getAddPeriodsApi = function (id,json) {
return Vue.prototype.$post(`${getAddPeriodsUrl}${id}`,json)
};
// 编辑期数
const getEditPeriodsUrl = `${_baseUrl}api/admin/periods/info/`;
export const getEditPeriodsApi = function (id,json) {
return Vue.prototype.$put(`${getEditPeriodsUrl}${id}`,json)
};
// 删除期数
const getDelPeriodUrl = `${_baseUrl}api/admin/periods/`;
export const delPeriodApi = function (id) {
return Vue.prototype.$del(`${getDelPeriodUrl}${id}`)
};
// 获取班级列表
const getClassListUrl = `${_baseUrl}api/admin/periods/class/list/`;
export const getClassListApi = function (id,json) {
return Vue.prototype.$fetch(`${getClassListUrl}${id}`,json)
};
// 获取当前期数下的老师列表
const getPeriodsTeacherUrl = `${_baseUrl}api/admin/periods/teacher/list/`;
export const getPeriodsTeacherApi = function (id) {
return Vue.prototype.$fetch(`${getPeriodsTeacherUrl}${id}`)
};
// 删除班级
const delClassUrl = `${_baseUrl}api/admin/periods/class/`;
export const delClassApi = function (id) {
return Vue.prototype.$del(`${delClassUrl}${id}`)
};
// 添加班级
const addClassUrl = `${_baseUrl}api/admin/periods/class/add/`;
export const addClassApi = function (id,json) {
return Vue.prototype.$post(`${addClassUrl}${id}`,json)
};
// 修改班级
const editClassUrl = `${_baseUrl}api/admin/periods/class/info/`;
export const editClassApi = function (id,json) {
return Vue.prototype.$put(`${editClassUrl}${id}`,json)
};
// 获取班级详情
const getClassDetailUrl = `${_baseUrl}api/admin/periods/class/info/`;
export const getClassDetailApi = function (id, json) {
return Vue.prototype.$fetch(`${getClassDetailUrl}${id}`,json)
};
// 获取班级用户列表
const getClassUserUrl = `${_baseUrl}api/admin/class/user/list/`;
export const getClassUserApi = function (id) {
return Vue.prototype.$fetch(`${getClassUserUrl}${id}`)
};
// 添加班级用户
const addClassUserUrl = `${_baseUrl}api/admin/class/user/add/`;
export const addClassUesrApi = function (classId, userId) {
return Vue.prototype.$post(`${addClassUserUrl}${classId}/${userId}`)
};
// 更改看课权限
const changeUserUrl = `${_baseUrl}api/admin/class/user/`;
export const changeUserApi = function (id,json) {
return Vue.prototype.$put(`${changeUserUrl}${id}`,json)
};
// 移除班级用户
const delClassUserUrl = `${_baseUrl}api/admin/class/user/`;
export const delClassUserApi = function (id) {
return Vue.prototype.$del(`${delClassUserUrl}${id}`)
};
// 获取订单列表
const getOrderListUrl = `${_baseUrl}api/admin/order/list`;
export const getOrderListApi = function () {
return Vue.prototype.$fetch(getOrderListUrl)
};
// 修改订单备注
const editOrderDescUrl = `${_baseUrl}api/admin/order/desc/`;
export const editOrderDescApi = function (orderId, type, json) {
return Vue.prototype.$put(`${editOrderDescUrl}${orderId}/${type}`, json)
};
// 给用户退款
const refundUrl = `${_baseUrl}api/admin/bill/refund/`;
export const refundApi = function (id, json) {
return Vue.prototype.$post(`${refundUrl}${id}`,json)
} ;
// 修改订单收货地址
const editAddressUrl = `${_baseUrl}api/admin/order/address/`;
export const editAddressApi = function (id,json) {
return Vue.prototype.$put(`${editAddressUrl}/${id}`,json)
};
// 提现审核
const withdrawUrl = `${_baseUrl}/api/admin/order/withdraw/`;
export const withdrawApi = function (id,json) {
return Vue.prototype.$post(`${withdrawUrl}${id}`,json)
};
// 退款列表
const getRefundListUrl = `${_baseUrl}api/admin/order/refund/list`;
export const getRefundListApi = function (json) {
return Vue.prototype.$fetch(`${getRefundListUrl}`,json)
};
// 提现列表
const getWithdrawListUrl = `${_baseUrl}api/admin/order/withdraw/list`;
export const getWithdrawListApi = function (json) {
return Vue.prototype.$fetch(`${getWithdrawListUrl}`,json)
};
// 新增盒子类型
const addBoxTypeUrl = `${_baseUrl}api/admin/category/add/1`;
export const addBoxTypeApi = function (json) {
return Vue.prototype.$post(addBoxTypeUrl, json)
};
//