diff --git a/electron.vite.config.mjs b/electron.vite.config.mjs index fe59903..12cab0b 100644 --- a/electron.vite.config.mjs +++ b/electron.vite.config.mjs @@ -22,8 +22,8 @@ export default defineConfig({ server: { proxy: { '/dev-api': { - target: 'http://27.128.240.72:7865', - // target: 'http://192.168.2.52:7863', + // target: 'http://27.128.240.72:7865', + target: 'http://192.168.2.52:7863', changeOrigin: true, rewrite: (p) => p.replace(/^\/dev-api/, '') }, diff --git a/package.json b/package.json index 1efc191..aff64c5 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "jsencrypt": "^3.3.2", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.1", + "vue-cropper": "^1.1.3", "vue-router": "^4.4.0" }, "devDependencies": { diff --git a/src/renderer/src/api/system/user.js b/src/renderer/src/api/system/user.js new file mode 100644 index 0000000..68c5133 --- /dev/null +++ b/src/renderer/src/api/system/user.js @@ -0,0 +1,40 @@ +import request from '@/utils/request' + +// 查询用户个人信息 +export function getUserProfile() { + return request({ + url: '/system/user/profile', + method: 'get' + }) + } + + // 修改用户个人信息 + export function updateUserProfile(data) { + return request({ + url: '/system/user/profile', + method: 'put', + data: data + }) + } + + // 用户密码重置 + export function updateUserPwd(oldPassword, newPassword) { + const data = { + oldPassword, + newPassword + } + return request({ + url: '/system/user/profile/updatePwd', + method: 'put', + params: data + }) + } + + // 用户头像上传 + export function uploadAvatar(data) { + return request({ + url: '/system/user/profile/avatar', + method: 'post', + data: data + }) + } \ No newline at end of file diff --git a/src/renderer/src/assets/images/img-avatar.png b/src/renderer/src/assets/images/img-avatar.png new file mode 100644 index 0000000..2ff5fd6 Binary files /dev/null and b/src/renderer/src/assets/images/img-avatar.png differ diff --git a/src/renderer/src/layout/components/Header.vue b/src/renderer/src/layout/components/Header.vue index 0cd8db8..67812b3 100644 --- a/src/renderer/src/layout/components/Header.vue +++ b/src/renderer/src/layout/components/Header.vue @@ -29,7 +29,7 @@