Authored by 邱骏

update

/**
* Created by qiujun on 2018/10/9.
* 双11红包雨相关接口
*/
const INVALID_PARAMS = '参数错误';
const redpac = {
async getRedpac(req, res) {
}
};
module.exports = redpac;
... ...
... ... @@ -185,7 +185,7 @@ const shoes = {
} else if (parseInt(question, 10) === 0) {
let session_token = req.session.shoesToken;
// console.log(session_token, token);
console.log('save:', session_token, token);
if (session_token !== token) {
return res.json({
code: 400,
... ... @@ -450,7 +450,7 @@ const shoes = {
if (referer && referer.indexOf('ad.yoho.cn') > 0) {
req.session.shoesToken = token;
// console.log('shoesToken:', req.session.shoesToken);
console.log('shoesToken:', req.session.shoesToken);
res.json({
data: token,
});
... ...
/**
* Created by qiujun on 2018/10/9.
*/
const service = global.yoho.ServiceAPI;
class RedpacModel extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
/**
* 领取红包
* @param uid
* @param actSource
* @param redpacToken
*/
getRedpac(uid, actSource, redpacToken) {
return this.get({
url: '',
method: 'app.redpac.addRedpac',
uid: uid,
actSource: actSource,
redpacToken: redpacToken
});
}
}
... ...
... ... @@ -296,7 +296,7 @@ class ShoesModel extends global.yoho.BaseModel {
let userInfoObj = userInfo[0];
let userId = userInfoObj.id;
let userAvatar = userInfoObj.user_avatar;
let userName = userInfoObj.user_name;
let userName = decodeURIComponent(userInfoObj.user_name);
let scoreInfo = await mySqlCli.query(strScore, {
userId,
actId
... ... @@ -326,8 +326,6 @@ class ShoesModel extends global.yoho.BaseModel {
message: '用户无得分'
};
}
} else {
return {
code: 203,
... ... @@ -455,7 +453,7 @@ class ShoesModel extends global.yoho.BaseModel {
friendObj.rank = scoreInfo[i].rownum;
friendObj.userId = scoreInfo[i].user_id;
friendObj.headimgurl = scoreInfo[i].user_avatar;
friendObj.nickname = scoreInfo[i].user_name;
friendObj.nickname = decodeURIComponent(scoreInfo[i].user_name);
friendObj.playTime = scoreInfo[i].playTime;
friendObj.createTime = parseInt((new Date()).getTime() / 1000, 10) - parseInt(scoreInfo[i].create_time, 10);
... ... @@ -505,7 +503,7 @@ class ShoesModel extends global.yoho.BaseModel {
friendObj.userId = scoreInfo[i].user_id;
friendObj.userPhone = scoreInfo[i].user_phone;
friendObj.headimgurl = scoreInfo[i].user_avatar;
friendObj.nickname = scoreInfo[i].user_name;
friendObj.nickname = decodeURIComponent(scoreInfo[i].user_name);
friendObj.playTime = scoreInfo[i].playTime;
friendObj.createTime = new Date(scoreInfo[i].create_time * 1000).toLocaleString();
... ...
... ... @@ -355,7 +355,7 @@ const userController = {
let session_token = req.session.shoesToken;
let result = {};
// console.log(token, session_token);
console.log(token, session_token);
if (token === session_token) {
result = await req.ctx(UserModel).updateUserMobileByUnionId(unionId, phone, force);
... ...