123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- function customSQL(sql, type) {
- let promise = new Promise((res, rej) => {
- wx.request({
- url: "https://server.fmode.cn/api/novaql/select",
- data: {
- sql: sql,
- },
- method: "POST",
- success(success) {
- res(success.data.data);
- },
- fail(err) {
- rej(err);
- },
- });
- });
- return promise;
- }
- function getPhone(code) {
- return new Promise((res) => {
- wx.request({
- url: 'https://server.fmode.cn/api/wxapp/decrypt_phone',
- data: {
- code: code,
- companyId: getApp().globalData.company
- },
- header: {
- 'content-type': 'application/json'
- },
- method: 'GET',
- success: (result) => {
- if (result.data.code == 0 && result.data.data && result.data.data.phoneNumber) {
- console.log(result.data.data.phoneNumber)
- res(result.data.data.phoneNumber)
- } else {
- wx.showToast({
- title: '手机号获取失败',
- icon: 'error',
- image: '',
- duration: 1500,
- mask: false,
- });
- res()
- }
- },
- fail: () => {
- wx.showToast({
- title: '手机号获取失败',
- icon: 'error',
- image: '',
- duration: 1500,
- mask: false,
- });
- res()
- },
- complete: () => {
- }
- });
- })
- }
- module.exports = {
- customSQL,
- getPhone
- };
|