first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
class CarService {
}

View File

@@ -0,0 +1,34 @@
class HomeService {
async index(data = {}) {
return await $get({
url: Config.ApiList.index,
data: data
});
}
async class(data = {}) {
var data = await $get({
url: Config.ApiList.class,
data: data
});
data.forEach(v => {
v.page = 0;
v.content = [];
v.totalPage = 0;
});
return data;
}
async classList(data = {}) {
return await $get({
url: Config.ApiList.classList,
data: data
});
}
}
var homeService = new HomeService();

View File

@@ -0,0 +1,11 @@
class InfoService {
async info(data = {}) {
return await $get({
url: Config.ApiList.info,
data: data
});
}
}
var infoService = new InfoService();

View File

@@ -0,0 +1,14 @@
1:页面调用 service 中的方法
service 中的方法调用 ajax,来发送请求
2:ajax把数据给service的方法,service可以对数据进行各种
业务上的处理
3:处理好后给页面使用
如何拿到异步函数的返回数值
1:callback
2:Promise