wolyshaw 4 年之前
父節點
當前提交
bce6f31a0f
共有 3 個文件被更改,包括 10 次插入6 次删除
  1. 7 4
      src/utils/request2.js
  2. 1 1
      src/views/auditList/index.vue
  3. 2 1
      src/views/teamDetail/api.js

+ 7 - 4
src/utils/request2.js

@@ -2,6 +2,7 @@ import ElementUI from 'element-ui'
 import axios from 'axios'
 import { Message } from 'element-ui'
 import store from '@/store'
+import qs from 'querystring'
 import { getToken } from '@/utils/auth'
 import cleanDeep from 'clean-deep'
 // import { Loading } from 'element-ui'
@@ -96,12 +97,14 @@ service.interceptors.request.use(
       // ['X-Token'] is a custom headers key
       // please modify it according to the actual situation
       config.headers['Authorization'] = getToken()
-      if (config.requestType === 'form') {
-        config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
-      }
+    }
+    if (config.requestType === 'form') {
+      config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
+      config.data = qs.stringify(cleanDeep(config.data))
+    } else {
+      config.data = cleanDeep(config.data)
     }
     config.params = cleanDeep(config.params)
-    config.data = cleanDeep(config.data)
     return config
   },
   error => {

+ 1 - 1
src/views/auditList/index.vue

@@ -148,7 +148,7 @@
           >
             <template slot-scope="scope">
               <div>
-                {{ scope.row.auditStatus | auditType }} 
+                {{ scope.row.auditStatus | auditType }}
               </div>
             </template>
           </el-table-column>

+ 2 - 1
src/views/teamDetail/api.js

@@ -11,5 +11,6 @@ export const queryRemainCourseTypeDuration = data => request2({
 export const updateClassGroupStudents = data => request2({
   url: '/api-web/classGroupStudent/updateClassGroupStudents',
   data,
-  method: 'post'
+  method: 'post',
+  requestType: 'form'
 })