Sfoglia il codice sorgente

request params handle updated

hare8999@163.com 2 anni fa
parent
commit
5c5c054f09

+ 6 - 0
src/api/webApi/elective/generation.js

@@ -39,6 +39,7 @@ export function applyElectiveDMAlgorithm(algorithm, roundId) {
   return request({
     url: '/front/elective/generation/applyElectiveDMAlgorithm',
     method: 'post',
+    paramsAsGet: true,
     params
   })
 }
@@ -58,6 +59,7 @@ export function enrollByForce(params) {
   return request({
     url: '/front/elective/generation/enrollByForce',
     method: 'post',
+    paramsAsGet: true,
     params
   })
 }
@@ -68,6 +70,7 @@ export function flushIntoGenerationDM(params) {
   return request({
     url: '/front/elective/generation/flushIntoGenerationDM',
     method: 'post',
+    paramsAsGet: true,
     params
   })
 }
@@ -78,6 +81,7 @@ export function jumpGenerationForceAdjust(params) {
   return request({
     url: '/front/elective/generation/jumpGenerationForceAdjust',
     method: 'post',
+    paramsAsGet: true,
     params
   })
 }
@@ -88,6 +92,7 @@ export function jumpGenerationRankBalance(params) {
   return request({
     url: '/front/elective/generation/jumpGenerationRankBalance',
     method: 'post',
+    paramsAsGet: true,
     params
   })
 }
@@ -108,6 +113,7 @@ export function terminateGeneration(params) {
   return request({
     url: '/front/elective/generation/terminateGeneration',
     method: 'post',
+    paramsAsGet: true,
     params
   })
 }

+ 2 - 3
src/utils/request.js

@@ -1,6 +1,5 @@
 import axios from 'axios'
-import { Notification, MessageBox, Message } from 'element-ui'
-import store from '@/store'
+import { Message, MessageBox, Notification } from 'element-ui'
 import auth from '@/utils/auth'
 import errorCode from '@/utils/errorCode'
 
@@ -22,7 +21,7 @@ service.interceptors.request.use(config => {
   }
 
   // 映射params参数
-  if (config.params) {
+  if ((config.method == 'get' || config['paramsAsGet']) && config.params) {
     let url = config.url + '?'
     for (const propName of Object.keys(config.params)) {
       const value = config.params[propName]

+ 0 - 2
src/views/questioncenter/practice.vue

@@ -90,14 +90,12 @@ export default {
     if (this.chapterId) {
       getQuestionsByChapter({ chapterId: this.chapterId }).then((res) => {
         this.queList = this.formatQueList(res.data);
-        this.answerForm.key = console.log(res);
         this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
       });
     } else if (this.knowledgeId) {
       getQuestionsByKnowledge({ knowledgeId: this.knowledgeId }).then((res) => {
         this.queList = this.formatQueList(res.data);
         this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
-        console.log(res);
       });
     }
   },