重构了云函数
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { get } from "http";
|
||||
|
||||
export type CloudReturnType<T = any> = {
|
||||
code: number,// 200成功
|
||||
msg?:string,
|
||||
@@ -81,4 +83,12 @@ export class WxCloudApi{
|
||||
}
|
||||
});
|
||||
}
|
||||
public static async get(): Promise<CloudCallFunctionResult<CloudReturnType<{}>>> {
|
||||
return await wx?.cloud.callFunction({
|
||||
name: 'cocos_cloud',
|
||||
data: {
|
||||
cmd: 'get',
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user