cloudfunctions/ClearingRedundantFolders/node_modules/@cloudbase/node-sdk/src/utils/dbRequest.ts
(完整代码) 861Bimport httpRequest from './httpRequest'
import { ICustomReqOpts } from '../type'
/**
* 数据库模块的通用请求方法
*
* @author haroldhu
* @internal
*/
export class DBRequest {
private config: any
/**
* 初始化
*
* @internal
* @param config
*/
public constructor(config) {
this.config = config
}
/**
* 发送请求
*
* @param dbParams - 数据库请求参数
* @param opts - 可选配置项
*/
public async send(api: string, data: any, opts?: ICustomReqOpts): Promise<any> {
const params = { ...data, action: api }
return httpRequest({
config: this.config,
params,
method: 'post',
opts,
headers: {
'content-type': 'application/json'
}
})
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
