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
cbeecb20
Commit
cbeecb20
authored
Oct 31, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ce611868
Pipeline
#15671
passed with stage
in 1 minute 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
wechat.js
app/controller/gjj/wechat.js
+2
-1
No files found.
app/controller/gjj/wechat.js
View file @
cbeecb20
...
...
@@ -4,6 +4,7 @@ const Controller = require('egg').Controller;
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_TEST
=
'wxa9df2d60730b25d9'
;
const
WECHAT_SECRET
=
'b369fd28a9f9320ebe4e35dfaa00b194'
;
const
WECHAT_SECRET_TEST
=
'dfede7a3b543149a88b07b46bcc28e00'
;
const
REDIRECT_PAGE
=
'/webserve/accumulation/index'
;
...
...
@@ -16,7 +17,7 @@ class WechatController extends Controller {
const
{
ctx
}
=
this
;
const
code
=
ctx
.
query
.
code
;
const
channel_id
=
ctx
.
query
.
channel_id
;
const
app_id
=
ctx
.
query
.
app_id
||
WECHAT_APPID
;
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
;
if
(
!
code
||
code
.
length
===
0
)
{
const
target_url
=
WECHAT_CODE_URL
+
`?appid=
${
app_id
}
&redirect_uri=
${
encodeURIComponent
(
`
${
this
.
app
.
config
.
OUT_P_NODE_URL
}
/51business/api/gjj/wechat/oauth_login?&channel_id=
${
channel_id
}
`
)}
&response_type=code&scope=snsapi_base&state=gjjquery#wechat_redirect`
;
...
...
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