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 Buffer = require("buffer").Buffer
var crypto = require("crypto") var crypto = require("crypto")
const request = ({ cloud, cloudName, requestType = 'cloud', mockUrl }) => { const request = ({ cloud, cloudName, requestType = 'cloud', mockUrl }) => {
console.log(2)
if (!cloud) { if (!cloud) {
console.error('请传入cloud'); console.error('请传入cloud');
return false; return false;
...@@ -51,13 +52,13 @@ const request = ({ cloud, cloudName, requestType = 'cloud', mockUrl }) => { ...@@ -51,13 +52,13 @@ const request = ({ cloud, cloudName, requestType = 'cloud', mockUrl }) => {
console.log(`params_`, params_) console.log(`params_`, params_)
// nickName 转 md5 作为唯一的openId // nickName 转 md5 作为唯一的openId
if (!nickName) { if (!nickName) {
tbcc.tb.getAuthUserInfo().catch(err => { return getAuthUserInfo().catch(err => {
console.log('未授权成功', err); console.log('未授权成功', err);
}).then(res => { }).then(res => {
cb(res) return cb(res)
}) })
} }
// return cb({nickName: '卞龙亭'})
function cb({nickName}) { function cb({nickName}) {
if (!db || !proxyIp) { if (!db || !proxyIp) {
my.confirm({ my.confirm({
...@@ -112,7 +113,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud', mockUrl }) => { ...@@ -112,7 +113,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud', mockUrl }) => {
if (res && res.success) { if (res && res.success) {
resolve(res); resolve(res);
} else { } else {
reject(res); resolve(res);
// reject(res);
} }
}).catch(() => { }).catch(() => {
hideMyLoading(); 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