zcy преди 3 години
родител
ревизия
a8e3b98cdc
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 5 5
      src/utils/request.js

+ 5 - 5
src/utils/request.js

@@ -1,8 +1,8 @@
 import axios from 'axios'
-import {MessageBox, Message} from 'element-ui'
+import { MessageBox, Message } from 'element-ui'
 import store from '@/store'
-import {getToken} from '@/utils/auth'
-import {aesEncrypt_HmacSha256} from './encryption/utils.js'
+import { getToken } from '@/utils/auth'
+import { aesEncrypt_HmacSha256 } from './encryption/utils.js'
 import * as queryString from 'query-string'
 import moment from 'moment'
 
@@ -40,9 +40,9 @@ service.interceptors.request.use(
     }
     var paramsObject = ''
     if (config.method === 'get' || config.method === 'delete') {
-      paramsObject = config.params
+      paramsObject = Object.assign({}, config.params)
     } else if (config.method === 'post' || config.method === 'put') {
-      paramsObject = config.data
+      paramsObject = Object.assign({}, config.data)
       Object.keys(paramsObject).forEach(key => {
         var item = paramsObject[key]
         if (item === null || item === undefined) {