企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
### showSuccess() <br> 用于返回成功状态下的JSON格式数据,可以传入三个参数 * data 实际的数据体 * msg 状态消息 * code 消息码 * statusCode 状态码 默认: ``` (data = [],msg = 'ok',code = 200,statusCode = 200) ``` 示例: ``` const Controller = require('think-js-lib').Controller class HelloController extends Controller{ sayHello(){ let result = [ { name: '无穷369', title: '全栈工程师', blog: 'https://www.zhangyubk.com' } ] return this.showSuccess(result) } } ``` 返回: ``` { "msg": "ok", "code": 200, "data": [ { "name": "无穷369", "title": "全栈工程师", "blog": "https://www.zhangyubk.com" } ] } ```