axios 未定义
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yiqiu
2025-11-21 13:23:53 +08:00
parent 55d4de847f
commit f6c898c831

View File

@@ -1,7 +1,6 @@
<link rel="stylesheet" href="/plugins/addon/theme_configurator/template/admin/theme.css" />
<div id="theme-config-app" class="template" v-cloak>
<com-config>
<t-card class="theme-card" title="SEO 设置" bordered>
<div class="form-grid">
<div class="form-item">
@@ -287,12 +286,18 @@
<t-button variant="outline" @click="loadConfig" :loading="loading">重新加载</t-button>
<t-button theme="primary" class="ml-10" @click="saveConfig" :loading="saving">保存全部配置</t-button>
</div>
</com-config>
</div>
<script src="/plugins/addon/theme_configurator/template/admin/lang/index.js"></script>
<script>
(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 adminPath = location.pathname.split("/")[1];
const base = `${host}/${adminPath}/v1/theme/config`;
@@ -401,7 +406,7 @@
},
loadConfig() {
this.loading = true;
axios
http
.get(base, {
headers: {
Authorization: "Bearer " + localStorage.getItem("backJwt"),
@@ -515,7 +520,7 @@
...this.fullConfig,
side_floating_window: this.fullConfig.side || [],
};
axios
http
.post(base, payload, {
headers: {
Authorization: "Bearer " + localStorage.getItem("backJwt"),