n20-common-lib 2.9.100 → 2.9.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n20-common-lib",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.102",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"fuse.js": "^6.6.2",
|
|
98
98
|
"html-webpack-tags-plugin": "^2.0.17",
|
|
99
99
|
"jest": "^27.0.5",
|
|
100
|
+
"json-bigint": "^1.0.0",
|
|
100
101
|
"jszip": "^3.10.0",
|
|
101
102
|
"md2vue-loader": "file:./md2vue-loader",
|
|
102
103
|
"mockjs": "^1.1.0",
|
package/src/utils/axios.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _axios from 'axios'
|
|
2
2
|
import ElementUI from 'element-ui'
|
|
3
|
+
import JSONBig from 'json-bigint'
|
|
3
4
|
import auth from './auth'
|
|
4
5
|
import { $lc } from './i18n/index'
|
|
5
6
|
const _Loading = ElementUI.Loading
|
|
@@ -51,7 +52,12 @@ let loadingCount = 0
|
|
|
51
52
|
function showLoading(opt) {
|
|
52
53
|
let loading = opt.loading
|
|
53
54
|
if (loading === true) {
|
|
54
|
-
if (
|
|
55
|
+
if (
|
|
56
|
+
loadingCount === 0 &&
|
|
57
|
+
!document.querySelector(
|
|
58
|
+
'.xhr-loading-top:not(.el-loading-fade-leave-active)'
|
|
59
|
+
)
|
|
60
|
+
) {
|
|
55
61
|
loadingBox = _Loading.service({
|
|
56
62
|
lock: true,
|
|
57
63
|
text: $lc('加载中'),
|
|
@@ -83,7 +89,15 @@ const config = {
|
|
|
83
89
|
timeout: 120000,
|
|
84
90
|
validateStatus(status) {
|
|
85
91
|
return status === 200
|
|
86
|
-
}
|
|
92
|
+
},
|
|
93
|
+
// 处理big数据
|
|
94
|
+
transformResponse: [
|
|
95
|
+
function (data) {
|
|
96
|
+
const json = JSONBig({ storeAsString: true })
|
|
97
|
+
const res = json.parse(data)
|
|
98
|
+
return res
|
|
99
|
+
}
|
|
100
|
+
]
|
|
87
101
|
}
|
|
88
102
|
const axios = _axios.create(config)
|
|
89
103
|
|