diff --git a/mobile/src/common/request.js b/mobile/src/common/request.js index d5da71be..829b407e 100644 --- a/mobile/src/common/request.js +++ b/mobile/src/common/request.js @@ -38,7 +38,7 @@ function handleUnauthorized(message = '登录已失效,请重新登录') { const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; const currentPath = '/' + currentPage.route; - + // 如果是新生报名页面,不跳转到登录页,只是静默处理 if (currentPath === '/pages/enrollment/index') { console.log('📋 新生报名页面401错误,使用兜底数据,不跳转登录页'); @@ -395,6 +395,31 @@ export const api = { url: '/auth/logout', method: 'POST', }), + + // 修改密码 + resetPassword: (data) => + request({ + url: '/system/user/profile/updatePwd', + method: 'PUT', + header: { + isEncrypt: 'true', // 修复:使用字符串 'true' 而不是布尔值 true + repeatSubmit: false, + }, + data: { + oldPassword: data.oldPassword, + newPassword: data.newPassword, + }, + }), + + // 更新用户头像 + // updateUserAvatar: (data) => + // request({ + // url: '/system/user/profile/updateAvatar', + // method: 'PUT', + // data: { + // avatar: data.avatar, + // }, + // }), }; // 便捷请求方法封装 diff --git a/mobile/src/pages.json b/mobile/src/pages.json index e17ad23b..c3960042 100644 --- a/mobile/src/pages.json +++ b/mobile/src/pages.json @@ -294,6 +294,14 @@ "navigationBarBackgroundColor": "#1890ff", "navigationBarTextStyle": "white" } + }, + { + "path": "pages/user/resetPasswd", + "style": { + "navigationBarTitleText": "修改密码", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } } ], "globalStyle": { diff --git a/mobile/src/pages/index/index.vue b/mobile/src/pages/index/index.vue index 01bee670..202e2d01 100644 --- a/mobile/src/pages/index/index.vue +++ b/mobile/src/pages/index/index.vue @@ -460,7 +460,7 @@ --> - + + - --> + @@ -946,6 +966,20 @@ export default { }); }, + // 跳转到修改密码页面 + gotoResetPassword() { + uni.navigateTo({ + url: '/pages/user/resetPasswd', + }); + }, + + // 跳转到修改头像页面 + gotoChangeAvatar() { + uni.navigateTo({ + url: '/pages/user/changeaAvatar', + }); + }, + // 图片加载成功处理 handleImageLoad(event) { console.log('✅ 轮播图片加载成功:', event.detail); diff --git a/mobile/src/pages/internship/index.vue b/mobile/src/pages/internship/index.vue index cccf3355..2d82eee0 100644 --- a/mobile/src/pages/internship/index.vue +++ b/mobile/src/pages/internship/index.vue @@ -4,14 +4,16 @@ 实习期间: - {{ formatDateRange(internshipInfo.internshipStartDate, internshipInfo.internshipEndDate) }} + + {{ + formatDateRange( + internshipInfo.internshipStartDate, + internshipInfo.internshipEndDate, + ) + }} + 状态: - + @@ -51,7 +64,7 @@ 今日签到 {{ currentDate }} - + @@ -70,18 +83,18 @@ - - + {{ checkinLoading ? '签到中...' : '立即签到' }} - + {{ checkinTips }} @@ -93,17 +106,16 @@ - 签到位置 - + - - + - 经纬度:{{ currentLocation.latitude.toFixed(6) }},{{ currentLocation.longitude.toFixed(6) }} + 经纬度:{{ currentLocation.latitude.toFixed(6) }},{{ + currentLocation.longitude.toFixed(6) + }} - + - - 定位精度 {{ currentLocation.accuracy.toFixed(0) }}米 - + + 定位精度 {{ currentLocation.accuracy.toFixed(0) }}米 + + - + - @@ -161,37 +182,57 @@ 位置信息 - - + - + 无法获取位置信息 - + {{ locationError }} - + 签到需要位置信息,请确保: - + 已开启位置权限 - + GPS/网络定位已开启 - + 网络连接正常 @@ -202,7 +243,7 @@ - + 本月考勤 @@ -226,14 +267,14 @@ -