request.js 388 B

12345678910111213141516171819202122
  1. function customSQL(sql, type) {
  2. let promise = new Promise((res, rej) => {
  3. wx.request({
  4. url: "https://server.fmode.cn/api/novaql/select",
  5. data: {
  6. sql,
  7. },
  8. method: "POST",
  9. success(success) {
  10. res(success.data.data);
  11. },
  12. fail(err) {
  13. rej(err);
  14. },
  15. });
  16. });
  17. return promise;
  18. }
  19. module.exports = {
  20. customSQL,
  21. };