feat: additional style system setting (#444)

* feat: additional style system setting

* feat: remove editor font setting
This commit is contained in:
boojack
2022-11-11 23:42:44 +08:00
committed by GitHub
parent 67691d1e99
commit a142d975d7
13 changed files with 72 additions and 78 deletions

View File

@ -5,6 +5,7 @@ import { RouterProvider } from "react-router-dom";
import { globalService, locationService } from "./services";
import { useAppSelector } from "./store";
import router from "./router";
import * as api from "./helpers/api";
import * as storage from "./helpers/storage";
function App() {
@ -20,6 +21,18 @@ function App() {
globalService.initialState();
}, []);
useEffect(() => {
api.getSystemStatus().then(({ data }) => {
const { data: status } = data;
if (status.additionalStyle) {
const styleEl = document.createElement("style");
styleEl.innerHTML = status.additionalStyle;
styleEl.setAttribute("type", "text/css");
document.head.appendChild(styleEl);
}
});
}, []);
useEffect(() => {
i18n.changeLanguage(global.locale);
storage.set({