|
@@ -96,7 +96,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { toolInfo, uploadTool } from "../api";
|
|
|
|
|
|
+import { packageInfo, uploadPackage } from "../api";
|
|
import { fileMD5 } from "@/plugins/md5";
|
|
import { fileMD5 } from "@/plugins/md5";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -107,6 +107,7 @@ export default {
|
|
install: {},
|
|
install: {},
|
|
upgrade: {},
|
|
upgrade: {},
|
|
},
|
|
},
|
|
|
|
+ toolType: "PICTURE_DOWNLOAD",
|
|
fileType: "INSTALL",
|
|
fileType: "INSTALL",
|
|
result: {
|
|
result: {
|
|
message: "",
|
|
message: "",
|
|
@@ -152,7 +153,7 @@ export default {
|
|
this.uploadController = null;
|
|
this.uploadController = null;
|
|
},
|
|
},
|
|
async getInfo() {
|
|
async getInfo() {
|
|
- const res = await toolInfo();
|
|
|
|
|
|
+ const res = await packageInfo({ toolType: this.toolType });
|
|
this.info = res || {};
|
|
this.info = res || {};
|
|
},
|
|
},
|
|
handleFileChange(file) {
|
|
handleFileChange(file) {
|
|
@@ -165,12 +166,13 @@ export default {
|
|
this.uploadController = new AbortController();
|
|
this.uploadController = new AbortController();
|
|
this.loading = true;
|
|
this.loading = true;
|
|
let formData = new FormData();
|
|
let formData = new FormData();
|
|
|
|
+ formData.append("toolType", this.toolType);
|
|
formData.append("type", this.fileType);
|
|
formData.append("type", this.fileType);
|
|
formData.append("file", options.file);
|
|
formData.append("file", options.file);
|
|
const md5 = await fileMD5(options.file);
|
|
const md5 = await fileMD5(options.file);
|
|
formData.append("md5", md5);
|
|
formData.append("md5", md5);
|
|
|
|
|
|
- return uploadTool(formData, {
|
|
|
|
|
|
+ return uploadPackage(formData, {
|
|
timeout: 60 * 60 * 1000,
|
|
timeout: 60 * 60 * 1000,
|
|
signal: this.uploadController.signal,
|
|
signal: this.uploadController.signal,
|
|
onUploadProgress: ({ loaded, total }) => {
|
|
onUploadProgress: ({ loaded, total }) => {
|