This commit is contained in:
Lan
2024-11-23 21:50:46 +08:00
parent 9693f3d329
commit a247dd163d
7 changed files with 166 additions and 140 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { inject, ref } from 'vue'
import api from '@/utils/api'
import { useAlertStore } from '@/stores/alertStore'
const isDarkMode = inject('isDarkMode')
interface ConfigState {
@@ -124,6 +125,7 @@ const refreshData = () => {
}
})
}
const alertStore = useAlertStore()
// 转换文件大小为字节
const convertToBytes = (size: number, unit: string): number => {
const units = {
@@ -151,9 +153,9 @@ const submitSave = () => {
data: formData
}).then((res: any) => {
if (res.code == 200) {
alert('保存成功')
alertStore.showAlert('保存成功', 'success')
} else {
alert(res.message)
alertStore.showAlert(res.message, 'error')
}
})
}