Skip to content

Commit a4725fc

Browse files
committed
🐛 修复生产环境mock接口失效问题
1 parent 2203753 commit a4725fc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

api/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,32 @@ app.get("/vue3*", (req, res) => {
1919
res.sendFile(join(__dirname, "..", "dist", "vue3"));
2020
});
2121

22+
app.get("/apiReact/*", (req, res)=>{
23+
res.json({
24+
code: 200,
25+
message: "请求成功!",
26+
data: {
27+
name: "baize-team",
28+
type: "来自React中模拟的数据",
29+
projectName: "baize-quick-study",
30+
desc: "为各位有React或者Vue基础的同学,快速学习未掌握的React或者Vue框架",
31+
},
32+
})
33+
})
34+
35+
app.get("/apiVue/*", (req, res)=>{
36+
res.json({
37+
code: 200,
38+
message: "请求成功!",
39+
data: {
40+
name: "baize-team",
41+
type: "来自Vue中模拟的数据",
42+
projectName: "baize-quick-study",
43+
desc: "为各位有React或者Vue基础的同学,快速学习未掌握的React或者Vue框架",
44+
},
45+
})
46+
})
47+
2248
app.get("/*", (req, res) => {
2349
res.sendFile(join(__dirname, "..", "dist", "main", "index.html"));
2450
});

0 commit comments

Comments
 (0)