Sfoglia il codice sorgente

优化公共请求功能

张启 4 anni fa
parent
commit
4460ec0987
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 0 0
      future-ui/src/utils/jsonlint.js
  2. 2 2
      future-ui/src/utils/request.js

+ 0 - 0
future-ui/src/utils/JsonFormat.js → future-ui/src/utils/jsonlint.js


+ 2 - 2
future-ui/src/utils/request.js

@@ -3,7 +3,7 @@ import { Notification, MessageBox, Message } from 'element-ui';
 import store from '@/store';
 import { getToken } from '@/utils/auth';
 import errorCode from '@/utils/errorCode';
-import jsonFormat from "@/utils/JsonFormat";
+import jsonlint from "@/utils/jsonlint";
 import Snowflake from '@/utils/Snowflake';
 
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
@@ -17,7 +17,7 @@ const service = axios.create({
     // Do whatever you want to transform the data
     if (typeof data === 'string') {
       try {
-        data = jsonFormat.parse(data);
+        data = jsonlint.parse(data);
       } catch (e) { /* Ignore */ }
     }
     return data;