mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-12-21 07:49:08 +08:00
Feat: remove upload files
This commit is contained in:
parent
f390de613e
commit
5f78781ecf
@ -3,6 +3,8 @@ import { IPageLayoutConfig } from "../../../../common/global";
|
||||
import { $t as t } from "../i18n";
|
||||
import storage from "../common/system_storage";
|
||||
import { GlobalVariable } from "common";
|
||||
import path from "path";
|
||||
import fs from "fs-extra";
|
||||
|
||||
const LAYOUT_CONFIG_NAME = "layout.json";
|
||||
|
||||
@ -40,6 +42,10 @@ export function setFrontendLayoutConfig(config: IPageLayoutConfig[]) {
|
||||
|
||||
export function resetFrontendLayoutConfig() {
|
||||
storage.deleteFile(LAYOUT_CONFIG_NAME);
|
||||
const filesDir = path.join(process.cwd(), "public/upload_files/");
|
||||
for (const fileName of fs.readdirSync(filesDir)) {
|
||||
fs.remove(path.join(filesDir, fileName), () => {});
|
||||
}
|
||||
}
|
||||
|
||||
export enum LayoutCardHeight {
|
||||
|
Loading…
Reference in New Issue
Block a user