From cfd81b0d769ccc7ddcaba577dce9af40b567b42a Mon Sep 17 00:00:00 2001 From: cys <372127021@qq.com> Date: Wed, 17 Jul 2024 14:16:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/renderer/src/api/system/user.js | 40 ++++ src/renderer/src/assets/images/img-avatar.png | Bin 0 -> 7207 bytes src/renderer/src/layout/components/Header.vue | 2 +- src/renderer/src/router/index.js | 6 + src/renderer/src/views/profile/index.vue | 139 ++++++++++++++ src/renderer/src/views/profile/resetPwd.vue | 75 ++++++++ src/renderer/src/views/profile/userAvatar.vue | 175 ++++++++++++++++++ src/renderer/src/views/profile/userInfo.vue | 89 +++++++++ 9 files changed, 526 insertions(+), 1 deletion(-) create mode 100644 src/renderer/src/api/system/user.js create mode 100644 src/renderer/src/assets/images/img-avatar.png create mode 100644 src/renderer/src/views/profile/index.vue create mode 100644 src/renderer/src/views/profile/resetPwd.vue create mode 100644 src/renderer/src/views/profile/userAvatar.vue create mode 100644 src/renderer/src/views/profile/userInfo.vue 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 0000000000000000000000000000000000000000..2ff5fd661c9598f894035c934b32744f43e20d20 GIT binary patch literal 7207 zcmW+*by!qS7rslgz{1ig%L*AR#Q>0)j{=(xrl; ze*63WxHHdl=iYPQIrH8*?>Q5%t*J}~W&{HOK&Gmqpo{It|GS6?ux-6@Lm{>U`RFRk z0SzFcFQ*rW> z;-z6|P}`_d6;1Vvc-UQuAS4UqIMPh(RKDWD-Cmbmc3*de-Hwe|m5A8%gXX~3S3$#n zLTvXz7_^;y?)+5cvg2NG3z%Iw55?cPC}R@&bz)KaVbxbl@-!L8^-}VFLFMk<*l=Mdw_(!}gqY#DAEM;R>0T>49ZKr~OJ2o`A zol!-O7zN0i5FG|hV|_2Flh?(8wlfnN>m?bC4f6X*ZZFqPCbMA?EBEgwC|FD3)a|#O z@YpA3G`;N&=2{1!1B#mp4p0#7w*!#DPDMME5yPS?c5voEDy48WXkVhWmc-I)E7Qb- zB5i|b#Wmz&1{k3iDzB8ep+;*N&dIcehG!v=AycbBu(^USPbZ6=&pa->-iHftyWlvD z(^+xD9?e5veET*)U`*R5L;$U}-a}|AaA^P-#*b&z)4Pw#DiKoHPQ3uaAlnNGy(*)d z;+{0%W5sWjoA?{rmLy z_gTuH9~;llD!1JAy2Yf)8>yj;S{>=nNU(V9fqr`Ms%5}F4F#SA#f>=v$}i!0bA}5M zFP=Gl{~gs8XC}~~9T)bT1u2-3+Ia02yS2qG?}Oa?q>*fI{0Wa(29H#RZ1GR9fm

tCh17TokF=JS z{iy!zd6R(ToAy$0L|*O(L%aGb`s=!h8DV4eIFZ1Gr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U(A0zhX4hG z2Z>QakJJC&!#PI*maYqvjhYs|1Te)4Mr=vP)1qp280CRZ54q_2K>+RQv%7UlKvBY? z_3WYO6bGXwlli)u8HJ8>F#h%iyyaQt#ED>HQSj17A7JtN-ob?K6xCl6Xh~DScsedI zEIWzGh&NGY%Bbb`^_)y&rA+a{r4x|kt(B3}@{9hE)#>X<)fdyC?)>RK{f#9vy{gbs mIx;)dF}TO;?#K6^{|M#1c}!cXFfi=NAE2tJsn8&274bipKt+TA literal 0 HcmV?d00001 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 @@