Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
4eb766ab
Commit
4eb766ab
authored
Aug 28, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频安全问题
parent
c4fb1d65
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
81 deletions
+84
-81
package.json
+1
-1
src/.eslintignore
+0
-2
src/common/HeaderBar/index.js
+0
-4
src/components/examination/index.js
+1
-1
src/components/ml/index.js
+3
-3
src/components/passport/setPassword/index.js
+79
-67
src/components/scholarship/DrawDocument/DrawDocument.js
+0
-3
No files found.
package.json
View file @
4eb766ab
...
@@ -130,7 +130,7 @@
...
@@ -130,7 +130,7 @@
}
}
},
},
"lint-staged"
:
{
"lint-staged"
:
{
"*.(js|css)"
:
"prettier --write"
"*.(js|css)"
:
[
"prettier --write"
,
"git add ."
]
},
},
"eslintConfig"
:
{
"eslintConfig"
:
{
"extends"
:
"react-app"
,
"extends"
:
"react-app"
,
...
...
src/.eslintignore
deleted
100644 → 0
View file @
c4fb1d65
src/
\ No newline at end of file
src/common/HeaderBar/index.js
View file @
4eb766ab
...
@@ -4,10 +4,6 @@ import { withRouter } from "react-router-dom"
...
@@ -4,10 +4,6 @@ import { withRouter } from "react-router-dom"
import
{
browser
,
getParam
}
from
"src/utils"
import
{
browser
,
getParam
}
from
"src/utils"
class
HeaderBar
extends
Component
{
class
HeaderBar
extends
Component
{
constructor
(
props
)
{
super
(
props
)
}
goBack
=
()
=>
{
goBack
=
()
=>
{
const
{
state
,
hash
}
=
this
.
props
.
location
const
{
state
,
hash
}
=
this
.
props
.
location
if
(
hash
.
includes
(
"goback"
))
{
if
(
hash
.
includes
(
"goback"
))
{
...
...
src/components/examination/index.js
View file @
4eb766ab
...
@@ -4,7 +4,7 @@ import classnames from "classnames"
...
@@ -4,7 +4,7 @@ import classnames from "classnames"
import
{
HeaderBar
,
Tag
}
from
"../../common"
import
{
HeaderBar
,
Tag
}
from
"../../common"
import
OpenApp
from
"./OpenApp"
import
OpenApp
from
"./OpenApp"
import
{
http
,
htmlDecode
}
from
"src/utils"
import
{
http
}
from
"src/utils"
import
{
Object
}
from
"core-js"
import
{
Object
}
from
"core-js"
export
default
class
Examination
extends
PureComponent
{
export
default
class
Examination
extends
PureComponent
{
...
...
src/components/ml/index.js
View file @
4eb766ab
...
@@ -77,7 +77,7 @@ class ML extends Component {
...
@@ -77,7 +77,7 @@ class ML extends Component {
},
},
function
(
res
)
{
function
(
res
)
{
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
)
{
if
(
res
.
err_msg
==
=
"get_brand_wcpay_request:ok"
)
{
Toast
.
info
(
"支付成功"
,
2
)
Toast
.
info
(
"支付成功"
,
2
)
_this
.
intervalPayStatus
=
setInterval
(
function
()
{
_this
.
intervalPayStatus
=
setInterval
(
function
()
{
http
http
...
@@ -157,7 +157,7 @@ class ML extends Component {
...
@@ -157,7 +157,7 @@ class ML extends Component {
// 保存cookie
// 保存cookie
appLogin
=
()
=>
{
appLogin
=
()
=>
{
let
expires
=
addDays
(
new
Date
(),
90
)
let
expires
=
addDays
(
new
Date
(),
90
)
this
.
state
.
userInfoList
.
map
((
item
,
index
)
=>
{
this
.
state
.
userInfoList
.
forEach
((
item
)
=>
{
cookie
.
set
(
"token"
,
item
.
token
,
{
cookie
.
set
(
"token"
,
item
.
token
,
{
expires
,
expires
,
path
:
"/"
,
path
:
"/"
,
...
@@ -198,7 +198,7 @@ class ML extends Component {
...
@@ -198,7 +198,7 @@ class ML extends Component {
transformUser
=
(
res
)
=>
{
transformUser
=
(
res
)
=>
{
let
payload
let
payload
res
.
map
((
item
,
index
)
=>
{
res
.
forEach
((
item
,
index
)
=>
{
payload
=
{
payload
=
{
hasError
:
false
,
hasError
:
false
,
data
:
{
data
:
{
...
...
src/components/passport/setPassword/index.js
View file @
4eb766ab
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
"react"
import
'./set-password.scss'
import
"./set-password.scss"
import
{
withFormik
,
Form
,
Field
}
from
"formik"
import
{
withFormik
,
Form
,
Field
}
from
"formik"
import
PasswordInput
from
'../common/passwordInput'
import
PasswordInput
from
"../common/passwordInput"
import
Button
from
'../common/Button'
import
Button
from
"../common/Button"
import
classnames
from
'classnames'
import
classnames
from
"classnames"
import
{
compose
}
from
'redux'
import
{
compose
}
from
"redux"
import
{
HeaderBar
}
from
"src/common"
import
{
HeaderBar
}
from
"src/common"
import
{
http
}
from
"src/utils"
import
{
http
}
from
"src/utils"
import
{
Toast
}
from
"antd-mobile"
import
{
Toast
}
from
"antd-mobile"
import
{
encrypt
}
from
"src/components/passport/encryption"
import
{
encrypt
}
from
"src/components/passport/encryption"
import
{
isEmpty
}
from
"lodash"
import
{
isEmpty
}
from
"lodash"
import
{
connect
}
from
"react-redux"
import
{
connect
}
from
"react-redux"
import
{
setCurrentUser
}
from
'src/store/userAction'
import
{
setCurrentUser
}
from
"src/store/userAction"
import
jsCookie
from
'js-cookie'
import
jsCookie
from
"js-cookie"
class
SetPassword
extends
Component
{
class
SetPassword
extends
Component
{
toFrom
=
()
=>
{
toFrom
=
()
=>
{
let
historyUrl
=
window
.
localStorage
.
getItem
(
'HistoryUrl'
)
let
historyUrl
=
window
.
localStorage
.
getItem
(
"HistoryUrl"
)
const
{
history
}
=
this
.
props
const
{
history
}
=
this
.
props
history
.
push
(
historyUrl
)
history
.
push
(
historyUrl
)
}
}
render
()
{
render
()
{
let
{
values
,
errors
,
location
}
=
this
.
props
let
{
values
,
errors
,
location
}
=
this
.
props
let
{
from
}
=
location
.
state
||
{
from
:
{
pathname
:
'/'
}
}
let
{
from
}
=
location
.
state
||
{
from
:
{
pathname
:
"/"
}
}
return
(
return
(
<>
<>
<
HeaderBar
arrow
=
{
true
}
title
=
{
'设置密码'
}
/
>
<
HeaderBar
arrow
=
{
true
}
title
=
{
"设置密码"
}
/
>
<
div
className
=
{
'set-password'
}
>
<
div
className
=
{
"set-password"
}
>
<
p
className
=
'title'
>
密码需要包含
6
-
16
位字母及数字
<
/p
>
<
p
className
=
"title"
>
密码需要包含
6
-
16
位字母及数字
<
/p
>
<
Form
>
<
Form
>
<
Field
<
Field
name
=
"password"
>
name
=
'password'
{({
field
})
=>
{
>
{({
field
})
=>
{
return
(
return
(
<
PasswordInput
<
PasswordInput
autoComplete
=
{
'on'
}
autoComplete
=
{
"on"
}
placeholder
=
{
'设置密码'
}
placeholder
=
{
"设置密码"
}
onChange
=
{
this
.
handleChange
}
onChange
=
{
this
.
handleChange
}
{...
field
}
{...
field
}
/
>
/
>
)
)
}}
}}
<
/Field
>
<
/Field
>
<
Button
className
=
{
'btn-active'
}
<
Button
active
=
{
values
.
password
&&
values
.
agreement
&&
isEmpty
(
errors
)}
>
完成
<
/Button
>
className
=
{
"btn-active"
}
<
label
htmlFor
=
"agreement"
className
=
'user-agreement'
>
active
=
{
values
.
password
&&
values
.
agreement
&&
isEmpty
(
errors
)}
<
Field
type
=
'checkbox'
>
name
=
'agreement'
完成
id
=
'agreement'
<
/Button
>
<
label
htmlFor
=
"agreement"
className
=
"user-agreement"
>
<
Field
type
=
"checkbox"
name
=
"agreement"
id
=
"agreement"
className
=
{
classnames
([
className
=
{
classnames
([
this
.
props
.
values
.
agreement
?
'iconfont iconRectangleCopy'
:
'disagree'
this
.
props
.
values
.
agreement
?
"iconfont iconRectangleCopy"
:
"disagree"
,
])}
])}
/
>
/
>
同意
<
span
>
《七月在线用户使用协议》
<
/span
>
同意
<
span
>
《七月在线用户使用协议》
<
/span
>
<
/label
>
<
/label
>
<
/Form
>
<
/Form
>
<
div
className
=
"skip"
<
div
style
=
{{
display
:
from
&&
from
.
pathname
.
includes
(
'forgot-password'
)
?
'none'
:
'block'
}}
>
className
=
"skip"
style
=
{{
display
:
from
&&
from
.
pathname
.
includes
(
"forgot-password"
)
?
"none"
:
"block"
,
}}
>
<
span
onClick
=
{
this
.
toFrom
}
>
跳过
<
/span
>
<
span
onClick
=
{
this
.
toFrom
}
>
跳过
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -73,51 +82,54 @@ class SetPassword extends Component {
...
@@ -73,51 +82,54 @@ class SetPassword extends Component {
const
formikConfig
=
{
const
formikConfig
=
{
mapPropsToValues
()
{
mapPropsToValues
()
{
return
{
return
{
password
:
''
,
password
:
""
,
agreement
:
true
agreement
:
true
,
}
}
},
},
handleSubmit
:
(
values
,
{
props
})
=>
{
handleSubmit
:
(
values
,
{
props
})
=>
{
const
{
location
}
=
props
const
{
location
}
=
props
let
from
=
location
.
state
&&
location
.
state
.
records
&&
location
.
state
.
records
[
location
.
state
.
records
.
length
-
2
]
||
{
pathname
:
'/'
}
let
from
=
(
location
.
state
&&
if
(
from
.
pathname
.
includes
(
'forgot-password'
))
{
location
.
state
.
records
&&
location
.
state
.
records
[
location
.
state
.
records
.
length
-
2
])
||
{
pathname
:
"/"
,
}
if
(
from
.
pathname
.
includes
(
"forgot-password"
))
{
forgotPasswordReset
(
values
,
props
)
forgotPasswordReset
(
values
,
props
)
}
else
{
}
else
{
bindMobileSetPassword
(
values
,
props
)
bindMobileSetPassword
(
values
,
props
)
}
}
},
},
validateOnChange
:
false
,
validateOnChange
:
false
,
validate
:
values
=>
{
validate
:
(
values
)
=>
{
let
errors
=
{}
let
errors
=
{}
const
re
=
/^
(?![
0-9
]
+$
)(?![
a-zA-Z
]
+$
)[
0-9A-Za-z
]{6,16}
$/
const
re
=
/^
(?![
0-9
]
+$
)(?![
a-zA-Z
]
+$
)[
0-9A-Za-z
]{6,16}
$/
if
(
!
re
.
test
(
values
.
password
))
{
if
(
!
re
.
test
(
values
.
password
))
{
errors
.
password
=
'密码需要包含6-16位字母及数字'
errors
.
password
=
"密码需要包含6-16位字母及数字"
Toast
.
info
(
errors
.
password
,
2
,
null
,
false
)
Toast
.
info
(
errors
.
password
,
2
,
null
,
false
)
}
}
if
(
!
values
.
agreement
)
{
if
(
!
values
.
agreement
)
{
errors
.
agreement
=
'您须同意《七月在线用户使用协议》'
errors
.
agreement
=
"您须同意《七月在线用户使用协议》"
Toast
.
info
(
errors
.
agreement
,
2
,
null
,
false
)
Toast
.
info
(
errors
.
agreement
,
2
,
null
,
false
)
}
}
return
errors
return
errors
}
}
,
}
}
function
forgotPasswordReset
(
values
,
props
)
{
function
forgotPasswordReset
(
values
,
props
)
{
let
key
=
sessionStorage
.
getItem
(
'r_type'
)
===
'email'
?
'email'
:
'tel'
let
key
=
sessionStorage
.
getItem
(
"r_type"
)
===
"email"
?
"email"
:
"tel"
let
requestKey
=
key
===
'email'
?
'email'
:
'phone'
let
requestKey
=
key
===
"email"
?
"email"
:
"phone"
http
.
post
(
`
${
API
[
'passport-api'
]}
/account/up_pass_by_
${
requestKey
}
`
,
{
http
.
post
(
`
${
API
[
"passport-api"
]}
/account/up_pass_by_
${
requestKey
}
`
,
{
[
requestKey
]:
sessionStorage
.
getItem
(
key
),
[
requestKey
]:
sessionStorage
.
getItem
(
key
),
password
:
encrypt
(
values
.
password
)
password
:
encrypt
(
values
.
password
),
})
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
data
.
errno
==
200
)
{
if
(
res
.
data
.
errno
==
200
)
{
Toast
.
info
(
'密码设置成功'
)
Toast
.
info
(
"密码设置成功"
)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
props
.
history
.
replace
(
'/passport/account-login'
)
props
.
history
.
replace
(
"/passport/account-login"
)
},
1000
)
},
1000
)
}
else
{
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
,
null
,
false
)
Toast
.
info
(
res
.
data
.
msg
,
2
,
null
,
false
)
...
@@ -126,17 +138,20 @@ function forgotPasswordReset(values, props) {
...
@@ -126,17 +138,20 @@ function forgotPasswordReset(values, props) {
}
}
function
bindMobileSetPassword
(
values
,
props
)
{
function
bindMobileSetPassword
(
values
,
props
)
{
let
uid
=
jsCookie
.
get
(
'uid'
)
let
uid
=
jsCookie
.
get
(
"uid"
)
http
.
post
(
`
${
API
[
'passport-api'
]}
/bind_mobile/set_pwd_new`
,
{
http
.
post
(
`
${
API
[
"passport-api"
]}
/bind_mobile/set_pwd_new`
,
{
uid
:
props
.
user
.
data
.
uid
||
uid
,
uid
:
props
.
user
.
data
.
uid
||
uid
,
password
:
encrypt
(
values
.
password
)
password
:
encrypt
(
values
.
password
),
})
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
data
.
errno
==
200
)
{
if
(
res
.
data
.
errno
==
200
)
{
const
{
location
,
history
}
=
props
const
{
location
,
history
}
=
props
Toast
.
info
(
'密码设置成功'
)
Toast
.
info
(
"密码设置成功"
)
let
from
=
location
.
state
&&
location
.
state
.
from
||
{
pathname
:
'/'
}
let
from
=
(
location
.
state
&&
location
.
state
.
from
)
||
{
pathname
:
"/"
}
let
local_redirect_url
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'binding_redirect'
))
let
local_redirect_url
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
"binding_redirect"
)
)
// setTimeout(function () {
// setTimeout(function () {
// if (local_redirect_url) {
// if (local_redirect_url) {
...
@@ -147,10 +162,10 @@ function bindMobileSetPassword(values, props) {
...
@@ -147,10 +162,10 @@ function bindMobileSetPassword(values, props) {
// }
// }
// }, 1000)
// }, 1000)
let
HistoryUrl
=
window
.
localStorage
.
getItem
(
'HistoryUrl'
)
let
HistoryUrl
=
window
.
localStorage
.
getItem
(
"HistoryUrl"
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
HistoryUrl
)
{
if
(
HistoryUrl
)
{
let
historyUrl
=
window
.
localStorage
.
getItem
(
'HistoryUrl'
)
let
historyUrl
=
window
.
localStorage
.
getItem
(
"HistoryUrl"
)
props
.
history
.
push
(
historyUrl
)
props
.
history
.
push
(
historyUrl
)
}
else
{
}
else
{
history
.
replace
(
from
.
pathname
)
history
.
replace
(
from
.
pathname
)
...
@@ -163,9 +178,6 @@ function bindMobileSetPassword(values, props) {
...
@@ -163,9 +178,6 @@ function bindMobileSetPassword(values, props) {
}
}
export
default
compose
(
export
default
compose
(
connect
(
connect
((
state
)
=>
({
user
:
state
.
user
}),
{
setCurrentUser
}),
state
=>
({
user
:
state
.
user
}),
{
setCurrentUser
}
),
withFormik
(
formikConfig
)
withFormik
(
formikConfig
)
)(
SetPassword
)
)(
SetPassword
)
src/components/scholarship/DrawDocument/DrawDocument.js
View file @
4eb766ab
...
@@ -4,9 +4,6 @@ import "./DrawDocument.scss"
...
@@ -4,9 +4,6 @@ import "./DrawDocument.scss"
import
OpenApp
from
"src/common/CallApp"
import
OpenApp
from
"src/common/CallApp"
export
default
class
DrawDocument
extends
Component
{
export
default
class
DrawDocument
extends
Component
{
constructor
(
props
)
{
super
(
props
)
}
render
()
{
render
()
{
return
(
return
(
<
div
className
=
{
"drawDocument"
}
>
<
div
className
=
{
"drawDocument"
}
>
...
...
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