Feature(custom): optimize imported css file rename

This commit is contained in:
Kuingsmile
2026-01-15 11:22:45 +08:00
parent f7667b5ff6
commit f3ae71b34c

View File

@@ -7,6 +7,7 @@ import windowManager from 'apis/app/window/windowManager'
import axios from 'axios'
import fs from 'fs-extra'
import { randomStringGenerator } from '@/manage/utils/common'
import { IWindowList } from '~/utils/enum'
let insertedCSSKeyMain: string | undefined
@@ -61,7 +62,7 @@ export async function fetchThemes(): Promise<boolean> {
export async function importThemes(files: string[]): Promise<void> {
for (const file of files) {
if (fs.existsSync(file))
await fs.copyFile(file, path.join(themesDir(), `${new Date().getTime().toString(16)}-${path.basename(file)}`))
await fs.copyFile(file, path.join(themesDir(), `imp-${randomStringGenerator(3)}-${path.basename(file)}`))
}
}