Authored by htoooth

add api

... ... @@ -6,6 +6,10 @@ const cache = global.yoho.cache;
const sign = global.yoho.sign;
const api = global.yoho.API;
const Promise = require('bluebird');
const cartApi = require('./cart-api');
const Auth = {
signin(type, area, profile, password, shoppingKey) {
let _that = this;
... ... @@ -108,7 +112,7 @@ const Auth = {
return api.get('', param);
},
syncUserSession(uid, req, res) {
return Auth.profile(uid).then((userInfo) => {
return Promise.all([Auth.profile(uid), cartApi.goodsCount(uid)]).spread((userInfo, count) => {
let token = sign.makeToken(uid);
let data = userInfo.data;
let encryptionUid = aes.encryptionUid(data.uid);
... ...
/**
* Created by TaoHuang on 2016/9/28.
*/
const api = global.yoho.API;
const goodsCount = (uid) => {
api.get('', {
method: 'app.Shopping.count',
uid: uid
});
};
module.exports = {
goodsCount
};
\ No newline at end of file
... ...