Authored by htoooth

refactor

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