feat: 添加测试更新相关代码

This commit is contained in:
539943419 committed 2025-01-15 20:14:42 +08:00
1 parent 24f910e12c
commit f4e4d8c8f7
4 files changed
+53 -1

No files matched your search

+19
View File
@@ -5,6 +5,17 @@
<el-button v-for="item in Object.entries(testFunctionList)" @click="item[1]">
{{ item[0] }}
</el-button>
<div>
测试更新
<el-upload :auto-upload="false" v-model="fileList" action="/api/system/update" ref="uploadRef">
<template #trigger>
<el-button type="primary">select file</el-button>
</template>
<el-button class="ml-3" type="success" @click="submitUpload">
upload to server
</el-button>
</el-upload>
</div>
</div>
</div>
</template>
@@ -12,11 +23,19 @@
<script setup lang="ts">
import useUserStore from '~/hooks/pinia/useUserStore';
import useMiaoFetch, { testAuth } from '~/hooks/useMiaoFetch';
import type { UploadProps, UploadUserFile } from 'element-plus'
const { post: { uploadPost, updatePost } } = useMiaoFetch()
const fileList = ref<UploadUserFile[]>([])
const userStore = useUserStore()
const uploadRef = ref()
const submitUpload = () => {
uploadRef.value!.submit()
}
const uploadTest = () => {
uploadPost({
title: `测试上传`,