feat: oss preview switch
This commit is contained in:
parent
48c271c9d5
commit
d6ecf10700
@ -48,8 +48,8 @@ export function configRemove(configIds: IDS) {
|
||||
/**
|
||||
* 获取配置信息
|
||||
* @param configKey configKey
|
||||
* @returns info
|
||||
* @returns value
|
||||
*/
|
||||
export function configInfoByKey(configKey: string) {
|
||||
return requestClient.get<Config>(`${Api.configInfoByKey}/${configKey}`);
|
||||
return requestClient.get<string>(`${Api.configInfoByKey}/${configKey}`);
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
|
||||
import { Card } from 'ant-design-vue';
|
||||
import { Card, Switch } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter';
|
||||
import { configInfoByKey } from '#/api/system/config';
|
||||
|
||||
import { querySchema } from './data';
|
||||
|
||||
@ -29,6 +31,12 @@ const [QueryForm] = useVbenForm({
|
||||
},
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
});
|
||||
|
||||
const preview = ref(false);
|
||||
onMounted(async () => {
|
||||
const resp = await configInfoByKey('sys.oss.previewListResource');
|
||||
preview.value = Boolean(resp);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -36,6 +44,10 @@ const [QueryForm] = useVbenForm({
|
||||
<Card>
|
||||
<QueryForm />
|
||||
</Card>
|
||||
<div class="flex items-center gap-2">
|
||||
<span>预览图片: </span>
|
||||
<Switch v-model:checked="preview" />
|
||||
</div>
|
||||
<a-button @click="() => router.push('/system/oss-config')">配置</a-button>
|
||||
</Page>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user