统一排行榜页:四角色七时段,对接 phbhqsj 新接口

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-06-27 00:40:42 +08:00
parent 29b8f303b3
commit a21b1d2426
8 changed files with 1191 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
/** 头像 URL 解析(排行榜等页面共用) */
export function getDefaultAvatarUrl(app) {
const g = app || getApp();
const oss = g.globalData.ossImageUrl || '';
const def = g.globalData.morentouxiang || '';
if (!def) return '';
if (def.startsWith('http')) return def;
return oss + def.replace(/^\//, '');
}
export function resolveAvatarUrl(path, app) {
if (!path || path === 'null' || path === 'undefined') return '';
const s = String(path).trim();
if (!s) return '';
if (s.startsWith('http')) return s;
const g = app || getApp();
const oss = g.globalData.ossImageUrl || '';
return oss + s.replace(/^\//, '');
}