Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat-common
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
wechat-common
Commits
9976fabc
Commit
9976fabc
authored
Jan 05, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:处理获取url中的参数的方式
parent
98cc1a4a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
src/common/js/function.js
+16
-0
src/index.tsx
+2
-1
src/modules/authorize/index.jsx
+5
-2
No files found.
src/common/js/function.js
0 → 100644
View file @
9976fabc
/*
* @Author: zhangleyuan
* @Date: 2021-01-05 17:30:54
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-05 17:34:34
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
window
.
getParameterByName
=
function
(
name
)
{
name
=
name
.
replace
(
/
[\\
[
]
/
,
'
\\
['
).
replace
(
/
[\]]
/
,
'
\\
]'
);
const
regex
=
new
RegExp
(
'[
\\
?&]'
+
name
+
'=([^&#]*)'
);
const
results
=
regex
.
exec
(
window
.
location
.
href
);
return
results
===
null
?
''
:
decodeURIComponent
(
results
[
1
].
replace
(
/
\+
/g
,
' '
));
};
\ No newline at end of file
src/index.tsx
View file @
9976fabc
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-04-27 20:35:34
* @Date: 2020-04-27 20:35:34
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-0
4 18:23:21
* @LastEditTime: 2021-01-0
5 17:36:15
* @Description:
* @Description:
*/
*/
...
@@ -20,6 +20,7 @@ import { VerifyInfo } from '@/domains/basic-domain/interface';
...
@@ -20,6 +20,7 @@ import { VerifyInfo } from '@/domains/basic-domain/interface';
import
'antd/dist/antd.less'
;
import
'antd/dist/antd.less'
;
import
'@/common/less/index.less'
;
import
'@/common/less/index.less'
;
import
'@/common/js/function'
;
import
App
from
'./App'
;
import
App
from
'./App'
;
...
...
src/modules/authorize/index.jsx
View file @
9976fabc
...
@@ -14,8 +14,11 @@ class Authorize extends React.Component {
...
@@ -14,8 +14,11 @@ class Authorize extends React.Component {
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
const
searchParams
=
this
.
props
.
location
.
search
;
// console.log("ticket",window.getParameterByName('ticket'))
const
{
code
,
ticket
}
=
queryString
.
parse
(
searchParams
);
// const searchParams = this.props.location.search;
// const {code,ticket} = queryString.parse(searchParams);
const
code
=
window
.
getParameterByName
(
'code'
);
const
ticket
=
window
.
getParameterByName
(
'ticket'
);
this
.
setState
({
this
.
setState
({
code
,
code
,
ticket
ticket
...
...
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