...
|
...
|
@@ -4,7 +4,6 @@ const aes = require('./aes-pwd'); |
|
|
const authcode = require('../../../utils/authcode');
|
|
|
const logger = global.yoho.logger;
|
|
|
const sign = global.yoho.sign;
|
|
|
const api = global.yoho.API;
|
|
|
const uuid = require('uuid');
|
|
|
const url = require('url');
|
|
|
const md5 = require('yoho-md5');
|
...
|
...
|
@@ -12,6 +11,7 @@ const moment = require('moment'); |
|
|
const querystring = require('querystring');
|
|
|
const thirdAccount = require('../data/third-account.json');
|
|
|
const FROM = require('../../../config/from');
|
|
|
const PAGE = 'H5';
|
|
|
|
|
|
class AuthModel extends global.yoho.BaseModel {
|
|
|
constructor(ctx) {
|
...
|
...
|
@@ -30,31 +30,30 @@ class AuthModel extends global.yoho.BaseModel { |
|
|
param.shopping_key = shoppingKey;
|
|
|
}
|
|
|
|
|
|
return api.post('', param);
|
|
|
return this.post({data: param});
|
|
|
}
|
|
|
|
|
|
signinAes(area, profile, password, shoppingKey, ip, isSkip, from) {
|
|
|
signinAes(params) {
|
|
|
let param = {
|
|
|
method: 'sesame.flowering.higher',
|
|
|
area: area,
|
|
|
profile: profile,
|
|
|
password: aes.aesPwd(password),
|
|
|
isSkip: isSkip ? isSkip : 'N',
|
|
|
business_line: FROM[from].business_line
|
|
|
method: 'smart.forward.go',
|
|
|
area: params.area,
|
|
|
profile: params.profile,
|
|
|
password: aes.aesPwd(params.password),
|
|
|
isSkip: params.isSkip ? params.isSkip : 'N',
|
|
|
business_line: FROM[params.from].business_line,
|
|
|
udid: params.udid,
|
|
|
fromPage: PAGE,
|
|
|
degrees: params.captcha
|
|
|
};
|
|
|
|
|
|
if (shoppingKey) {
|
|
|
param.shopping_key = shoppingKey;
|
|
|
if (params.shoppingKey) {
|
|
|
param.shopping_key = params.shoppingKey;
|
|
|
}
|
|
|
|
|
|
logger.info(`${profile}, login from ${ip}`);
|
|
|
logger.info(`${params.profile}, login from ${params.ip}`);
|
|
|
|
|
|
return api.post('', param, {
|
|
|
headers: {
|
|
|
'user-agent': 'yoho/nodejs',
|
|
|
'X-YOHO-IP': ip,
|
|
|
'X-Forwarded-For': ip
|
|
|
}
|
|
|
return this.post({
|
|
|
data: param
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -71,7 +70,7 @@ class AuthModel extends global.yoho.BaseModel { |
|
|
param.shopping_key = shoppingKey;
|
|
|
}
|
|
|
|
|
|
return api.get('', param);
|
|
|
return this.get({data: param});
|
|
|
}
|
|
|
|
|
|
profile(uid) {
|
...
|
...
|
@@ -80,7 +79,7 @@ class AuthModel extends global.yoho.BaseModel { |
|
|
method: 'app.passport.profile'
|
|
|
};
|
|
|
|
|
|
return api.get('', param);
|
|
|
return this.get({data: param});
|
|
|
}
|
|
|
|
|
|
thirdSign(params, clientSecret) {
|
...
|
...
|
|