This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
<link rel="stylesheet" href="/plugins/addon/theme_configurator/template/admin/theme.css" />
|
<link rel="stylesheet" href="/plugins/addon/theme_configurator/template/admin/theme.css" />
|
||||||
|
|
||||||
<div id="theme-config-app" class="template" v-cloak>
|
<div id="theme-config-app" class="template" v-cloak>
|
||||||
<com-config>
|
<t-card class="theme-card" title="SEO 设置" bordered>
|
||||||
<t-card class="theme-card" title="SEO 设置" bordered>
|
|
||||||
<div class="form-grid">
|
<div class="form-grid">
|
||||||
<div class="form-item">
|
<div class="form-item">
|
||||||
<label>站点标题</label>
|
<label>站点标题</label>
|
||||||
@@ -283,16 +282,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</t-card>
|
</t-card>
|
||||||
|
|
||||||
<div class="action-bar">
|
<div class="action-bar">
|
||||||
<t-button variant="outline" @click="loadConfig" :loading="loading">重新加载</t-button>
|
<t-button variant="outline" @click="loadConfig" :loading="loading">重新加载</t-button>
|
||||||
<t-button theme="primary" class="ml-10" @click="saveConfig" :loading="saving">保存全部配置</t-button>
|
<t-button theme="primary" class="ml-10" @click="saveConfig" :loading="saving">保存全部配置</t-button>
|
||||||
</div>
|
</div>
|
||||||
</com-config>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/plugins/addon/theme_configurator/template/admin/lang/index.js"></script>
|
<script src="/plugins/addon/theme_configurator/template/admin/lang/index.js"></script>
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
|
// 兼容全局 axios / Axios
|
||||||
|
const http = window.axios || window.Axios;
|
||||||
|
if (!http) {
|
||||||
|
console.error("[ThemeConfigurator] axios / Axios not found, theme config page cannot initialize.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const host = location.origin;
|
const host = location.origin;
|
||||||
const adminPath = location.pathname.split("/")[1];
|
const adminPath = location.pathname.split("/")[1];
|
||||||
const base = `${host}/${adminPath}/v1/theme/config`;
|
const base = `${host}/${adminPath}/v1/theme/config`;
|
||||||
@@ -401,7 +406,7 @@
|
|||||||
},
|
},
|
||||||
loadConfig() {
|
loadConfig() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
axios
|
http
|
||||||
.get(base, {
|
.get(base, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + localStorage.getItem("backJwt"),
|
Authorization: "Bearer " + localStorage.getItem("backJwt"),
|
||||||
@@ -515,7 +520,7 @@
|
|||||||
...this.fullConfig,
|
...this.fullConfig,
|
||||||
side_floating_window: this.fullConfig.side || [],
|
side_floating_window: this.fullConfig.side || [],
|
||||||
};
|
};
|
||||||
axios
|
http
|
||||||
.post(base, payload, {
|
.post(base, payload, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + localStorage.getItem("backJwt"),
|
Authorization: "Bearer " + localStorage.getItem("backJwt"),
|
||||||
|
|||||||
Reference in New Issue
Block a user