Commit 478622e4 authored by 汪忙忙's avatar 汪忙忙

fix: tornado api

parent 18d5f686
import * as tb from './tb';
const { getAuthUserInfo } = tb;
var Buffer = require("buffer").Buffer
var crypto = require("crypto")
const request = ({ cloud, cloudName, requestType = 'cloud', mockUrl }) => {
console.log(2)
if (!cloud) {
console.error('请传入cloud');
return false;
......@@ -51,13 +52,13 @@ const request = ({ cloud, cloudName, requestType = 'cloud', mockUrl }) => {
console.log(`params_`, params_)
// nickName 转 md5 作为唯一的openId
if (!nickName) {
tbcc.tb.getAuthUserInfo().catch(err => {
return getAuthUserInfo().catch(err => {
console.log('未授权成功', err);
}).then(res => {
cb(res)
return cb(res)
})
}
// return cb({nickName: '卞龙亭'})
function cb({nickName}) {
if (!db || !proxyIp) {
my.confirm({
......@@ -112,7 +113,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud', mockUrl }) => {
if (res && res.success) {
resolve(res);
} else {
reject(res);
resolve(res);
// reject(res);
}
}).catch(() => {
hideMyLoading();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment