-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathasync.api.js
52 lines (50 loc) · 1.66 KB
/
async.api.js
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
module.exports = {
'post /store/admin/login/check': function(req, res) {
res.json({message: "", result: true, code: 200});
},
'get /cartlist': function(req, res) {
setTimeout(function(){
res.json(
{
code : 200,
totalcost : 2333,
productcost : 1234,
deliverycost : 33,
shoppingList : [
{
pid:1,
titleimg : "../../res/images/default.png",
title : "阿基米德",
amount : 2,
unitprice : 66,
subtotal : 132
},
{
pid:2,
titleimg : "../../res/images/default.png",
title : "阿基米德",
amount : 2,
unitprice : 66,
subtotal : 132
}
]
}
)
},2000);
},
'get /emptycart': function(req, res) {
setTimeout(function(){
res.json({"code":200, "message":"success"});
},2000);
/* if(req.body.username.length > 0 && req.body.password.length > 0) {
res.json({"code":200, "message":"success"});
} else {
res.json({"code":400, "message":"参数错误"});
}*/
},
'post /submitorder': function(req, res) {
setTimeout(function(){
res.json({"code":200, "message":"success"});
},2000);
}
};