
import configApi from '@/api/sys/dev/configApi'
import { message } from 'ant-design-vue'

const formData = ref({
	SYS_LOGO: '',
	SYS_BACK_IMAGE: '',
	SYS_NAME: '',
	SYS_VERSION: '',
	SYS_COPYRIGHT: '',
	SYS_COPYRIGHT_URL: '',
	SYS_DEFAULT_FILE_ENGINE: 'LOCAL',
	SYS_DEFAULT_PASSWORD: ''
})

const param = {
	category: 'SYS_BASE'
}

const getSysBaseConfig = () => {
	configApi.configList(param).then((data) => {
		if (data) {
			data.forEach((item) => {
				formData.value[item.configKey] = item.configValue ? '' : item.configValue
			})
		} else {
			message.warning('表单项不存在，请初始化数据库')
		}
	})
}
