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
d97eee58
Commit
d97eee58
authored
Nov 01, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
7d2b8693
Pipeline
#15708
passed with stage
in 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
wechat.js
app/controller/gjj/wechat.js
+2
-2
No files found.
app/controller/gjj/wechat.js
View file @
d97eee58
...
@@ -20,8 +20,8 @@ class WechatController extends Controller {
...
@@ -20,8 +20,8 @@ class WechatController extends Controller {
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'
].
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
)
{
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
.
OUT_P_NODE
_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
.
PHP
_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`
...
...
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