大修改

This commit is contained in:
Yeomai committed 2026-09-30 03:38:10 +08:00
1 parent a1cbc9404a
commit e81481623c
47 files changed
+1453 -285

No files matched your search

+13 -4
View File
@@ -49,7 +49,16 @@ const store = {
wx.removeStorageSync(config.STORAGE.REFRESH_TOKEN);
},
isLoggedIn: () => !!read(config.STORAGE.TOKEN, ''),
/**
* 是否「已登录」。
*
* 指用户主动使用过登录功能(标记由服务端返回、跟着 user 一起存),
* 不是「本地有没有 token」——静默登录每次都会拿到 token,那不算登录。
*/
isLoggedIn: () => {
const user = store.getUser();
return !!(user && user.isLogin === 1);
},
// ── 用户 ─────────────────────────────────────────────────────────────
getUser() {
@@ -77,10 +86,10 @@ const store = {
notify();
},
/** 取配置项,带兜底值,避免配置缺失时页面直接崩掉。 */
cfg(key, fallback) {
/** 取配置项。数据库里配什么就是什么,没配返回空字符串,由页面自己决定要不要渲染。 */
cfg(key) {
const value = store.getSiteConfig()[key];
return value === undefined || value === '' ? (fallback === undefined ? '' : fallback) : value;
return value === undefined ? '' : value;
},
// ── 已购课程 ─────────────────────────────────────────────────────────