Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
718ae495
Commit
718ae495
authored
Dec 05, 2019
by
方斌
Browse files
Options
Browse Files
Download
Plain Diff
z
parents
547d357e
d8779ce0
Pipeline
#17869
passed with stage
in 7 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
84 deletions
+90
-84
wechat.js
app/controller/gjj/wechat.js
+71
-53
product.js
app/service/gjj/product.js
+17
-29
config.local.js
config/config.local.js
+2
-2
No files found.
app/controller/gjj/wechat.js
View file @
718ae495
...
@@ -3,8 +3,11 @@
...
@@ -3,8 +3,11 @@
const
Controller
=
require
(
'egg'
).
Controller
;
const
Controller
=
require
(
'egg'
).
Controller
;
const
moment
=
require
(
'moment'
);
const
moment
=
require
(
'moment'
);
const
WECHAT_CODE_URL
=
'https://open.weixin.qq.com/connect/oauth2/authorize'
;
const
WECHAT_CODE_URL
=
'https://open.weixin.qq.com/connect/oauth2/authorize'
;
const
WECHAT_AUTH
=
'https://api.weixin.qq.com/sns/oauth2/access_token'
;
const
WECHAT_APPID
=
'wx3c772df2d8d78da3'
;
const
WECHAT_APPID
=
'wx3c772df2d8d78da3'
;
const
WECHAT_APPID_TEST
=
'wxa9df2d60730b25d9'
;
const
WECHAT_APPID_TEST
=
'wxa9df2d60730b25d9'
;
const
WECHAT_SECRET
=
'b369fd28a9f9320ebe4e35dfaa00b194'
;
const
WECHAT_SECRET_TEST
=
'dfede7a3b543149a88b07b46bcc28e00'
;
const
REDIRECT_PAGE
=
'/webserve/accumulation/index'
;
const
REDIRECT_PAGE
=
'/webserve/accumulation/index'
;
class
WechatController
extends
Controller
{
class
WechatController
extends
Controller
{
...
@@ -15,67 +18,81 @@ class WechatController extends Controller {
...
@@ -15,67 +18,81 @@ class WechatController extends Controller {
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
code
=
ctx
.
query
.
code
;
const
code
=
ctx
.
query
.
code
;
const
channel_id
=
ctx
.
query
.
channel_id
;
const
channel_id
=
ctx
.
query
.
channel_id
;
const
app_id
=
[
'https://lan-nginx.jianbing.com'
,
'https://pro-nginx.jianbing.com'
,
'https://p.jianbing.com'
,
'https://b.jianbing.com'
].
includes
(
this
.
config
.
NODE_BASE_URL
)
?
WECHAT_APPID
:
WECHAT_APPID_TEST
;
const
app_id
=
[
'https://lan-nginx.jianbing.com'
,
'https://pro-nginx.jianbing.com'
].
includes
(
this
.
config
.
NODE_BASE_URL
)
?
WECHAT_APPID
:
WECHAT_APPID_TEST
;
if
(
!
code
||
code
.
length
===
0
)
{
const
appsecret
=
[
'https://lan-nginx.jianbing.com'
,
'https://pro-nginx.jianbing.com'
].
includes
(
this
.
config
.
NODE_BASE_URL
)
?
WECHAT_SECRET
:
WECHAT_SECRET_TEST
;
if
(
!
code
||
code
.
length
===
0
)
{
// this.app.config.OUT_P_NODE_URL
const
target_url
=
WECHAT_CODE_URL
+
`?appid=
${
app_id
}
&redirect_uri=
${
encodeURIComponent
(
`
${
this
.
app
.
config
.
PULIC_BASE_URL
}
/51business/api/gjj/wechat/oauth_login?&channel_id=
${
channel_id
}
`
)}
&response_type=code&scope=snsapi_base&state=gjjquery#wechat_redirect`
;
const
target_url
=
WECHAT_CODE_URL
+
`?appid=
${
app_id
}
&redirect_uri=
${
encodeURIComponent
(
`
${
this
.
app
.
config
.
PULIC_BASE_URL
}
/51business/api/gjj/wechat/oauth_login?&channel_id=
${
channel_id
}
`
)}
&response_type=code&scope=snsapi_base&state=gjjquery#wechat_redirect`
;
ctx
.
redirect
(
target_url
);
return
;
ctx
.
redirect
(
target_url
);
return
;
}
}
const
oauth_url
=
`
${
this
.
config
.
NODE_BASE_URL
}
/user_api/v1/login/oauth_login`
;
// 用户中心授权地址
const
url
=
`
${
WECHAT_AUTH
}
?appid=
${
app_id
}
&secret=
${
appsecret
}
&code=
${
code
}
&grant_type=authorization_code`
;
// 授权参数
const
result
=
await
ctx
.
helper
.
send_request
(
url
,
{},
{
method
:
'GET'
});
const
oauth_params
=
{
ctx
.
logger
.
info
(
JSON
.
stringify
({
wx_gjj_query
:
result
}));
login_type
:
'5'
,
// 5代表微信授权登录 如果有QQ授权登录,再扩展
if
(
result
.
status
!==
200
)
{
app_user_id
:
ctx
.
cookies
.
get
(
'app_user_id'
,
{
signed
:
false
}),
ctx
.
failed
(
'获取openid失败1'
);
code
,
}
token
:
ctx
.
cookies
.
get
(
'token'
,
{
signed
:
false
}),
const
wx_ret
=
result
.
data
;
app_id
,
if
(
!
wx_ret
.
openid
)
{
};
ctx
.
failed
(
'获取openid失败2'
);
const
result
=
await
ctx
.
helper
.
send_request
(
oauth_url
,
oauth_params
,
{
method
:
'POST'
});
// 通过授权码code返回授权状态
}
ctx
.
logger
.
info
(
JSON
.
stringify
({
gjj_wechat_oauth_login_params
:
oauth_params
,
gjj_wechat_oauth_login_result
:
result
}));
const
openid
=
wx_ret
.
openid
;
// 在微信端需要关闭微信重新打开才会销毁cookie值,所以在这里重置cookie值
const
ret
=
result
.
data
;
ctx
.
cookies
.
set
(
'openid'
,
openid
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
if
(
result
.
status
!==
201
)
{
// 调用接口出错抛出异常
ctx
.
cookies
.
set
(
'token'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
const
error_message
=
ret
.
error
?
ret
.
error
:
'授权失败,请联系客服'
;
ctx
.
cookies
.
set
(
'user_id'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
failed
(
error_message
);
ctx
.
cookies
.
set
(
'app_user_id'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
}
ctx
.
cookies
.
set
(
'jianbing_customer_id'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'auth_token'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
const
no_login_url
=
this
.
config
.
PULIC_BASE_URL
+
REDIRECT_PAGE
+
`?channel_id=
${
channel_id
}
&type=noLogin`
;
// 未登录并没有公积金数据的页面
const
detail_url
=
this
.
config
.
PULIC_BASE_URL
+
REDIRECT_PAGE
+
`?channel_id=
${
channel_id
}
&type=hasLogin`
;
// 已登录并且有公积金数据的公积金详情页,
const
redirect_url
=
this
.
app
.
config
.
PULIC_BASE_URL
+
REDIRECT_PAGE
;
// 判断是否已绑定手机号
// { code: '-1', msg: 'APP用户状态异常' }
const
user_exist_url
=
`
${
this
.
app
.
config
.
NODE_BASE_URL
}
/user_api/v1/user/is_exist/
${
openid
}
`
;
// { code: '-2', msg: '需要重新授权' }
const
bind_phone_result
=
await
ctx
.
helper
.
send_request
(
user_exist_url
,
{
type
:
5
},
{
method
:
'GET'
});
// { code: '-3', msg: '需要先手机登录' }
ctx
.
logger
.
info
(
JSON
.
stringify
({
bind_phone_result
}));
// { code: '-4', msg: '绑定失败,此QQ已绑定其他手机了'}
if
(
bind_phone_result
.
status
!==
200
)
{
if
(
ret
.
code
&&
ret
.
code
===
'-3'
)
{
// 如果用户未绑定手机,先去做登录绑定手机号
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin`
);
return
;
ctx
.
redirect
(
no_login_url
);
}
return
;
const
user_exist_ret
=
bind_phone_result
.
data
;
}
if
(
user_exist_ret
.
result
!==
'true'
)
{
// 未绑定的手机号时
if
(
!
ret
||
ret
.
code
!==
'1'
||
!
ret
.
data
||
!
ret
.
data
.
openid
)
{
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin`
);
return
;
const
error_msg
=
ret
.
msg
||
'获取openid失败'
;
}
ctx
.
failed
(
error_msg
);
const
user_id
=
user_exist_ret
.
uid
;
}
const
openid
=
ret
.
data
.
openid
;
const
login_result
=
await
this
.
user_login
({
code
,
openid
,
channel_id
});
// 用openid直接登录用户
const
user_id
=
login_result
.
user_id
;
// 已绑定手机的 继续 判断是否有导入公积金
// 已绑定手机的 继续 判断是否有导入公积金
if
(
!
login_result
.
token
)
{
const
login_result
=
await
this
.
user_login
({
code
,
openid
,
channel_id
});
// 已绑定的用户 直接登录
ctx
.
redirect
(
no_login_url
+
`?channel_id=
${
channel_id
}
&type=noLogin`
);
return
;
if
(
login_result
.
anew
&&
!
login_result
.
token
)
{
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin`
);
return
;
}
}
const
gjj_exist_url
=
`
${
this
.
app
.
config
.
NODE_BASE_URL
}
/cassandra-server/gjj/list/
${
user_id
}
`
;
const
gjj_exist_url
=
`
${
this
.
app
.
config
.
NODE_BASE_URL
}
/cassandra-server/gjj/list/
${
user_id
}
`
;
const
gjj_exist_result
=
await
ctx
.
helper
.
send_request
(
gjj_exist_url
,
{},
{
method
:
'GET'
});
const
gjj_exist_result
=
await
ctx
.
helper
.
send_request
(
gjj_exist_url
,
{},
{
method
:
'GET'
});
ctx
.
logger
.
info
(
JSON
.
stringify
({
user_id
,
gjj_exist_result
}));
ctx
.
logger
.
info
(
JSON
.
stringify
({
gjj_exist_result
}));
if
(
gjj_exist_result
.
status
!==
200
)
{
// 调用公积金接口出错
if
(
gjj_exist_result
.
status
!==
200
)
{
// 调用公积金接口出错
ctx
.
redirect
(
no_login_url
);
return
;
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin`
);
return
;
}
}
const
gjj_exist_ret
=
gjj_exist_result
.
data
;
const
gjj_exist_ret
=
gjj_exist_result
.
data
;
if
(
!
gjj_exist_ret
.
ret
||
gjj_exist_ret
.
ret
.
length
===
0
)
{
// 没有导入公积金时
if
(
!
gjj_exist_ret
.
ret
||
gjj_exist_ret
.
ret
.
length
===
0
)
{
// 没有导入公积金时
ctx
.
redirect
(
no_login_url
);
return
;
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin`
);
return
;
}
}
ctx
.
redirect
(
detail_url
);
return
;
// 已导入公积金
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=hasLogin`
);
return
;
// 已导入公积金
}
}
// 判断是否有公积金导入并跳转
// async checkGjj() {
// const { ctx } = this;
// const user_id = ctx.userId;
// //判断是否有导入公积金
// console.info(user_id);
// const gjj_exist_url = `${this.app.config.NODE_BASE_URL}/cassandra-server/gjj/list/${user_id}`;
// const gjj_exist_result = await ctx.helper.send_request(gjj_exist_url, {}, { method: 'GET' });
// ctx.logger.info(JSON.stringify({ gjj_exist_result: gjj_exist_result }));
// if (gjj_exist_result.status !== 200) {
// ctx.redirect(NO_GJJ_PAGE); return;
// }
// ctx.redirect(GJJ_DETAIL_PAGE); return;
// }
async
checkLogin
()
{
async
checkLogin
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
...
@@ -84,7 +101,7 @@ class WechatController extends Controller {
...
@@ -84,7 +101,7 @@ class WechatController extends Controller {
if
(
user_id
)
{
if
(
user_id
)
{
is_login
=
true
;
is_login
=
true
;
}
}
// const phone = await ctx.helper.getPhoneCity('15968762898');
ctx
.
success
({
result
:
is_login
});
ctx
.
success
({
result
:
is_login
});
}
}
...
@@ -106,13 +123,12 @@ class WechatController extends Controller {
...
@@ -106,13 +123,12 @@ class WechatController extends Controller {
ctx
.
failed
(
'渠道未关联APPID'
);
ctx
.
failed
(
'渠道未关联APPID'
);
}
}
const
device_login_params
=
{
// 设备登录的参数
const
device_login_params
=
{
past_deviceno
,
past_deviceno
,
channel_id
:
app_channel_info
.
channel_id
,
channel_id
:
app_channel_info
.
channel_id
,
app_id
:
app_channel_info
.
app_id
,
app_id
:
app_channel_info
.
app_id
,
device_info
:
{},
device_info
:
{},
};
};
// 设备登录
const
result_device_login
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
NODE_URL
+
'/login/device'
,
device_login_params
,
{
method
:
'POST'
});
// 设备登录
const
result_device_login
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
NODE_URL
+
'/login/device'
,
device_login_params
,
{
method
:
'POST'
});
// 设备登录
const
device_login_data
=
result_device_login
.
data
;
// 设备登录返回结果
const
device_login_data
=
result_device_login
.
data
;
// 设备登录返回结果
if
(
!
device_login_data
||
Object
.
keys
(
device_login_data
).
length
===
0
)
{
if
(
!
device_login_data
||
Object
.
keys
(
device_login_data
).
length
===
0
)
{
...
@@ -140,13 +156,16 @@ class WechatController extends Controller {
...
@@ -140,13 +156,16 @@ class WechatController extends Controller {
openid
:
openid
||
''
,
// 例如微信公众号的openid(不传默认是51查个税)
openid
:
openid
||
''
,
// 例如微信公众号的openid(不传默认是51查个税)
};
};
const
result_user_login
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
NODE_URL
+
'/login/user'
,
user_login_params
,
{
method
:
'POST'
});
// 用户登录
const
result_user_login
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
NODE_URL
+
'/login/user'
,
user_login_params
,
{
method
:
'POST'
});
// 用户登录
ctx
.
logger
.
info
(
JSON
.
stringify
({
user_
ologin_params
:
user_login_params
,
result_user_ologin
:
result_user_login
}));
ctx
.
logger
.
info
(
JSON
.
stringify
({
user_
login_params
,
result_user_login
}));
const
user_login_data
=
result_user_login
.
data
;
// 用户登录返回结果
const
user_login_data
=
result_user_login
.
data
;
// 用户登录返回结果
if
(
!
user_login_data
||
Object
.
keys
(
user_login_data
).
length
===
0
)
{
if
(
!
user_login_data
||
Object
.
keys
(
user_login_data
).
length
===
0
)
{
ctx
.
failed
(
'用户的登录失败'
);
ctx
.
failed
(
'用户的登录失败'
);
}
}
if
(
!
user_login_data
.
token
||
!
user_login_data
.
uid
||
!
user_login_data
.
app_user_id
)
{
if
(
!
user_login_data
.
token
||
!
user_login_data
.
uid
)
{
const
error_msg
=
user_login_data
.
error
?
user_login_data
.
error
:
'用户的openid登录失败'
;
const
error_msg
=
user_login_data
.
error
?
user_login_data
.
error
:
'用户的登录失败'
;
if
(
error_msg
===
'需要重新授权'
)
{
return
{
anew
:
1
};
}
ctx
.
failed
(
error_msg
);
ctx
.
failed
(
error_msg
);
}
}
// 获取用户信息
// 获取用户信息
...
@@ -163,7 +182,6 @@ class WechatController extends Controller {
...
@@ -163,7 +182,6 @@ class WechatController extends Controller {
auth_token
=
ctx
.
helper
.
md5
(
String
(
old_user_sid
)
+
moment
(
new
Date
()).
format
(
'MDYYYY'
)
+
'f74jkdsy83sjf'
,
'utf8'
);
auth_token
=
ctx
.
helper
.
md5
(
String
(
old_user_sid
)
+
moment
(
new
Date
()).
format
(
'MDYYYY'
)
+
'f74jkdsy83sjf'
,
'utf8'
);
}
}
// 需要存cookie的用户信息
const
user_info
=
{
const
user_info
=
{
token
:
login_token
,
token
:
login_token
,
app_user_id
,
app_user_id
,
...
@@ -175,7 +193,7 @@ class WechatController extends Controller {
...
@@ -175,7 +193,7 @@ class WechatController extends Controller {
jianbing_customer_id
:
old_user_sid
,
jianbing_customer_id
:
old_user_sid
,
auth_token
,
auth_token
,
};
};
for
(
const
key
in
user_info
)
{
// 保存cookie
for
(
const
key
in
user_info
)
{
const
value
=
user_info
[
key
];
const
value
=
user_info
[
key
];
ctx
.
cookies
.
set
(
key
,
value
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
key
,
value
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
}
}
...
...
app/service/gjj/product.js
View file @
718ae495
...
@@ -128,18 +128,17 @@ class ProductService extends Service {
...
@@ -128,18 +128,17 @@ class ProductService extends Service {
// 1 授信贷;2 信用卡;3 普通信用卡;4 普通贷款
// 1 授信贷;2 信用卡;3 普通信用卡;4 普通贷款
async
getAllProductsByType
(
type
)
{
async
getAllProductsByType
(
type
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
url
=
this
.
config
.
NODE_BASE_URL
+
'/cassandra-server/bu_basic/list'
;
const
url
=
this
.
config
.
NODE_BASE_URL
+
'/cassandra-server/bu_basic/list'
;
const
products_results
=
await
ctx
.
helper
.
send_request
(
url
,
{
type
,
app_id
:
ctx
.
appId
},
{
method
:
'GET'
});
const
products_results
=
await
ctx
.
helper
.
send_request
(
url
,
{
type
,
app_id
:
ctx
.
appId
},
{
method
:
'GET'
});
// ctx.logger.info(JSON.stringify({ url, products_results }));
// ctx.logger.info(JSON.stringify({ url, products_results }));
let
products
=
[];
let
products
=
[];
console
.
log
(
products_results
)
if
(
products_results
.
status
!==
200
||
!
products_results
.
data
||
!
products_results
.
data
.
ret
)
{
if
(
products_results
.
status
!==
200
||
!
products_results
.
data
||
!
products_results
.
data
.
ret
)
{
return
products
;
return
products
;
}
}
products
=
products_results
.
data
.
ret
;
products
=
products_results
.
data
.
ret
;
const
sort
=
function
(
a
,
b
)
{
const
sort
=
function
(
a
,
b
)
{
if
(
a
.
recommend_sorter
===
b
.
recommend_sorter
)
{
if
(
a
.
recommend_sorter
===
b
.
recommend_sorter
)
{
...
@@ -207,15 +206,8 @@ class ProductService extends Service {
...
@@ -207,15 +206,8 @@ class ProductService extends Service {
// 获取普通贷款
// 获取普通贷款
async
getCommonBusinessList
()
{
async
getCommonBusinessList
()
{
const
{
ctx
}
=
this
;
const
ret
=
await
this
.
getAllProductsByType
(
4
);
const
url
=
ctx
.
app
.
config
.
NODE_BASE_URL
+
'/cassandra-server/bu_basic/list'
;
return
ret
;
const
param
=
{
type
:
4
,
app_id
:
ctx
.
appId
};
const
resp
=
await
ctx
.
helper
.
send_request
(
url
,
param
,
{
method
:
'GET'
});
if
(
resp
.
status
!==
200
)
{
ctx
.
failed
(
'[bu_basic]内部接口错误'
);
}
return
resp
.
data
.
ret
;
}
}
// 获取推荐列表,按照ABC分组顺序推荐
// 获取推荐列表,按照ABC分组顺序推荐
...
@@ -405,12 +397,12 @@ class ProductService extends Service {
...
@@ -405,12 +397,12 @@ class ProductService extends Service {
async
formatLoanList
(
loanList
)
{
async
formatLoanList
(
loanList
)
{
//以下代码是为了处理渠道包下不展示特殊的4个业务
//
以下代码是为了处理渠道包下不展示特殊的4个业务
//start
//
start
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
user_sid
=
ctx
.
oldUserId
;
const
user_sid
=
ctx
.
oldUserId
;
let
filter
=
{
where
:
{
sid
:
user_sid
}
};
let
filter
=
{
where
:
{
sid
:
user_sid
}
};
le
t
userInfo
=
await
ctx
.
gjjModel
.
SysUser
.
one
(
filter
);
cons
t
userInfo
=
await
ctx
.
gjjModel
.
SysUser
.
one
(
filter
);
ctx
.
logger
.
info
(
'get_phone_by_user_sid:'
+
JSON
.
stringify
(
userInfo
));
ctx
.
logger
.
info
(
'get_phone_by_user_sid:'
+
JSON
.
stringify
(
userInfo
));
let
place_cid
=
0
;
let
place_cid
=
0
;
if
(
userInfo
!==
null
)
{
if
(
userInfo
!==
null
)
{
...
@@ -418,13 +410,13 @@ class ProductService extends Service {
...
@@ -418,13 +410,13 @@ class ProductService extends Service {
}
else
{
}
else
{
const
jianbing_guest_customer_id
=
ctx
.
cookies
.
get
(
'jianbing_guest_customer_id'
,
{
signed
:
false
});
const
jianbing_guest_customer_id
=
ctx
.
cookies
.
get
(
'jianbing_guest_customer_id'
,
{
signed
:
false
});
filter
=
{
where
:
{
sid
:
jianbing_guest_customer_id
}
};
filter
=
{
where
:
{
sid
:
jianbing_guest_customer_id
}
};
le
t
userInfo
=
await
ctx
.
gjjModel
.
SysGuest
.
one
(
filter
);
cons
t
userInfo
=
await
ctx
.
gjjModel
.
SysGuest
.
one
(
filter
);
if
(
userInfo
!==
null
)
{
if
(
userInfo
!==
null
)
{
place_cid
=
userInfo
.
place_cid
;
place_cid
=
userInfo
.
place_cid
;
}
}
}
}
//end
//
end
const
ret
=
[];
const
ret
=
[];
for
(
const
v
of
loanList
)
{
for
(
const
v
of
loanList
)
{
...
@@ -435,7 +427,7 @@ class ProductService extends Service {
...
@@ -435,7 +427,7 @@ class ProductService extends Service {
if
(
place_cid
>
0
&&
place_cids
.
includes
(
place_cids
)
&&
sepecial_business_ids
.
includes
(
v
.
business_id
))
{
if
(
place_cid
>
0
&&
place_cids
.
includes
(
place_cids
)
&&
sepecial_business_ids
.
includes
(
v
.
business_id
))
{
continue
;
continue
;
}
}
//end
//
end
// 处理C组
// 处理C组
let
url
=
v
.
url
;
let
url
=
v
.
url
;
...
@@ -507,11 +499,10 @@ class ProductService extends Service {
...
@@ -507,11 +499,10 @@ class ProductService extends Service {
if
(
city_res
&&
city_res
.
content
&&
city_res
.
content
.
address_detail
&&
city_res
.
content
.
address_detail
.
city
)
{
if
(
city_res
&&
city_res
.
content
&&
city_res
.
content
.
address_detail
&&
city_res
.
content
.
address_detail
.
city
)
{
city
=
city_res
.
content
.
address_detail
.
city
.
replace
(
'市'
,
''
);
city
=
city_res
.
content
.
address_detail
.
city
.
replace
(
'市'
,
''
);
}
}
ctx
.
logger
.
info
(
city_res
)
ctx
.
logger
.
info
(
JSON
.
stringify
(
city_res
));
}
}
ctx
.
logger
.
info
(
'check loan city:'
+
city
);
for
(
const
v
of
products
)
{
for
(
const
v
of
products
)
{
//ctx.logger.info('imh------begin----------')
//ctx.logger.info('imh------begin----------')
...
@@ -565,7 +556,7 @@ class ProductService extends Service {
...
@@ -565,7 +556,7 @@ class ProductService extends Service {
};
};
ret
.
push
(
tmp
);
ret
.
push
(
tmp
);
}
}
}
else
{
}
else
{
const
tmp
=
{
const
tmp
=
{
type
:
v
.
type
,
type
:
v
.
type
,
...
@@ -588,11 +579,8 @@ class ProductService extends Service {
...
@@ -588,11 +579,8 @@ class ProductService extends Service {
};
};
ret
.
push
(
tmp
);
ret
.
push
(
tmp
);
}
}
ctx
.
logger
.
info
(
'imh------end----------'
)
}
}
ctx
.
logger
.
info
(
'check city end'
);
return
ret
;
return
ret
;
}
}
...
...
config/config.local.js
View file @
718ae495
...
@@ -139,8 +139,8 @@ module.exports = appInfo => {
...
@@ -139,8 +139,8 @@ module.exports = appInfo => {
};
};
config
.
PHP_URL
=
'https://kaifa.jianbing.com'
;
config
.
PHP_URL
=
'https://kaifa.jianbing.com'
;
config
.
NODE_URL
=
'https://
dev
-nginx.jianbing.com/user_api/v1'
;
config
.
NODE_URL
=
'https://
uat
-nginx.jianbing.com/user_api/v1'
;
config
.
NODE_BASE_URL
=
'https://
dev
-nginx.jianbing.com'
;
config
.
NODE_BASE_URL
=
'https://
uat
-nginx.jianbing.com'
;
config
.
HOUSE_SERVICE_API
=
'https://uat-nginx.jianbing.com/house-service'
;
config
.
HOUSE_SERVICE_API
=
'https://uat-nginx.jianbing.com/house-service'
;
config
.
CDN_BASE_URL
=
'https://r.51gjj.com/image/'
;
config
.
CDN_BASE_URL
=
'https://r.51gjj.com/image/'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment