Authored by 毕凯

Merge branch 'feature/passportctx1019' into 'release/1019'

ctx



See merge request !1013
@@ -4,7 +4,6 @@ const aes = require('./aes-pwd'); @@ -4,7 +4,6 @@ const aes = require('./aes-pwd');
4 const authcode = require('../../../utils/authcode'); 4 const authcode = require('../../../utils/authcode');
5 const logger = global.yoho.logger; 5 const logger = global.yoho.logger;
6 const sign = global.yoho.sign; 6 const sign = global.yoho.sign;
7 -const api = global.yoho.API;  
8 const uuid = require('uuid'); 7 const uuid = require('uuid');
9 const url = require('url'); 8 const url = require('url');
10 const md5 = require('yoho-md5'); 9 const md5 = require('yoho-md5');
@@ -30,7 +29,7 @@ class AuthModel extends global.yoho.BaseModel { @@ -30,7 +29,7 @@ class AuthModel extends global.yoho.BaseModel {
30 param.shopping_key = shoppingKey; 29 param.shopping_key = shoppingKey;
31 } 30 }
32 31
33 - return api.post('', param); 32 + return this.post({data: param});
34 } 33 }
35 34
36 signinAes(area, profile, password, shoppingKey, ip, isSkip, from) { 35 signinAes(area, profile, password, shoppingKey, ip, isSkip, from) {
@@ -49,12 +48,8 @@ class AuthModel extends global.yoho.BaseModel { @@ -49,12 +48,8 @@ class AuthModel extends global.yoho.BaseModel {
49 48
50 logger.info(`${profile}, login from ${ip}`); 49 logger.info(`${profile}, login from ${ip}`);
51 50
52 - return api.post('', param, {  
53 - headers: {  
54 - 'user-agent': 'yoho/nodejs',  
55 - 'X-YOHO-IP': ip,  
56 - 'X-Forwarded-For': ip  
57 - } 51 + return this.post({
  52 + data: param
58 }); 53 });
59 } 54 }
60 55
@@ -71,7 +66,7 @@ class AuthModel extends global.yoho.BaseModel { @@ -71,7 +66,7 @@ class AuthModel extends global.yoho.BaseModel {
71 param.shopping_key = params.shoppingKey; 66 param.shopping_key = params.shoppingKey;
72 } 67 }
73 68
74 - return api.get('', param); 69 + return this.get({data: param});
75 } 70 }
76 71
77 profile(uid) { 72 profile(uid) {
@@ -80,7 +75,7 @@ class AuthModel extends global.yoho.BaseModel { @@ -80,7 +75,7 @@ class AuthModel extends global.yoho.BaseModel {
80 method: 'app.passport.profile' 75 method: 'app.passport.profile'
81 }; 76 };
82 77
83 - return api.get('', param); 78 + return this.get({data: param});
84 } 79 }
85 80
86 thirdSign(params, clientSecret) { 81 thirdSign(params, clientSecret) {