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
1fdf38b4
Commit
1fdf38b4
authored
May 25, 2022
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 接口联调完成
parent
2bb7f4e0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
25 deletions
+88
-25
env.config.js
config/env.config.js
+7
-7
index.jsx
src/pages/password/index.jsx
+47
-18
service.js
src/pages/password/service.js
+22
-0
login.js
src/services/login.js
+12
-0
No files found.
config/env.config.js
View file @
1fdf38b4
...
@@ -2,15 +2,15 @@ const isProduction = process.env.NODE_ENV === 'production';
...
@@ -2,15 +2,15 @@ const isProduction = process.env.NODE_ENV === 'production';
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
envAPi
=
{
const
envAPi
=
{
api
:
'
//backstms-
test4
.liangkebang.net
'
,
api
:
'
//backstms-
vcc3
.liangkebang.net
'
,
kdspOpApi
:
'
https://kdsp-operation-
test4
.liangkebang.net
'
,
kdspOpApi
:
'
https://kdsp-operation-
vcc3
.liangkebang.net
'
,
kdspApi
:
'
https://sc-op-api-
test4
.liangkebang.net
'
,
kdspApi
:
'
https://sc-op-api-
vcc3
.liangkebang.net
'
,
goodsApi
:
'
https://sc-op-api-
test4
.liangkebang.net
'
,
goodsApi
:
'
https://sc-op-api-
vcc3
.liangkebang.net
'
,
querysApi
:
'
https://sc-settlement-api-
test4
.liangkebang.net
'
,
querysApi
:
'
https://sc-settlement-api-
vcc3
.liangkebang.net
'
,
// goodsApi: '//192.168.188.111:7000',
// goodsApi: '//192.168.188.111:7000',
prologueDomain
:
'
https://mall-
test4
.liangkebang.net
'
,
prologueDomain
:
'
https://mall-
vcc3
.liangkebang.net
'
,
qiniuHost
:
'
https://appsync.lkbang.net
'
,
qiniuHost
:
'
https://appsync.lkbang.net
'
,
opapiHost
:
'
https://opapi-
test4
.liangkebang.net
'
,
opapiHost
:
'
https://opapi-
vcc3
.liangkebang.net
'
,
};
};
const
prodApi
=
{
const
prodApi
=
{
...
...
src/pages/password/index.jsx
View file @
1fdf38b4
import
React
,
{
useRef
,
useState
}
from
'
react
'
;
import
React
,
{
useRef
,
useState
}
from
'
react
'
;
import
{
Form
,
Input
,
Button
,
Checkbox
,
Card
}
from
'
antd
'
;
import
{
Form
,
Input
,
Button
,
Checkbox
,
Card
,
notification
}
from
'
antd
'
;
import
{
history
}
from
'
umi
'
;
import
{
history
}
from
'
umi
'
;
import
{
da
}
from
'
date-fns/locale
'
;
import
styles
from
'
./style.less
'
;
import
styles
from
'
./style.less
'
;
import
{
passwordRule
,
resetPassword
}
from
'
./service
'
;
const
Password
=
props
=>
{
const
Password
=
props
=>
{
const
formRef
=
useRef
();
const
formRef
=
useRef
();
const
onFinish
=
values
=>
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
console
.
log
(
'
Success:
'
,
values
);
};
const
onFinishFailed
=
errorInfo
=>
{
console
.
log
(
'
Failed:
'
,
errorInfo
);
};
const
goHome
=
()
=>
{
const
goHome
=
()
=>
{
formRef
.
current
.
resetFields
();
formRef
.
current
.
resetFields
();
history
.
push
(
'
/
'
);
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
(
return
(
<
div
className=
{
styles
.
div
}
>
<
div
className=
{
styles
.
div
}
>
<
Card
className=
{
styles
.
card
}
>
<
Card
className=
{
styles
.
card
}
>
...
@@ -24,37 +54,36 @@ const Password = props => {
...
@@ -24,37 +54,36 @@ const Password = props => {
<
Form
<
Form
initialValues=
{
{
remember
:
true
}
}
initialValues=
{
{
remember
:
true
}
}
onFinish=
{
onFinish
}
onFinish=
{
onFinish
}
onFinishFailed=
{
onFinishFailed
}
autoComplete=
"off"
autoComplete=
"off"
className=
{
styles
.
form
}
className=
{
styles
.
form
}
ref=
{
formRef
}
ref=
{
formRef
}
>
>
<
Form
.
Item
name=
"
val
"
rules=
{
[{
required
:
true
,
message
:
'
请输入原密码!
'
}]
}
>
<
Form
.
Item
name=
"
password
"
rules=
{
[{
required
:
true
,
message
:
'
请输入原密码!
'
}]
}
>
<
Input
.
Password
placeholder=
"输入原密码"
/>
<
Input
.
Password
placeholder=
"输入原密码"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"
loginpass
"
name=
"
newPassword
"
rules=
{
[
rules=
{
[
{
required
:
true
,
message
:
'
请输入新密码!
'
},
{
required
:
true
,
message
:
'
请输入新密码!
'
},
{
{
message
:
'
至少13最多18位且必须包含大小写字母、数字和特殊字符
'
,
message
:
'
至少13最多18位且必须包含大小写字母、数字和特殊字符
'
,
pattern
:
/
^
(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
\d)(?=
.*
[
$@$!%*?&
])[
A-Za-z
\d
$@$!%*?&
]
{13,18}/
,
pattern
:
/
(?=
.*
\d)(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
[^
a-zA-Z0-9
])
.
{13,18}/
,
},
},
]
}
]
}
>
>
<
Input
.
Password
placeholder=
"输入新密码"
maxLength=
{
18
}
/>
<
Input
.
Password
placeholder=
"输入新密码"
maxLength=
{
18
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"
cfmloginpass
"
name=
"
newPasswordAgain
"
rules=
{
[
rules=
{
[
{
required
:
true
,
message
:
'
请输入新密码!
'
},
{
required
:
true
,
message
:
'
请输入新密码!
'
},
{
{
message
:
'
至少13位最多18位且必须包含大小写字母、数字和特殊字符
'
,
message
:
'
至少13位最多18位且必须包含大小写字母、数字和特殊字符
'
,
pattern
:
/
^
(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
\d)(?=
.*
[
$@$!%*?&
])[
A-Za-z
\d
$@$!%*?&
]
{13,18}/
,
pattern
:
/
(?=
.*
\d)(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
[^
a-zA-Z0-9
])
.
{13,18}/
,
},
},
({
getFieldValue
})
=>
({
({
getFieldValue
})
=>
({
validator
(
rule
,
value
)
{
validator
(
val
,
value
)
{
if
(
value
&&
getFieldValue
(
'
loginpass
'
)
!==
value
)
{
if
(
value
&&
getFieldValue
(
'
newPassword
'
)
!==
value
)
{
// eslint-disable-next-line prefer-promise-reject-errors
// eslint-disable-next-line prefer-promise-reject-errors
return
Promise
.
reject
(
'
两次密码输入不一致
'
);
return
Promise
.
reject
(
'
两次密码输入不一致
'
);
}
}
...
@@ -66,7 +95,7 @@ const Password = props => {
...
@@ -66,7 +95,7 @@ const Password = props => {
<
Input
.
Password
placeholder=
"输入新密码"
maxLength=
{
18
}
/>
<
Input
.
Password
placeholder=
"输入新密码"
maxLength=
{
18
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
className=
{
styles
.
btn
}
>
<
Form
.
Item
className=
{
styles
.
btn
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
{
'
'
}
{
'
'
}
确认修改
确认修改
</
Button
>
</
Button
>
...
...
src/pages/password/service.js
0 → 100644
View file @
1fdf38b4
import
request
from
'
@/utils/request
'
;
import
config
from
'
../../../config/env.config
'
;
const
{
kdspApi
}
=
config
;
// 商户后台密码修改-校验
export
async
function
passwordRule
(
params
)
{
const
data
=
await
request
.
post
(
'
/admin/stms/user/ex/validate-password-rule
'
,
{
prefix
:
kdspApi
,
data
:
params
,
});
return
data
;
}
// 商户后台密码修改
export
async
function
resetPassword
(
params
)
{
const
data
=
await
request
.
post
(
'
/admin/stms/user/ex/supply/reset-password
'
,
{
prefix
:
kdspApi
,
data
:
params
,
});
return
data
;
}
src/services/login.js
View file @
1fdf38b4
...
@@ -14,3 +14,15 @@ export async function getFakeCaptcha(mobile) {
...
@@ -14,3 +14,15 @@ export async function getFakeCaptcha(mobile) {
export
async
function
getResFreshToen
(
token
)
{
export
async
function
getResFreshToen
(
token
)
{
return
request
(
`/oauth/refreshtoken?refreshtoken=
${
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