Authored by htoooth

refactor

... ... @@ -3,7 +3,7 @@
const _ = require('lodash');
const cookie = global.yoho.cookie;
const cache = global.yoho.cache;
const loginService = require('../../apps/passport/models/login-service');
const LoginService = require('../../apps/passport/models/login-service');
/**
* 已登录用户的信息,包括记住我功能。
... ... @@ -41,13 +41,13 @@ module.exports = () => {
let password = data.password;
let area = data.area;
return loginService.signin(area, account, password);
return LoginService.signin(area, account, password);
}).then(result => {
if (result.code !== 200) {
return Promise.reject(new Error(result.message));
}
return loginService.syncUserSession(result.data.uid, req, res);
return LoginService.syncUserSession(result.data.uid, req, res);
}).then(()=> {
return res.redirect(req.getUrl());
}).catch(next);
... ...