|
|
@@ -28,9 +28,10 @@
|
|
|
</ElFormItem>
|
|
|
<el-upload
|
|
|
class="upload-demo"
|
|
|
+ action
|
|
|
drag
|
|
|
v-model:file-list="fileList"
|
|
|
- action="https://gpt.izouma.com/api/chat-pdf/upload"
|
|
|
+ :http-request="uploadFile"
|
|
|
accept="application/pdf"
|
|
|
:on-success="onSuccess"
|
|
|
>
|
|
|
@@ -67,6 +68,12 @@ http.get(`/auth/admin/getRole`).then((res) => {
|
|
|
}
|
|
|
})
|
|
|
const { showEditDialog, onEdit } = setupEditDialog(model)
|
|
|
+function uploadFile(file) {
|
|
|
+ let formDatas = new FormData()
|
|
|
+ formDatas.append('file', file.file)
|
|
|
+ formDatas.append('code', model.value.code)
|
|
|
+ http.post(`/chat-pdf/upload/` + model.value.code, formDatas).then((res) => {})
|
|
|
+}
|
|
|
function onSuccess(res, file) {
|
|
|
console.log(res, file)
|
|
|
model.value.code = res.name
|