update
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
<script setup>
|
||||
import Api from "../../api/index.js";
|
||||
import {useSystemStore} from "../../pinia/SystemStore/index.js";
|
||||
|
||||
const emits = defineEmits(['success']);
|
||||
const SystemStore = useSystemStore();
|
||||
|
||||
const upload = (e) => {
|
||||
const file = e.target.files[0];
|
||||
Api.system.uploadFile2(file).then(({data}) => {
|
||||
const api = SystemStore.isRoot ? Api.system.uploadFile : Api.system.uploadFile2;
|
||||
api(file).then(({data}) => {
|
||||
emits('success', data);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user