From 7b83b2c30ce60a811cb4aa4cb7b494e0bb36699d Mon Sep 17 00:00:00 2001 From: linjianshan <1355969979@qq.com> Date: Thu, 17 Nov 2022 17:55:27 +0800 Subject: [PATCH] fix-param tansfer exception Signed-off-by: linjianshan <1355969979@qq.com> --- .gitignore | 3 ++- config/review.env_demo.js | 24 ++++++++++++++++++++ src/components/Inspect/inspectDataSet.vue | 5 ++-- src/components/Review/reviewUploadByFile.vue | 5 ++-- 4 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 config/review.env_demo.js diff --git a/.gitignore b/.gitignore index bfae702..6af8fef 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ yarn-error.log* *.sln package-lock.json -https.env.js \ No newline at end of file +https.env.js +config/review.env.js diff --git a/config/review.env_demo.js b/config/review.env_demo.js new file mode 100644 index 0000000..2246d96 --- /dev/null +++ b/config/review.env_demo.js @@ -0,0 +1,24 @@ +import axios from "axios"; +// export { default } from "axios" +// axios.defaults.baseURL = "http://{Server-IP}}/api/v1"; +// axios.defaults.baseURL = ""; +const ax = axios.create({ + baseURL:"http://{Server-IP}:port", + timeout:5000, + headers:{ + 'Content-Type': "application/json; charset=utf-8" + } +}) +ax.interceptors.response.use( + config => { + if (config.status === 200) { + + return config.data; + } + }, + error => { + error.message = '请求超时或服务器异常,请检查网络或联系管理员!' + return Promise.reject(error) + } +) +export default ax diff --git a/src/components/Inspect/inspectDataSet.vue b/src/components/Inspect/inspectDataSet.vue index 9eec18b..70c6b22 100644 --- a/src/components/Inspect/inspectDataSet.vue +++ b/src/components/Inspect/inspectDataSet.vue @@ -318,9 +318,9 @@ export default { this.currentData ] } + data.pending_review_list[0].size = data.pending_review_list[0].size +this.sizeOptionsValue requestService.saveTempReviewData(data).then(param => { - - this.currentData.size=this.currentData.size+""+this.sizeOptionsValue; + // this.currentData.size=this.currentData.size+""+this.sizeOptionsValue; this.tableData[this.index] = this.currentData this.reloadTable = !this.reloadTable this.successMess('Staging succeeded') @@ -342,6 +342,7 @@ export default { this.currentData ] } + data.pending_review_list[0].size = data.pending_review_list[0].size +this.sizeOptionsValue requestService.submitReviewData(data).then(param => { this.successMess('submit success') this.tableAllData.splice(this.index, 1) diff --git a/src/components/Review/reviewUploadByFile.vue b/src/components/Review/reviewUploadByFile.vue index 5209cee..2e32042 100644 --- a/src/components/Review/reviewUploadByFile.vue +++ b/src/components/Review/reviewUploadByFile.vue @@ -32,6 +32,7 @@ export default { data(){ return{ fileList:[], + userId:sessionStorage.getItem("userId") } }, created() { @@ -51,8 +52,8 @@ export default { console.log("click:",this.$refs.upload) console.log("click fileList:",this.fileList) const data = { - user_id:33, - dataset_review_list:this.fileList[0].raw + "user_id": this.userId, + "dataset_review_list":this.fileList[0].raw } requestService.uploadFiles(data).then( res => { Message(