miniQRCodeRoute.js 692 Bytes

import Promise from '../vendors/es6-promise';
import api from '../common/api.js';
import config from '../config';

function getQRCodeSource(code) {
  return new Promise(function (resolve, reject) {
    let param = {
      params: {
        md5Param: code,
        miniapp_type: config.mini_app_type
      },
      url: config.domains.api +'/wechat/miniapp/getMiniAppRealParam'
    }

    api.get(param)
      .then(data => {
        if (data.code == 200) {
          if(data.data){
            resolve(JSON.parse(data.data));
          }
        }else {
          reject(null);
        }
      })
      .catch(error => {
        reject(error);
      });
  })
}

export {
  getQRCodeSource,
}