fix: preserve legacy admin URLs across H5 channels
Keep local record and download paths compatible while retaining explicit external source selection. Record Taobao, H5, WeChat and rednote compatibility verification and baseline test failures.
This commit is contained in:
+1
-1
@@ -54,7 +54,7 @@ function selectedChannelQuery(url) {
|
||||
var channel = $('#f-channel').value;
|
||||
return channel ? url + (url.indexOf('?') < 0 ? '?' : '&') + 'channel=' + encodeURIComponent(channel) : url;
|
||||
}
|
||||
function sourceQuery(source) { return '?source=' + encodeURIComponent(source || 'local'); }
|
||||
function sourceQuery(source) { return source && source !== 'local' ? '?source=' + encodeURIComponent(source) : ''; }
|
||||
function renderSources(data) {
|
||||
var sources = data.sources || [];
|
||||
$('#channel-summary').textContent = sources.length > 1
|
||||
|
||||
+1
-1
@@ -581,7 +581,7 @@ function sendJson(res, status, obj) {
|
||||
function photoUrls(rec) {
|
||||
const urls = {};
|
||||
const prefix = entry.rednote ? '/rednote' : '';
|
||||
const source = rec.admin_source ? '?source=' + encodeURIComponent(rec.admin_source) : '';
|
||||
const source = rec.admin_source && rec.admin_source !== 'local' ? '?source=' + encodeURIComponent(rec.admin_source) : '';
|
||||
if (rec.img_front) urls.front = `${prefix}/api/admin/photos/${rec.record_id}/front${source}`;
|
||||
if (rec.img_left) urls.left = `${prefix}/api/admin/photos/${rec.record_id}/left${source}`;
|
||||
if (rec.img_right) urls.right = `${prefix}/api/admin/photos/${rec.record_id}/right${source}`;
|
||||
|
||||
Reference in New Issue
Block a user