This commit is contained in:
@@ -289,15 +289,9 @@
|
|||||||
</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 src="/plugins/addon/theme_configurator/template/admin/js/axios.min.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`;
|
||||||
@@ -406,7 +400,7 @@
|
|||||||
},
|
},
|
||||||
loadConfig() {
|
loadConfig() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
http
|
axios
|
||||||
.get(base, {
|
.get(base, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + localStorage.getItem("backJwt"),
|
Authorization: "Bearer " + localStorage.getItem("backJwt"),
|
||||||
@@ -520,7 +514,7 @@
|
|||||||
...this.fullConfig,
|
...this.fullConfig,
|
||||||
side_floating_window: this.fullConfig.side || [],
|
side_floating_window: this.fullConfig.side || [],
|
||||||
};
|
};
|
||||||
http
|
axios
|
||||||
.post(base, payload, {
|
.post(base, payload, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + localStorage.getItem("backJwt"),
|
Authorization: "Bearer " + localStorage.getItem("backJwt"),
|
||||||
|
|||||||
3
plugins/addon/theme_configurator/template/admin/js/axios.min.js
vendored
Normal file
3
plugins/addon/theme_configurator/template/admin/js/axios.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user