修改插件UI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yiqiu
2025-11-21 12:42:18 +08:00
parent 8622f2b7b2
commit 5834ab9a74
10 changed files with 403 additions and 70 deletions

View File

@@ -127,21 +127,33 @@ $(function () {
</div>`);
});
}
}
// 获取通用配置信息
function getCommentInfo() {
$.ajax({
url: "/console/v1/common",
method: "get",
headers: {
Authorization: "Bearer" + " " + localStorage.jwt,
},
success: function (res) {
sessionStorage.commentData = JSON.stringify(res.data);
setIndexData();
},
});
}
}
// 获取通用配置信息
function getCommentInfo() {
const handleSuccess = function (res) {
sessionStorage.commentData = JSON.stringify(res.data);
setIndexData();
};
$.ajax({
url: "/console/v1/theme/config",
method: "get",
headers: {
Authorization: "Bearer" + " " + localStorage.jwt,
},
success: handleSuccess,
error: function () {
// 插件未启用时回落到原有 /console/v1/common
$.ajax({
url: "/console/v1/common",
method: "get",
headers: {
Authorization: "Bearer" + " " + localStorage.jwt,
},
success: handleSuccess,
});
},
});
}
// 获取首页数据
getCommentInfo();
var viewer = new Viewer(document.getElementById("viewer"), {