cloudfunctions/ClearingRedundantFolders/node_modules/tcb-admin-node/src/utils/dbRequest.js
(完整代码) 696Bconst httpRequest = require('./httpRequest')
/**
* 数据库模块的通用请求方法
*
* @author haroldhu
* @internal
*/
class Request {
/**
* 初始化
*
* @internal
* @param config
*/
constructor(config) {
this.config = config
}
/**
* 发送请求
*
* @param api - 接口
* @param data - 参数
*/
async send(api, data) {
const params = Object.assign({}, data, {
action: api
})
return await httpRequest({
timeout: this.config.timeout,
config: this.config.config,
params,
method: 'post',
headers: {
'content-type': 'application/json'
}
})
}
}
module.exports = Request
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
