1 Star 0 Fork 0

Hyinglin/axios封装请求拦截器和响应拦截器

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.js 4.03 KB
一键复制 编辑 原始数据 按行查看 历史
import ajax from './axios';
let api = {
user: {
list: param => {
return ajax.post('user/list', param);
},
info: id => {
return ajax.post('user/info', id);
},
insert: param => {
return ajax.post('user/insert', param);
},
delete: id => {
return ajax.post('user/delete', id);
},
update: param => {
return ajax.post('user/update', param);
},
changeStatus: id => {
return ajax.post('user/changeStatus', id);
},
},
category: {
list: param => {
return ajax.post('category/list', param);
},
treeList: () => {
return ajax.post('category/treelist');
},
htmlList: () => {
return ajax.post('category/htmllist');
},
detail: id => {
return ajax.post('category/info', id);
},
insert: param => {
return ajax.post('category/insert', param);
},
delete: id => {
return ajax.post('category/delete', id);
},
update: param => {
return ajax.post('category/update', param);
},
},
goods: {
list: param => {
return ajax.post('goods/list', param);
},
detail: id => {
return ajax.post('goods/detail', id);
},
insert: param => {
return ajax.post('goods/insert', param);
},
delete: id => {
return ajax.post('goods/delete', id);
},
update: param => {
return ajax.post('goods/update', param);
},
changeStatus: id => {
return ajax.post('goods/changeStatus', id);
}
},
comment: {
list: param => {
return ajax.post('comment/list', param);
},
delete: id => {
return ajax.post('comment/delete', id);
},
},
order: {
list: param => {
return ajax.post('order/list', param);
},
info: id => {
return ajax.post('order/info', id);
},
delete: id => {
return ajax.post('order/delete', id);
},
changeStatus: param => {
return ajax.post('order/changeStatus', param);
}
},
advert: {
list: param => {
return ajax.post('advert/list', param);
},
detail: id => {
return ajax.post('advert/info', id);
},
insert: param => {
return ajax.post('advert/insert', param);
},
delete: id => {
return ajax.post('advert/delete', id);
},
update: param => {
return ajax.post('advert/update', param);
},
},
system: {
list: param => {
return ajax.post('system/list', param);
},
detail: id => {
return ajax.post('system/info', id);
},
insert: param => {
return ajax.post('system/insert', param);
},
delete: id => {
return ajax.post('system/delete', id);
},
update: param => {
return ajax.post('system/update', param);
},
show: id => {
return ajax.post('system/show', id);
},
getHeader: () => {
return ajax.post('system/getHeader');
}
},
common: {
login: param => {
return ajax.post('common/login', param);
},
loginInfo: () => {
return ajax.post('common/loginInfo');
},
out: () => {
return ajax.post('common/out');
},
changePass: param => {
return ajax.post('common/changePass', param);
}
},
};
export default {
install: Vue => {
Vue.api = api,
Vue.prototype.$api = api
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/heyinglin/axios.git
git@gitee.com:heyinglin/axios.git
heyinglin
axios
axios封装请求拦截器和响应拦截器
master

搜索帮助