umi-request 替换为 axios

This commit is contained in:
whyour
2023-07-17 23:13:06 +08:00
parent bd166ee794
commit efd4f1d5ab
32 changed files with 215 additions and 214 deletions
+3 -5
View File
@@ -22,10 +22,8 @@ const SecuritySettings = ({ user, userChange }: any) => {
const handleOk = (values: any) => {
request
.put(`${config.apiPrefix}user`, {
data: {
username: values.username,
password: values.password,
},
username: values.username,
password: values.password,
})
.then(({ code, data }) => {
if (code === 200) {
@@ -64,7 +62,7 @@ const SecuritySettings = ({ user, userChange }: any) => {
const completeTowFactor = () => {
setLoading(true);
request
.put(`${config.apiPrefix}user/two-factor/active`, { data: { code } })
.put(`${config.apiPrefix}user/two-factor/active`, { code })
.then(({ code, data }) => {
if (code === 200) {
if (data) {