完成修改密码

This commit is contained in:
Ran_Chen
2025-03-24 18:08:05 +08:00
parent 21ddb1541f
commit 2001258ef4
3 changed files with 187 additions and 20 deletions
+27 -8
View File
@@ -43,9 +43,9 @@ export default {
})
.fail(() => {
RequestService.reAjaxFun(() => {
this.unbindDevice(device_id, callback);
this.unbindDevice(device_id, callback);
});
}).send()
}).send()
},
// 绑定设备
bindDevice(deviceCode, callback) {
@@ -71,9 +71,9 @@ export default {
.method('GET')
.type('blob')
.header({
'Content-Type': 'image/gif',
'Pragma': 'No-cache',
'Cache-Control': 'no-cache'
'Content-Type': 'image/gif',
'Pragma': 'No-cache',
'Cache-Control': 'no-cache'
})
.success((res) => {
RequestService.clearRequestTime();
@@ -173,7 +173,7 @@ export default {
this.getAgentList(callback);
});
}).send();
},
},
getUserInfo(callback) {
RequestService.sendRequest()
@@ -195,7 +195,7 @@ export default {
RequestService.sendRequest()
.url(`${getServiceUrl()}/api/v1/user/agent`)
.method('POST')
.data({ name: agentName })
.data({name: agentName})
.success((res) => {
RequestService.clearRequestTime();
callback(res);
@@ -221,5 +221,24 @@ export default {
});
}).send();
},
// API接口代码修改
changePassword(oldPassword, newPassword, successCallback, errorCallback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/api/v1/user/change-password`) // 修改URL
.method('PUT') // 修改方法为PUT
.data({
old_password: oldPassword, // 修改参数名
new_password: newPassword // 修改参数名
})
.success((res) => {
RequestService.clearRequestTime();
successCallback(res);
})
.fail((error) => {
RequestService.reAjaxFun(() => {
this.changePassword(oldPassword, newPassword, successCallback, errorCallback);
});
})
.send();
},
}