💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
~~~ class HTTP { request(param) { //param是一个对象,包含url,data,method,success if (!param.method) { param.method = "GET"; } wx.request({ url: param.url, data: param.data, method: param.method, header: { 'Content-Type': 'application/json', "appkey": config.appkey }, success: function (res) { let code = res.statusCode.toString(); if (code.startsWith("2")) { param.success(res.data); } else { wx.showToast({ title: '网络错误', icon: 'none' }) } }, fail: function () { wx.showToast({ title: '网络错误', icon: 'none' }) } }) } } ~~~