feat(database): 迁移用户关联字段并优化打卡系统
- 修改数据库配置将MYSQL_DB从mys_info_v3改为mys_info_test - 新增auth_users表wechat_openid字段并建立唯一索引 - 为plan_checkins表添加计划性能索引(idx_plan_period_student) - 将checkin_records_old表关联方式从student_id改为user_id - 将plan_checkins表关联方式从student_id改为user_id并更新附件路径 - 移除routes/auth.py中的uuid导入使用安全token生成函数 - 重构routes/checkin.py打卡逻辑去除course_type字段并优化返回结构 - 添加打卡时间限制验证功能防止过期打卡操作 - 实现小组统计功能支持老师查看各组打卡情况 - 更新主页index.html界面适配新的打卡和计划功能 - 调整计划提交时间规则为周五至周四周期 - 添加月度和年度计划提交状态验证机制
This commit is contained in:
@@ -40,7 +40,7 @@ Page({
|
||||
},
|
||||
|
||||
onPullDownRefresh() {
|
||||
this.refresh().then(() => wx.stopPullDownRefresh());
|
||||
this.refresh().finally(() => wx.stopPullDownRefresh());
|
||||
},
|
||||
|
||||
refresh() {
|
||||
@@ -225,34 +225,42 @@ Page({
|
||||
wx.navigateTo({ url: '/pages/privacy/privacy?type=' + type });
|
||||
},
|
||||
|
||||
deleteAccount() {
|
||||
logoutAccount() {
|
||||
wx.showModal({
|
||||
title: '注销账号',
|
||||
content: '确定要注销账号吗?注销后将清除本机登录信息,需要重新登录。',
|
||||
confirmText: '注销',
|
||||
title: '退出登录',
|
||||
content: '确定要退出登录吗?退出后将清除本机登录信息,需要重新登录。',
|
||||
confirmText: '退出',
|
||||
confirmColor: '#c0392b',
|
||||
success: (res) => {
|
||||
if (!res.confirm) return;
|
||||
wx.showModal({
|
||||
title: '再次确认',
|
||||
content: '注销后本机登录状态将被清除,你可以使用手机号重新登录。确定继续吗?',
|
||||
confirmText: '确认注销',
|
||||
confirmColor: '#c0392b',
|
||||
success: (res2) => {
|
||||
if (!res2.confirm) return;
|
||||
// 仅清除前端登录信息
|
||||
try {
|
||||
api.request({ url: '/api/v1/auth/logout', method: 'POST' }).catch(() => {});
|
||||
} catch (e) {}
|
||||
auth.clearToken();
|
||||
wx.removeStorageSync('privacy_agreed');
|
||||
wx.showToast({ title: '已注销', icon: 'success' });
|
||||
setTimeout(() => {
|
||||
wx.reLaunch({ url: '/pages/home/home' });
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
try {
|
||||
api.request({ url: '/api/v1/auth/logout', method: 'POST' }).catch(() => {});
|
||||
} catch (e) {}
|
||||
auth.clearToken();
|
||||
wx.removeStorageSync('privacy_agreed');
|
||||
wx.showToast({ title: '已退出', icon: 'success' });
|
||||
setTimeout(() => {
|
||||
wx.reLaunch({ url: '/pages/home/home' });
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
},
|
||||
// ---- 分享 ----
|
||||
onShareAppMessage() {
|
||||
const name = (this.data.profile && (this.data.profile.display_name || this.data.profile.name)) || '';
|
||||
const title = name
|
||||
? name + ' 推荐你用明缘云道场,打卡学习超好用'
|
||||
: '推荐你用明缘云道场,打卡学习超好用';
|
||||
return {
|
||||
title,
|
||||
path: '/pages/home/home?from=profile_share'
|
||||
};
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
return {
|
||||
title: '明缘云道场 · 学习成长,每日精进',
|
||||
query: 'from=timeline'
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -110,7 +110,7 @@
|
||||
</view>
|
||||
|
||||
<view class="bottom-actions">
|
||||
<button class="btn-delete" hover-class="btn-hover" bindtap="deleteAccount">注销账号</button>
|
||||
<button class="btn-logout" hover-class="btn-hover" bindtap="logoutAccount">退出登录</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -227,11 +227,10 @@ button::after { border: none; }
|
||||
}
|
||||
|
||||
/* ---- delete account ---- */
|
||||
.btn-delete {
|
||||
.btn-logout {
|
||||
background: #fff;
|
||||
color: #c0392b;
|
||||
border: 1rpx solid #f0b4ae;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
/* ---- profile name edit ---- */
|
||||
}
|
||||
Reference in New Issue
Block a user