Merge remote-tracking branch 'origin/master'

master
Yangwl 2 years ago
commit 3def5d8783

@ -8,11 +8,13 @@
action="#"
class="avatar-uploader"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar"/>
<el-icon v-else class="avatar-uploader-icon">
<el-icon class="avatar-uploader-icon">
<Plus/>
</el-icon>
</el-upload>
<div v-for="item in imageUrl" style="margin: 0 12px">
<img v-if="item" :src="item" class="avatar"/>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">Create</el-button>
@ -35,23 +37,22 @@ const {t} = useI18n();
const locale = (Cookies.get('language') || 'zhCn') === 'zhCn'
const {proxy} = getCurrentInstance();
const {sys_normal_disable} = proxy.useDict("sys_normal_disable");
const imageUrl = ref('')
const imageUrl = ref([''])
const form = reactive({
imgUrl: '',
const form = ref({
imgUrl: [''],
})
const onSubmit = () => {
console.log('submit!')
}
const requestUpload = (e) => {
console.log(e)
let formData = new FormData();
formData.append("avatarfile", e.file);
uploadImg(formData).then(response => {
console.log(response)
form.value.imgUrl = response.imgUrl
imageUrl.value = import.meta.env.VITE_APP_BASE_API+response.imgUrl
form.value.imgUrl.push(response.imgUrl)
imageUrl.value.push(import.meta.env.VITE_APP_BASE_API + response.imgUrl)
});
}
</script>

@ -2,6 +2,7 @@ import {defineConfig, loadEnv} from 'vite'
import path from 'path'
import createVitePlugins from './vite/plugins'
import basicSsl from '@vitejs/plugin-basic-ssl'
import fs from 'fs'
// https://vitejs.dev/config/
export default defineConfig(({mode, command}) => {

Loading…
Cancel
Save