feat(api): 修改oss
- 替换开发环境API基础URL为本地服务地址 - 实现签名URL本地缓存机制,解决微信按URL缓存图片导致重复下载问题 - 添加缓存清理功能,包括过期清理和按需删除特定缓存项 - 集成阿里云OSS上传功能,支持直传减少服务器带宽占用 - 优化头像地址处理逻辑,统一使用签名缓存避免地址频繁变化 - 移除过时的OSS上传示例文件oss-upload.js - 更新课程页面实现跳转第三方小程序功能 - 调整打卡记录图片地址获取方式,统一使用新的签名缓存逻辑 - 优化图片上传流程,增加压缩处理和批量上传支持 - 完善认证模块中的缓存清理逻辑,切换账号时清除相关图片缓存 - 添加后端环境变量配置模板和代理文档说明
This commit is contained in:
@@ -5,9 +5,6 @@ const auth = require('../../utils/auth');
|
||||
const TYPES = ['weekly', 'monthly', 'yearly'];
|
||||
const TYPE_LABELS = ['周计划', '月计划', '年计划'];
|
||||
|
||||
// 个人历史卡片里最多展示的缩略图数量,其余图片在「查看详情」弹层里看全部
|
||||
const HISTORY_THUMB_LIMIT = 2;
|
||||
|
||||
// 说明:本页所有「切换状态 + 紧跟一次加载」的流程,都要求把 loading 合并进
|
||||
// 调用方那一次 setData(加载函数传 silent=true),不要在同一个 tick 里连发两次
|
||||
// setData —— 否则会触发 "recursive update detected: a data update is applying
|
||||
@@ -64,11 +61,19 @@ Page({
|
||||
setTimeout(() => wx.switchTab({ url: '/pages/profile/profile' }), 500);
|
||||
return;
|
||||
}
|
||||
// 从提交/修改页返回(plan-submit 保存成功后写入 dirty 标记)时,除了刷新总览,
|
||||
// 还要刷新「个人」tab 的历史列表:否则停留在个人 tab 时,刚提交/修改的内容
|
||||
// 不会回显,列表会一直显示提交前的旧数据。
|
||||
const dirty = !!wx.getStorageSync('plan_overview_dirty');
|
||||
wx.removeStorageSync('plan_overview_dirty');
|
||||
this.setData({ view: 'overview' });
|
||||
// 先加载周期列表,再加载总览(总览接口会返回 is_teacher)
|
||||
this.loadPeriods().then(() => {
|
||||
this.loadOverview();
|
||||
return this.loadOverview();
|
||||
}).then(() => {
|
||||
if (dirty && !this.data.isTeacher) {
|
||||
return this.loadHistory();
|
||||
}
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.error('plan page init error:', err);
|
||||
@@ -286,8 +291,8 @@ Page({
|
||||
const all = api.attachmentThumbs(item);
|
||||
return {
|
||||
...item,
|
||||
// 卡片里只铺前 2 张缩略图,弹层用 allThumbs 看全部
|
||||
thumbs: all.slice(0, HISTORY_THUMB_LIMIT),
|
||||
// 卡片直接铺全部缩略图;allThumbs 仍保留给详情弹层(现在两者一致)
|
||||
thumbs: all,
|
||||
allThumbs: all,
|
||||
statusColor: item.status === '未完成' ? '#C67B30' : '#2E7D32',
|
||||
statusBg: item.status === '未完成' ? '#FFF3E6' : '#E8F4EB',
|
||||
|
||||
@@ -12,8 +12,8 @@ function _getBaseUrls() {
|
||||
case 'develop':
|
||||
// 开发版:本地服务
|
||||
return {
|
||||
//baseUrl: 'https://test.muguaclub.cn/clock',
|
||||
baseUrl: 'http://localhost:8000',
|
||||
baseUrl: 'https://test.muguaclub.cn/clock',
|
||||
//baseUrl: 'http://localhost:8000',
|
||||
staticUrl: 'https://test.muguaclub.cn',
|
||||
h5Url: 'https://test.muguaclub.cn'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user