diff --git a/main/manager-web/src/apis/module/user.js b/main/manager-web/src/apis/module/user.js index 314c00a3..4b008ffe 100755 --- a/main/manager-web/src/apis/module/user.js +++ b/main/manager-web/src/apis/module/user.js @@ -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(); @@ -157,7 +157,7 @@ export default { this.getAgentList(callback); }); }).send(); - }, + }, getUserInfo(callback) { RequestService.sendRequest() @@ -179,7 +179,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); @@ -205,6 +205,26 @@ 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(); + }, // 获取智能体配置 getDeviceConfig(deviceId, callback) { RequestService.sendRequest() @@ -237,5 +257,4 @@ export default { }); }).send(); }, - } diff --git a/main/manager-web/src/components/ChangePasswordDialog.vue b/main/manager-web/src/components/ChangePasswordDialog.vue new file mode 100644 index 00000000..19c20fd6 --- /dev/null +++ b/main/manager-web/src/components/ChangePasswordDialog.vue @@ -0,0 +1,141 @@ + + + + + \ No newline at end of file diff --git a/main/manager-web/src/components/HeaderBar.vue b/main/manager-web/src/components/HeaderBar.vue index 2d349e7f..95ed2b94 100644 --- a/main/manager-web/src/components/HeaderBar.vue +++ b/main/manager-web/src/components/HeaderBar.vue @@ -25,25 +25,31 @@ - {{ userInfo.username }} + {{ userInfo.username || '加载中...' }} 个人中心 - 修改密码 + 修改密码 退出登录 + + + @@ -164,4 +171,4 @@ export default { color: #3d4566; } - + \ No newline at end of file