Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cmb_auth
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
cmb_auth
Commits
35d2efe2
Commit
35d2efe2
authored
Oct 08, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
485af4be
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
12 deletions
+10
-12
.DS_Store
.DS_Store
+0
-0
index.js
mock/index.js
+2
-2
sparkrc.js
sparkrc.js
+2
-2
apicfg.js
src/api/apicfg.js
+2
-2
app.jsx
src/app.jsx
+4
-6
No files found.
.DS_Store
View file @
35d2efe2
No preview for this file type
mock/index.js
View file @
35d2efe2
...
@@ -5,8 +5,8 @@ const generateApproval = require("./common/generateApproval");
...
@@ -5,8 +5,8 @@ const generateApproval = require("./common/generateApproval");
const
generateLoginUrl
=
require
(
"./common/generateLoginUrl"
);
const
generateLoginUrl
=
require
(
"./common/generateLoginUrl"
);
const
proxy
=
{
const
proxy
=
{
"GET /c
ustomActivity
/cmbautologin/generateApproval"
:
generateApproval
,
"GET /c
hw
/cmbautologin/generateApproval"
:
generateApproval
,
"GET /c
ustomActivity
/cmbautologin/generateLoginUrl"
:
generateLoginUrl
,
"GET /c
hw
/cmbautologin/generateLoginUrl"
:
generateLoginUrl
,
"GET /projectRule.query"
:
rule
,
"GET /projectRule.query"
:
rule
,
"GET /drawNum.query"
:
drawNum
"GET /drawNum.query"
:
drawNum
};
};
...
...
sparkrc.js
View file @
35d2efe2
...
@@ -9,6 +9,6 @@ module.exports ={
...
@@ -9,6 +9,6 @@ module.exports ={
"IMAGE_Q1"
:
0.6
,
"IMAGE_Q1"
:
0.6
,
"IMAGE_Q2"
:
0.8
,
"IMAGE_Q2"
:
0.8
,
"RES_PATH"
:
"/src/assets/"
,
"RES_PATH"
:
"/src/assets/"
,
"RES_PATH_PROD"
:
"//yun.duiba.com.cn/spark/v2/temp_base/163
2981807428
"
,
"RES_PATH_PROD"
:
"//yun.duiba.com.cn/spark/v2/temp_base/163
3660597490
"
,
"JS_PATH_PROD"
:
"https://yun.duiba.com.cn/spark/v2/temp_base/163
2981809441
/js"
"JS_PATH_PROD"
:
"https://yun.duiba.com.cn/spark/v2/temp_base/163
3660599708
/js"
}
}
\ No newline at end of file
src/api/apicfg.js
View file @
35d2efe2
const
apiCfg
=
{
const
apiCfg
=
{
getRule
:
`projectRule.query`
,
getRule
:
`projectRule.query`
,
generateApproval
:
`/c
ustomActivity
/cmbautologin/generateApproval`
,
generateApproval
:
`/c
hw
/cmbautologin/generateApproval`
,
generateLoginUrl
:
`/c
ustomActivity
/cmbautologin/generateLoginUrl`
,
generateLoginUrl
:
`/c
hw
/cmbautologin/generateLoginUrl`
,
doJoin
:
{
doJoin
:
{
uri
:
`join.do`
,
uri
:
`join.do`
,
method
:
"post"
method
:
"post"
...
...
src/app.jsx
View file @
35d2efe2
...
@@ -14,8 +14,6 @@ MD();
...
@@ -14,8 +14,6 @@ MD();
class
App
extends
Component
{
class
App
extends
Component
{
async
componentDidMount
()
{
async
componentDidMount
()
{
const
{
code
}
=
queryParams
;
const
{
code
}
=
queryParams
;
if
(
code
)
{
//获取到code
if
(
code
)
{
//获取到code
...
@@ -28,11 +26,11 @@ class App extends Component {
...
@@ -28,11 +26,11 @@ class App extends Component {
}
else
{
//没有获取到code
}
else
{
//没有获取到code
//请求授权协议
//请求授权协议
//
const generateApprovalResult = await API.generateApproval();
const
generateApprovalResult
=
await
API
.
generateApproval
();
//
const { protocol } = generateApprovalResult;
const
{
protocol
}
=
generateApprovalResult
;
console
.
error
(
202
)
//
console.error(202)
const
protocol
=
'cmblife://approval?aid=9dad6d3900ec3ffabd80e46522a10ead&callback=https%3A%2F%2Ftest.com%2Fmerchant%2FapprovalCallback.html&clientType=h5&date=20210930134315&keyAlias=CO_PUB_KEY_SM2&mid=f806c259d86e3b9aa956c98d475b6af7&random=6d5e7923308d489b969376cdb448072c&responseType=code&scope=defaultScope&sign=MEUCICIfC6OJFUUHYAIKlswzWvy2H%2BCPSyebZLb48OoTdqRaAiEA6UlFWD2Qd6OHBC0Cd69kFuu8%2FplOiddP%2FCcdokhPPoE%3D&state=state'
;
//
const protocol = 'cmblife://approval?aid=9dad6d3900ec3ffabd80e46522a10ead&callback=https%3A%2F%2Ftest.com%2Fmerchant%2FapprovalCallback.html&clientType=h5&date=20210930134315&keyAlias=CO_PUB_KEY_SM2&mid=f806c259d86e3b9aa956c98d475b6af7&random=6d5e7923308d489b969376cdb448072c&responseType=code&scope=defaultScope&sign=MEUCICIfC6OJFUUHYAIKlswzWvy2H%2BCPSyebZLb48OoTdqRaAiEA6UlFWD2Qd6OHBC0Cd69kFuu8%2FplOiddP%2FCcdokhPPoE%3D&state=state';
// var redirectUrl = "https://open.cmbchina.com/DevEnv/redirect/auth"
// var redirectUrl = "https://open.cmbchina.com/DevEnv/redirect/auth"
// + "?protocol=" + encodeURIComponent(protocol)
// + "?protocol=" + encodeURIComponent(protocol)
// + "&merchantApprovalUrl=" + encodeURIComponent(window.location.href);
// + "&merchantApprovalUrl=" + encodeURIComponent(window.location.href);
...
...
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