This commit is contained in:
@@ -105,21 +105,33 @@ $(function () {
|
||||
$(".login-in").attr("style", "display:none");
|
||||
$(".no-login").attr("style", "display:block");
|
||||
}
|
||||
};
|
||||
// 获取通用配置信息
|
||||
const getCommentInfo = () => {
|
||||
$.ajax({
|
||||
url: "/console/v1/common",
|
||||
method: "get",
|
||||
headers: {
|
||||
Authorization: "Bearer" + " " + localStorage.jwt,
|
||||
},
|
||||
success: function (res) {
|
||||
sessionStorage.commentData = JSON.stringify(res.data);
|
||||
setCommData();
|
||||
},
|
||||
});
|
||||
};
|
||||
};
|
||||
// 获取通用配置信息
|
||||
const getCommentInfo = () => {
|
||||
const handleSuccess = function (res) {
|
||||
sessionStorage.commentData = JSON.stringify(res.data);
|
||||
setCommData();
|
||||
};
|
||||
$.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,
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
// 设置通用信息函数
|
||||
const setCommData = () => {
|
||||
const commentObj = JSON.parse(sessionStorage.commentData);
|
||||
|
||||
Reference in New Issue
Block a user