feat: 本地fastapi调试
This commit is contained in:
1
.cloudbase/container/debug.json
Normal file
1
.cloudbase/container/debug.json
Normal file
@@ -0,0 +1 @@
|
||||
{"containers":[],"config":{}}
|
||||
2
dist/common.js
vendored
2
dist/common.js
vendored
File diff suppressed because one or more lines are too long
2
dist/pages/home/index.js
vendored
2
dist/pages/home/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -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(() => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user