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
5ed10fad
Commit
5ed10fad
authored
Sep 28, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
45c77fba
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
3 deletions
+49
-3
.DS_Store
.DS_Store
+0
-0
generateApproval.js
mock/common/generateApproval.js
+4
-0
generateLoginUrl.js
mock/common/generateLoginUrl.js
+4
-0
index.js
mock/index.js
+4
-0
index.html
public/index.html
+7
-1
apicfg.js
src/api/apicfg.js
+2
-0
app.jsx
src/app.jsx
+28
-2
No files found.
.DS_Store
View file @
5ed10fad
No preview for this file type
mock/common/generateApproval.js
0 → 100644
View file @
5ed10fad
module
.
exports
=
{
"data"
:
3
,
"success"
:
true
}
\ No newline at end of file
mock/common/generateLoginUrl.js
0 → 100644
View file @
5ed10fad
module
.
exports
=
{
"data"
:
3
,
"success"
:
true
}
\ No newline at end of file
mock/index.js
View file @
5ed10fad
const
rule
=
require
(
"./common/rule"
);
const
drawNum
=
require
(
"./common/drawNum"
);
const
generateApproval
=
require
(
"./common/generateApproval"
);
const
generateLoginUrl
=
require
(
"./common/generateLoginUrl"
);
const
proxy
=
{
"GET /customActivity/cmbautologin/generateApproval"
:
generateApproval
,
"GET /customActivity/cmbautologin/generateLoginUrl"
:
generateLoginUrl
,
"GET /projectRule.query"
:
rule
,
"GET /drawNum.query"
:
drawNum
};
...
...
public/index.html
View file @
5ed10fad
...
...
@@ -9,6 +9,12 @@
<script
src=
"//yun.duiba.com.cn/spark/v2/spark.base.fz.wxpollyfill.js"
></script>
<script
src=
"//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"
></script>
<script
src=
"//yun.duiba.com.cn/h5/lib/zepto.min.js"
></script>
<!-- cmblifeSDK -->
<!-- <script src="//yun.duiba.com.cn/aurora/assets/1f77f067b23f29cbab785a417db977b3bde8d809.js"></script> -->
<!-- cmblifeSDK-Dev -->
<script
src=
"//yun.duiba.com.cn/aurora/assets/a2ea866799a083bc624ed081af653884ad066779.js"
></script>
<script>
function
getApp
()
{
return
{
...
...
@@ -53,4 +59,4 @@
</body>
</html>
</html>
\ No newline at end of file
src/api/apicfg.js
View file @
5ed10fad
const
apiCfg
=
{
getRule
:
`projectRule.query`
,
generateApproval
:
`/customActivity/cmbautologin/generateApproval`
,
generateLoginUrl
:
`/customActivity/cmbautologin/generateLoginUrl`
,
doJoin
:
{
uri
:
`join.do`
,
method
:
"post"
...
...
src/app.jsx
View file @
5ed10fad
import
{
queryParams
}
from
"duiba-utils"
;
import
React
,
{
Component
}
from
"react"
;
import
ReactDOM
from
"react-dom"
;
import
MD
from
'../MD'
;
import
"../monitor.js"
;
//前端错误监控
import
"./app.less"
;
import
Modal
from
'./modal/modal'
;
import
MD
from
'../MD'
;
MD
();
import
"../monitor.js"
;
//前端错误监控
//此处为spark-cli动态生成
class
App
extends
Component
{
async
componentDidMount
()
{
const
{
code
}
=
queryParams
;
if
(
code
)
{
//获取到code
const
generateLoginUrlResult
=
await
API
.
generateLoginUrl
({
redirectUrl
:
""
,
cmbData
:
code
});
location
.
href
=
generateLoginUrlResult
.
data
;
}
else
{
//没有获取到code
//请求授权协议
const
generateApprovalResult
=
await
API
.
generateApproval
();
var
redirectUrl
=
"https://open.cmbchina.com/DevEnv/redirect/auth"
+
"?protocol="
+
encodeURIComponent
(
protocol
)
+
"&merchantApprovalUrl="
+
encodeURIComponent
(
window
.
location
.
href
);
window
.
location
.
href
=
redirectUrl
;
}
}
render
()
{
return
(
<
div
>
...
...
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