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
857af75e
Commit
857af75e
authored
Nov 08, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
parent
14e94a37
Pipeline
#16155
passed with stage
in 46 seconds
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
wechat.js
app/controller/gjj/wechat.js
+2
-2
config.prod.js
config/config.prod.js
+15
-14
No files found.
app/controller/gjj/wechat.js
View file @
857af75e
...
@@ -21,7 +21,7 @@ class WechatController extends Controller {
...
@@ -21,7 +21,7 @@ class WechatController extends Controller {
const
app_id
=
[
'https://lan-nginx.jianbing.com'
,
'https://pro-nginx.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
;
const
appsecret
=
[
'https://lan-nginx.jianbing.com'
,
'https://pro-nginx.jianbing.com'
].
includes
(
this
.
config
.
NODE_BASE_URL
)
?
WECHAT_SECRET
:
WECHAT_SECRET_TEST
;
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
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
.
P
HP
_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
.
P
ULIC_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
url
=
`
${
WECHAT_AUTH
}
?appid=
${
app_id
}
&secret=
${
appsecret
}
&code=
${
code
}
&grant_type=authorization_code`
const
url
=
`
${
WECHAT_AUTH
}
?appid=
${
app_id
}
&secret=
${
appsecret
}
&code=
${
code
}
&grant_type=authorization_code`
...
@@ -37,7 +37,7 @@ class WechatController extends Controller {
...
@@ -37,7 +37,7 @@ class WechatController extends Controller {
const
openid
=
wx_ret
.
openid
;
const
openid
=
wx_ret
.
openid
;
ctx
.
cookies
.
set
(
'openid'
,
openid
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'openid'
,
openid
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
const
redirect_url
=
this
.
app
.
config
.
P
HP
_URL
+
REDIRECT_PAGE
;
const
redirect_url
=
this
.
app
.
config
.
P
ULIC_BASE
_URL
+
REDIRECT_PAGE
;
//判断是否已绑定手机号
//判断是否已绑定手机号
const
user_exist_url
=
`
${
this
.
app
.
config
.
NODE_BASE_URL
}
/user_api/v1/user/is_exist/
${
openid
}
`
;
const
user_exist_url
=
`
${
this
.
app
.
config
.
NODE_BASE_URL
}
/user_api/v1/user/is_exist/
${
openid
}
`
;
const
bind_phone_result
=
await
ctx
.
helper
.
send_request
(
user_exist_url
,
{
type
:
5
},
{
method
:
'GET'
});
const
bind_phone_result
=
await
ctx
.
helper
.
send_request
(
user_exist_url
,
{
type
:
5
},
{
method
:
'GET'
});
...
...
config/config.prod.js
View file @
857af75e
...
@@ -14,7 +14,7 @@ module.exports = appInfo => {
...
@@ -14,7 +14,7 @@ module.exports = appInfo => {
dir
:
'/jianbing/logs/51business'
,
dir
:
'/jianbing/logs/51business'
,
};
};
// add your config here
// add your config here
config
.
middleware
=
[
'errorHandler'
,
'deviceLogin'
,
'deviceInit'
,
'responseSet'
];
config
.
middleware
=
[
'errorHandler'
,
'deviceLogin'
,
'deviceInit'
,
'responseSet'
];
// 是否启用csrf安全
// 是否启用csrf安全
config
.
security
=
{
config
.
security
=
{
...
@@ -126,18 +126,19 @@ module.exports = appInfo => {
...
@@ -126,18 +126,19 @@ module.exports = appInfo => {
config
.
USER_CENTER_API_URI
=
process
.
env
.
USER_CENTER_API_URI
;
config
.
USER_CENTER_API_URI
=
process
.
env
.
USER_CENTER_API_URI
;
config
.
BLACKLIST_APPLY_APPKEY
=
process
.
env
.
BLACKLIST_APPLY_APPKEY
;
//黑名单对接
config
.
BLACKLIST_APPLY_APPKEY
=
process
.
env
.
BLACKLIST_APPLY_APPKEY
;
//
黑名单对接
config
.
BLACKLIST_APPLY_APPSECRET
=
process
.
env
.
BLACKLIST_APPLY_APPSECRET
;
config
.
BLACKLIST_APPLY_APPSECRET
=
process
.
env
.
BLACKLIST_APPLY_APPSECRET
;
config
.
BLACKLIST_APPLY_URL
=
process
.
env
.
BLACKLIST_APPLY_URL
;
config
.
BLACKLIST_APPLY_URL
=
process
.
env
.
BLACKLIST_APPLY_URL
;
//微信支付相关内容
//
微信支付相关内容
config
.
MCH_APPID
=
process
.
env
.
MCH_APPID
;
//商户关联的APPID
config
.
MCH_APPID
=
process
.
env
.
MCH_APPID
;
//
商户关联的APPID
config
.
MCH_ID
=
process
.
env
.
MCH_ID
;
//商户id
config
.
MCH_ID
=
process
.
env
.
MCH_ID
;
//
商户id
config
.
MCH_KEY
=
process
.
env
.
MCH_KEY
;
//商户秘钥
config
.
MCH_KEY
=
process
.
env
.
MCH_KEY
;
//
商户秘钥
config
.
OUT_P_NODE_URL
=
process
.
env
.
OUT_P_NODE_URL
config
.
OUT_P_NODE_URL
=
process
.
env
.
OUT_P_NODE_URL
;
config
.
PULIC_BASE_URL
=
process
.
env
.
PULIC_BASE_URL
;
//数盒魔方
//
数盒魔方
config
.
SHUHEMOFANG_APP_KEY
=
process
.
env
.
SHUHEMOFANG_APP_KEY
;
config
.
SHUHEMOFANG_APP_KEY
=
process
.
env
.
SHUHEMOFANG_APP_KEY
;
config
.
SHUHEMOFANG_APP_SECRET
=
process
.
env
.
SHUHEMOFANG_APP_SECRET
;
config
.
SHUHEMOFANG_APP_SECRET
=
process
.
env
.
SHUHEMOFANG_APP_SECRET
;
config
.
SHUHEMOFANG_URL
=
process
.
env
.
SHUHEMOFANG_URL
;
config
.
SHUHEMOFANG_URL
=
process
.
env
.
SHUHEMOFANG_URL
;
...
@@ -146,17 +147,17 @@ module.exports = appInfo => {
...
@@ -146,17 +147,17 @@ module.exports = appInfo => {
config
.
TX_LBS_KEY
=
process
.
env
.
TX_LBS_KEY
;
config
.
TX_LBS_KEY
=
process
.
env
.
TX_LBS_KEY
;
config
.
TX_LBS_DISTANCE_URL
=
process
.
env
.
TX_LBS_DISTANCE_URL
;
// 距离计算(一对多)
config
.
TX_LBS_DISTANCE_URL
=
process
.
env
.
TX_LBS_DISTANCE_URL
;
// 距离计算(一对多)
config
.
TX_LBS_ADDRESS_URL
=
process
.
env
.
TX_LBS_ADDRESS_URL
;
// 地址解析;逆地址解析
config
.
TX_LBS_ADDRESS_URL
=
process
.
env
.
TX_LBS_ADDRESS_URL
;
// 地址解析;逆地址解析
config
.
TX_LBS_URL
=
process
.
env
.
TX_LBS_URL
;
//腾讯MAP API
config
.
TX_LBS_URL
=
process
.
env
.
TX_LBS_URL
;
//
腾讯MAP API
//我的信用-通化检测
//
我的信用-通化检测
config
.
YYS_APP_KEY
=
process
.
env
.
YYS_APP_KEY
;
config
.
YYS_APP_KEY
=
process
.
env
.
YYS_APP_KEY
;
config
.
YYS_APPLY_APPSECRET
=
process
.
env
.
YYS_APPLY_APPSECRET
;
config
.
YYS_APPLY_APPSECRET
=
process
.
env
.
YYS_APPLY_APPSECRET
;
//
运营商报告
//
运营商报告
config
.
YYS_REPORT_KEY
=
process
.
env
.
YYS_REPORT_KEY
;
config
.
YYS_REPORT_KEY
=
process
.
env
.
YYS_REPORT_KEY
;
config
.
YYS_REPORT_APPSECRET
=
process
.
env
.
YYS_REPORT_APPSECRET
;
config
.
YYS_REPORT_APPSECRET
=
process
.
env
.
YYS_REPORT_APPSECRET
;
config
.
YYS_REPORT_URL
=
process
.
env
.
YYS_REPORT_URL
;
config
.
YYS_REPORT_URL
=
process
.
env
.
YYS_REPORT_URL
;
return
config
;
return
config
;
};
};
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