feat: 本地fastapi调试

This commit is contained in:
eric
2022-12-18 17:16:56 +08:00
parent 91baccc9cb
commit 14b09099e5
5 changed files with 16 additions and 4 deletions

View File

@@ -0,0 +1 @@
{"containers":[],"config":{}}

2
dist/common.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -98,12 +98,23 @@ const Home = () => {
// 云托管测试
const testCloud = async () => {
const res = await cloudcall({
path:'/feishu'
path:'/feishu',
method:'GET'
})
console.log('业务返回结果',res)
};
// 云托管本地测试
const testPost = async () => {
const res = await cloudcall({
path:'/nihao',
method:'POST'
})
console.log('业务返回结果',res)
};
useEffect(() => {
// testCloud();
// testPost()
}, []);
useEffect(() => {

View File

@@ -263,7 +263,7 @@ export const cloudcall = async (obj: any, number = 0) => {
method: obj.method || "GET", // 按照自己的业务开发,选择对应的方法
// dataType:'text', // 如果返回的不是 json 格式,需要添加此项
header: {
"X-WX-SERVICE": "fastapi", // xxx中填入服务名称微信云托管 - 服务管理 - 服务列表 - 服务名称)
"X-WX-SERVICE": "fastapiweb", // xxx中填入服务名称微信云托管 - 服务管理 - 服务列表 - 服务名称)
// 其他 header 参数
},
// 其余参数同 wx.request