...
|
...
|
@@ -8,7 +8,6 @@ const _ = require('lodash'); |
|
|
const Context = require('../framework/context');
|
|
|
const rp = require('request-promise');
|
|
|
const Api = require('../common/api');
|
|
|
const apiDomain = global.yoho.apiDomain;
|
|
|
const config = global.yoho.config;
|
|
|
|
|
|
const regSession = '${0}=([^;]+);';
|
...
|
...
|
@@ -19,7 +18,7 @@ class UserService extends Context { |
|
|
this.api = this.instance(Api);
|
|
|
}
|
|
|
login(account, password) {
|
|
|
return this.api.post(apiDomain.erp.login, {
|
|
|
return this.api.post(config.apiDomain.erp.login, {
|
|
|
account,
|
|
|
password,
|
|
|
platform: config.platform
|
...
|
...
|
@@ -33,7 +32,7 @@ class UserService extends Context { |
|
|
|
|
|
shopLogin(account, password) {
|
|
|
return rp.get({
|
|
|
url: apiDomain.shop.login,
|
|
|
url: config.apiDomain.shop.login,
|
|
|
resolveWithFullResponse: true,
|
|
|
qs: {
|
|
|
user: account,
|
...
|
...
|
@@ -61,7 +60,7 @@ class UserService extends Context { |
|
|
}
|
|
|
|
|
|
getShops(pid) {
|
|
|
return this.api.get(apiDomain.platform.queryShopsByAdminPid, {
|
|
|
return this.api.get(config.apiDomain.platform.queryShopsByAdminPid, {
|
|
|
userId: pid
|
|
|
}).then(result => {
|
|
|
return result;
|
...
|
...
|
@@ -69,7 +68,7 @@ class UserService extends Context { |
|
|
}
|
|
|
|
|
|
profile(pid) {
|
|
|
return this.instance(Api).get(apiDomain.shop.profile.url, {userId: pid});
|
|
|
return this.instance(Api).get(config.apiDomain.shop.profile.url, {userId: pid});
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|