fix: Logo API 改用正确的前台路由 /console/v1/theme/config
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
原路径 config.json 被 ThinkPHP 路由拦截返回 404 改用插件前台 API 路由,支持 res.data 嵌套解析
This commit is contained in:
@@ -47,11 +47,12 @@
|
|||||||
var logoEl = document.getElementById('siteLogo');
|
var logoEl = document.getElementById('siteLogo');
|
||||||
if (!logoEl) return;
|
if (!logoEl) return;
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', '/web/BlackFruit-web/plugins/addon/theme_configurator/config.json', true);
|
xhr.open('GET', '/console/v1/theme/config', true);
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
if (xhr.status === 200) {
|
if (xhr.status === 200) {
|
||||||
try {
|
try {
|
||||||
var cfg = JSON.parse(xhr.responseText);
|
var res = JSON.parse(xhr.responseText);
|
||||||
|
var cfg = res.data || res;
|
||||||
var logoUrl = cfg.site_config && cfg.site_config.official_website_logo;
|
var logoUrl = cfg.site_config && cfg.site_config.official_website_logo;
|
||||||
if (logoUrl) logoEl.src = logoUrl;
|
if (logoUrl) logoEl.src = logoUrl;
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user