Authored by ccbikai(👎🏻🍜)

Merge branch 'feature/coin' into release/5.1

'use strict';
const coinModel = require('../models/coin');
exports.sendCoin = (req, res, next) => {
// let data = {
// code: 403
// };
// if (!req.query.token) {
// data.message = "参数错误!"
// return res.jsonp(data);
// }
let uid = req.user.uid;
if (req.query.app) {
uid = req.query.app.uid;
}
// if (!uid) {
// data.code = 401;
// data.message = "未登录";
// return res.jsonp(data);
// }
coinModel.sendCoin({
token: req.query.token,
uid: uid
}).then((result) => {
console.log(result);
res.jsonp(result);
}).catch(next);
};
... ...
/**
* 领取有货币
*/
const api = global.yoho.API;
module.exports = {
sendCoin: function(params) {
return api.get('', Object.assign({
method: 'app.activity.receviceYohoCoin'
}, params));
}
};
... ...
... ... @@ -16,6 +16,7 @@ const live = require(`${cRoot}/live`);
const invite = require(`${cRoot}/invite`);
const vipDay = require(`${cRoot}/vipDay`);
const market = require(`${cRoot}/market`);
const coin = require(`${cRoot}/coin`);
// routers
... ... @@ -75,6 +76,6 @@ router.post('/vip-day/signin.json', vipDay.beforeIn, vipDay.signin);
router.post('/vip-day/msg/save.json', vipDay.beforeIn, vipDay.saveMsg);
router.get('/vip-day/msg/fetch.json', vipDay.fetchMsg);
router.get('/coin/sendCoin', coin.sendCoin);
module.exports = router;
... ...
... ... @@ -16,7 +16,7 @@ module.exports = {
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
api: 'http://api-test1.yohops.com:9999/',
api: 'http://dev-api.yohops.com:9999/',
service: 'http://service-test1.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test1.yohops.com:9999/'
... ...