This commit is contained in:
42
js/index.js
42
js/index.js
@@ -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"), {
|
||||
|
||||
Reference in New Issue
Block a user