mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 00:53:54 +08:00
完成修改密码
This commit is contained in:
@@ -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();
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user