mirror of
				https://github.com/yangjian102621/geekai.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	feat(ui): 上传功能补充
This commit is contained in:
		@@ -3,7 +3,7 @@ import { Notification } from "@arco-design/web-vue";
 | 
			
		||||
import createInstance from "@gpt-vue/packages/request"
 | 
			
		||||
import type { BaseResponse } from "@gpt-vue/packages/type";
 | 
			
		||||
 | 
			
		||||
export const uploadUrl = import.meta.env.VITE_PROXY_BASE_URL + "/api/upload";
 | 
			
		||||
export const uploadUrl = import.meta.env.VITE_PROXY_BASE_URL + "/api/admin/upload";
 | 
			
		||||
 | 
			
		||||
export const instance = createInstance()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,6 @@
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, ref } from "vue";
 | 
			
		||||
import { Message } from "@arco-design/web-vue";
 | 
			
		||||
import type { UploadInstance, FileItem } from "@arco-design/web-vue";
 | 
			
		||||
import { uploadUrl } from "@/http/config";
 | 
			
		||||
 | 
			
		||||
@@ -20,8 +21,10 @@ const uploadProps = computed<UploadInstance["$props"]>(() => ({
 | 
			
		||||
}));
 | 
			
		||||
 | 
			
		||||
const handleChange = (_, file: FileItem) => {
 | 
			
		||||
  console.log(file.response);
 | 
			
		||||
  console.log(file);
 | 
			
		||||
  if (file?.response) {
 | 
			
		||||
    emits("update:modelValue", file?.response?.data?.url);
 | 
			
		||||
    Message.success("上传成功");
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<template>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user