Commit c27bcea7 by linboxuan

ucommune usertoken register

parent db68aa54
......@@ -29,13 +29,13 @@ class UtilsUcommuneService extends AppServiceBase {
let result = await this.restPostWithHAuthorizationUrl(pobj, actionBody.userToken, url);
if(result.retCode == 0) { // 0成功 1失败
pobj.actionType = "getLoginByUserName";
pobj.actionBody.channelUserId = result.data.nationalCode + result.data.mobile; // 即:86_18512345678
pobj.actionBody.channelUserId = result.data.nationalCode + "-" + result.data.mobile; // 即:86_18512345678
pobj.actionBody.userpin = pobj.actionBody.userpin || this.getUUID();
var tmpOpResult = await this.utilsAuthSve.getLoginByUserName(pobj, pobj.actionBody);
if (tmpOpResult.status != 0 && tmpOpResult.status != 2060) {
return tmpOpResult;
}
return system.getResultSuccess({ userpin: tmpOpResult.data.userpin })
return system.getResultSuccess({ userpin: tmpOpResult.data.userpin ? tmpOpResult.data.userpin : pobj.actionBody.userpin})
} else {
// 获取用户信息失败
return system.getResult(null, "Failed to get user information, 100420");
......@@ -90,13 +90,8 @@ class UtilsUcommuneService extends AppServiceBase {
console.log(alipayResponse);
}
if(actionBody.payWay == 3) { // 微信
var wxpay = this.WXpay({
appid: 'wx6f3ebe44defe336a',
mch_id: '1232813602',
partner_key: 'sinotone2014sinotone2014sinotone', //微信商户平台API密钥
//pfx: fs.readFileSync('./wxpay_cert.p12'), //微信商户平台证书
//pfx: "sinotone2014sinotone2014sinotone"
});
console.log(this.WXpay)
var wxpay = this.WXpay;
var out_trade_no='20160203'+Math.random().toString().substr(2, 10);
wxpay.createUnifiedOrder({
body: '充值兑换宝币',
......@@ -108,9 +103,9 @@ class UtilsUcommuneService extends AppServiceBase {
product_id: '1234567890'
}, function(err, result){
console.log(result);
return result
})
}
return system.getResult(null, "actionBody.payWay is eoor values,100450");
}
/**
......
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