diff --git a/dangan-ui/src/views/dangan/collection/index.vue b/dangan-ui/src/views/dangan/collection/index.vue index 054ae7b..1d5e2ca 100644 --- a/dangan-ui/src/views/dangan/collection/index.vue +++ b/dangan-ui/src/views/dangan/collection/index.vue @@ -212,6 +212,7 @@ import { listBookshelf } from "@/api/dangan/bookshelf"; import { collectSaves, collectRecongnize } from "@/api/dangan/collection"; import '@/utils/WebScan'; import axios from 'axios' +import qs from 'qs' export default { name: "Collection", @@ -598,8 +599,6 @@ export default { this.openProgress = false; }); - this.getProgress() - this.Interval = setInterval(()=> { if(this.percentage===100||this.percentage>100){ clearInterval(this.Interval); @@ -641,12 +640,16 @@ export default { /** 查询识别进度 */ getProgress() { // 向给定ID的用户发起请求 - axios.get('http://123.57.142.195:443/get_file_count',{ params: { - username: this.$store.state.user.name - }}) - .then(function (response) { - this.percentage = (response.data.file_counts/this.pictureRecard.length)*100 - }).catch(function (error) { + axios.post('http://123.57.142.195:443/get_file_count',`username=${this.$store.state.user.name}`, { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }) + .then( (response)=> { + console.log(response.data.file_counts); + this.percentage = Math.round((response.data.file_counts/this.pictureRecard.length)*100); + console.log(this.percentage); + }).catch((error)=> { // 处理错误情况 console.log(error); }) diff --git a/dangan-ui/src/views/dangan/pictureRecard/index.vue b/dangan-ui/src/views/dangan/pictureRecard/index.vue index 688a5ce..d0d200c 100644 --- a/dangan-ui/src/views/dangan/pictureRecard/index.vue +++ b/dangan-ui/src/views/dangan/pictureRecard/index.vue @@ -309,9 +309,12 @@ export default { /** 查询识别进度 */ getProgress() { // 向给定ID的用户发起请求 - axios.get('http://123.57.142.195:443/get_file_count') - .then(function (response) { - this.percentage = (response.data.file_counts/this.selectionList.length)*100 + axios.post('http://123.57.142.195:443/get_file_count',`username=${this.$store.state.user.name}`, { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }).then(function (response) { + this.percentage = Math.round((response.data.file_counts/this.selectionList.length)*100) }).catch(function (error) { // 处理错误情况 console.log(error);