Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
056e5e55
Commit
056e5e55
authored
Jun 07, 2022
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feat/password
parent
eeae264d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
220 additions
and
12 deletions
+220
-12
config.js
config/config.js
+6
-0
env.config.js
config/env.config.js
+12
-10
AvatarDropdown.jsx
src/components/GlobalHeader/AvatarDropdown.jsx
+9
-2
index.jsx
src/pages/password/index.jsx
+130
-0
service.js
src/pages/password/service.js
+22
-0
style.less
src/pages/password/style.less
+29
-0
login.js
src/services/login.js
+12
-0
No files found.
config/config.js
View file @
056e5e55
...
...
@@ -182,6 +182,12 @@ export default {
icon
:
'
smile
'
,
component
:
'
./PaymentMange
'
,
},
{
path
:
'
/password
'
,
name
:
'
password
'
,
icon
:
'
smile
'
,
component
:
'
./password
'
,
},
// {
// path: '/GoodsManage-new',
// name: 'GoodsManageNew',
...
...
config/env.config.js
View file @
056e5e55
...
...
@@ -2,15 +2,16 @@ const isProduction = process.env.NODE_ENV === 'production';
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
envAPi
=
{
api
:
'
//backstms-
test9
.liangkebang.net
'
,
kdspOpApi
:
'
https://kdsp-operation-
test9
.liangkebang.net
'
,
kdspApi
:
'
https://sc-op-api-
test9
.liangkebang.net
'
,
goodsApi
:
'
https://sc-op-api-
test9
.liangkebang.net
'
,
querysApi
:
'
https://sc-settlement-api-
test9
.liangkebang.net
'
,
api
:
'
//backstms-
vcc3
.liangkebang.net
'
,
kdspOpApi
:
'
https://kdsp-operation-
vcc3
.liangkebang.net
'
,
kdspApi
:
'
https://sc-op-api-
vcc3
.liangkebang.net
'
,
goodsApi
:
'
https://sc-op-api-
vcc3
.liangkebang.net
'
,
querysApi
:
'
https://sc-settlement-api-
vcc3
.liangkebang.net
'
,
// goodsApi: '//192.168.188.111:7000',
prologueDomain
:
'
https://mall-test9.liangkebang.net
'
,
qiniuHost
:
'
https://appsync.lkbang.net
'
,
opapiHost
:
'
https://opapi-test9.liangkebang.net
'
,
prologueDomain
:
'
https://mall-vcc3.liangkebang.net
'
,
// qiniuHost: 'https://appsync.lkbang.net',
qiniuHost
:
'
https://kdspstatic.q-gp.com/
'
,
opapiHost
:
'
https://opapi-vcc3.liangkebang.net
'
,
};
const
prodApi
=
{
...
...
@@ -20,7 +21,8 @@ const prodApi = {
kdspApi
:
'
//sc-op-api.q-gp.com
'
,
// goodsApi: 'https://sc-op-api.q-gp.com', // 测试环境打包域名,
goodsApi
:
'
https://sc-merchant-api.q-gp.com
'
,
// 线上环境打包域名
qiniuHost
:
'
https://appsync.lkbang.net
'
,
qiniuHost
:
'
https://kdspstatic.q-gp.com/
'
,
// talos 后面要下线
opapiHost
:
'
//talos.xyqb.com
'
,
// opapiHost: 'https://opapi.q-gp.com',
// querysApi: 'https://sc-settlement-api.q-gp.com',
...
...
@@ -33,7 +35,7 @@ const preProdApi = {
prologueDomain
:
'
//mall.q-gp.com
'
,
kdspApi
:
'
//sc-op-api-pre.q-gp.com
'
,
goodsApi
:
'
https://sc-merchant-api-pre.q-gp.com
'
,
qiniuHost
:
'
https://
appsync.lkbang.net
'
,
qiniuHost
:
'
https://
kdspstatic.q-gp.com/
'
,
opapiHost
:
'
https://opapi-pre.q-gp.com
'
,
querysApi
:
'
https://sc-settlement-api.q-gp.com
'
,
};
...
...
src/components/GlobalHeader/AvatarDropdown.jsx
View file @
056e5e55
import
{
LogoutOutlined
,
SettingOutlined
,
UserOutlined
}
from
'
@ant-design/icons
'
;
import
{
LogoutOutlined
,
SettingOutlined
,
UserOutlined
,
EditOutlined
}
from
'
@ant-design/icons
'
;
import
{
Avatar
,
Menu
,
Spin
}
from
'
antd
'
;
import
React
from
'
react
'
;
import
{
connect
}
from
'
dva
'
;
...
...
@@ -21,6 +21,10 @@ class AvatarDropdown extends React.Component {
return
;
}
if
(
key
===
'
password
'
)
{
history
.
push
(
'
/password
'
);
return
;
}
history
.
push
(
`/account/
${
key
}
`
);
};
...
...
@@ -48,7 +52,10 @@ class AvatarDropdown extends React.Component {
</
Menu
.
Item
>
)
}
{
menu
&&
<
Menu
.
Divider
/>
}
<
Menu
.
Item
key=
"password"
>
<
EditOutlined
/>
修改密码
</
Menu
.
Item
>
<
Menu
.
Item
key=
"logout"
>
<
LogoutOutlined
/>
退出登录
...
...
src/pages/password/index.jsx
0 → 100644
View file @
056e5e55
import
React
,
{
useRef
,
useState
}
from
'
react
'
;
import
{
Form
,
Input
,
Button
,
Checkbox
,
Card
,
notification
,
Popover
}
from
'
antd
'
;
import
{
history
}
from
'
umi
'
;
import
{
da
}
from
'
date-fns/locale
'
;
import
styles
from
'
./style.less
'
;
import
{
passwordRule
,
resetPassword
}
from
'
./service
'
;
const
Password
=
props
=>
{
const
formRef
=
useRef
();
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
goHome
=
()
=>
{
formRef
.
current
.
resetFields
();
history
.
push
(
'
/
'
);
};
const
submit
=
async
record
=>
{
const
data
=
await
resetPassword
({
password
:
record
.
password
,
newPassword
:
record
.
newPassword
,
});
if
(
data
.
code
===
2000
)
{
notification
.
success
({
message
:
'
修改成功
'
,
});
setTimeout
(()
=>
{
goHome
();
},
1000
);
setLoading
(
false
);
}
else
{
setLoading
(
false
);
notification
.
error
({
message
:
data
.
detail
||
data
.
msg
,
});
}
};
const
rule
=
async
record
=>
{
const
data
=
await
passwordRule
({
password
:
record
.
newPassword
});
if
(
data
.
code
===
2000
)
{
submit
(
record
);
}
else
{
setLoading
(
false
);
notification
.
warning
({
message
:
data
.
detail
||
data
.
msg
,
});
}
};
const
onFinish
=
values
=>
{
setLoading
(
true
);
rule
(
values
);
};
return
(
<
div
className=
{
styles
.
div
}
>
<
Card
className=
{
styles
.
card
}
>
<
p
>
修改密码
</
p
>
<
Form
initialValues=
{
{
remember
:
true
}
}
onFinish=
{
onFinish
}
autoComplete=
"off"
className=
{
styles
.
form
}
ref=
{
formRef
}
// labelCol={{
// span: 16,
// }}
// wrapperCol={{
// span: 16,
// }}
>
<
Form
.
Item
name=
"password"
rules=
{
[{
required
:
true
,
message
:
'
请输入原密码!
'
}]
}
>
<
Input
.
Password
placeholder=
"输入原密码"
/>
</
Form
.
Item
>
<
Popover
content=
"限13-18字符,包含大小写字母、数字和特殊字符"
placement=
"right"
trigger=
"hover"
>
<
Form
.
Item
name=
"newPassword"
validateFirst
rules=
{
[
{
required
:
true
,
message
:
'
请输入新密码!
'
},
{
min
:
13
,
message
:
'
密码最少13位
'
},
{
max
:
18
,
message
:
'
密码最多18位
'
},
{
message
:
'
至少13位且必须包含大小写字母、数字和特殊字符
'
,
pattern
:
/
(?=
.*
\d)(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
[^
a-zA-Z0-9
])
.{13,18}/
,
},
]
}
>
<
Input
.
Password
placeholder=
"输入新密码"
/>
</
Form
.
Item
>
</
Popover
>
<
Form
.
Item
name=
"newPasswordAgain"
validateFirst
rules=
{
[
{
required
:
true
,
message
:
'
请输入新密码!
'
},
{
min
:
13
,
message
:
'
密码最少13位
'
},
{
max
:
18
,
message
:
'
密码最多18位
'
},
{
message
:
'
至少13位且必须包含大小写字母、数字和特殊字符
'
,
pattern
:
/
(?=
.*
\d)(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
[^
a-zA-Z0-9
])
.{13,18}/
,
},
({
getFieldValue
})
=>
({
validator
(
val
,
value
)
{
if
(
value
&&
getFieldValue
(
'
newPassword
'
)
!==
value
)
{
// eslint-disable-next-line prefer-promise-reject-errors
return
Promise
.
reject
(
'
两次密码输入不一致
'
);
}
return
Promise
.
resolve
();
},
}),
]
}
>
<
Input
.
Password
placeholder=
"输入新密码"
/>
</
Form
.
Item
>
<
Form
.
Item
className=
{
styles
.
btn
}
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
确认修改
</
Button
>
<
Button
type=
"primary"
ghost
onClick=
{
goHome
}
>
返回首页
</
Button
>
</
Form
.
Item
>
</
Form
>
</
Card
>
</
div
>
);
};
export
default
Password
;
src/pages/password/service.js
0 → 100644
View file @
056e5e55
import
request
from
'
@/utils/request
'
;
import
config
from
'
../../../config/env.config
'
;
const
{
api
}
=
config
;
// 商户后台密码修改-校验
export
async
function
passwordRule
(
params
)
{
const
data
=
await
request
.
post
(
'
/user/ex/validate-password-rule
'
,
{
prefix
:
api
,
data
:
params
,
});
return
data
;
}
// 商户后台密码修改
export
async
function
resetPassword
(
params
)
{
const
data
=
await
request
.
post
(
'
/user/ex/supply/reset-password
'
,
{
prefix
:
api
,
data
:
params
,
});
return
data
;
}
src/pages/password/style.less
0 → 100644
View file @
056e5e55
.div {
width: 100%;
}
.card {
width: 70%;
margin: 0 auto;
padding: 30px 0;
.form {
width: 40%;
margin: 0 auto;
}
p {
margin-bottom: 30px;
font-weight: bold;
font-size: 18px;
text-align: center;
}
.btn {
margin: 0 auto;
text-align: center;
button {
&:first-child {
width: 200px;
margin-right: 10px;
margin-bottom: 10px;
}
}
}
}
src/services/login.js
View file @
056e5e55
...
...
@@ -14,3 +14,15 @@ export async function getFakeCaptcha(mobile) {
export
async
function
getResFreshToen
(
token
)
{
return
request
(
`/oauth/refreshtoken?refreshtoken=
${
token
}
`
);
}
// 商户后台密码修改-校验
export
async
function
passwordRule
(
params
)
{
return
request
.
post
(
'
/user/ex/validate-password-rule
'
,
{
data
:
params
,
});
}
// 商户后台密码修改
export
async
function
resetPassword
(
params
)
{
const
data
=
await
request
.
post
(
'
/user/ex/supply/reset-password
'
,
{
data
:
params
});
return
data
;
}
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