变更
This commit is contained in:
parent
3f1c339634
commit
b0615ba36d
|
@ -109,7 +109,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref,reactive,onMounted } from 'vue';
|
||||
import { Delete, Plus, ZoomIn } from '@element-plus/icons-vue';
|
||||
import type { UploadFile } from 'element-plus';
|
||||
import {ElMessage, type UploadFile} from 'element-plus';
|
||||
import myAxios from "@/api/myAxios";
|
||||
|
||||
const dialogImageUrl = ref('');
|
||||
|
@ -139,6 +139,7 @@ const form = reactive({
|
|||
})
|
||||
onMounted(()=>{
|
||||
addProduct()
|
||||
upload()
|
||||
})
|
||||
const addProduct = async () => {
|
||||
const res = await myAxios.post('goods/add',{
|
||||
|
@ -148,11 +149,25 @@ const addProduct = async () => {
|
|||
type: form.resource,
|
||||
label : form.label,
|
||||
intro : form.desc,
|
||||
goodImage : file.url,
|
||||
introDetail : file.url,
|
||||
festivalOrder : form.festivalName
|
||||
})
|
||||
console.log(res.data)
|
||||
if(res.data.code == 1){
|
||||
ElMessage({
|
||||
message: '上架成功',
|
||||
type: 'success'
|
||||
})
|
||||
}else{
|
||||
ElMessage({
|
||||
message: '上架失败',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
}
|
||||
const upload = async () => {
|
||||
const res = await myAxios.post('file/upload/server',{
|
||||
multipartFile : uploadedFiles.value,
|
||||
biz : uploadedDescription.value
|
||||
})
|
||||
}
|
||||
// onMounted(() => {
|
||||
// getProductInformation()
|
||||
|
|
Loading…
Reference in New Issue
Block a user