n20-common-lib 2.20.8 → 2.20.10
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 +1 -1
- package/src/assets/css/normalize.scss +6 -20
- package/src/utils/axios.js +39 -0
- package/style/index.css +3 -3
- package/theme/blue.css +1 -1
- package/theme/cctcRed.css +1 -1
- package/theme/green.css +1 -1
- package/theme/lightBlue.css +1 -1
- package/theme/orange.css +1 -1
- package/theme/purple.css +1 -1
- package/theme/red.css +1 -1
- package/theme/yellow.css +1 -1
package/package.json
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
// .button-4em{min-width: 72px;}
|
|
4
4
|
/* 格式化样式 */
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
6
|
html {
|
|
9
7
|
height: 100%;
|
|
10
8
|
}
|
|
@@ -12,7 +10,7 @@ html {
|
|
|
12
10
|
body {
|
|
13
11
|
height: 100%;
|
|
14
12
|
font-size: $--font-size-base;
|
|
15
|
-
font-family: PingFang SC, Microsoft YaHei, SUN, Arial, sans-serif;
|
|
13
|
+
font-family: PingFang SC, Microsoft YaHei, SUN, Arial, sans-serif !important;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
li {
|
|
@@ -263,7 +261,7 @@ iframe {
|
|
|
263
261
|
.b-center {
|
|
264
262
|
text-align: center;
|
|
265
263
|
|
|
266
|
-
|
|
264
|
+
& > * {
|
|
267
265
|
display: inline-block;
|
|
268
266
|
vertical-align: bottom;
|
|
269
267
|
}
|
|
@@ -272,7 +270,7 @@ iframe {
|
|
|
272
270
|
.b-vertical {
|
|
273
271
|
font-size: 0;
|
|
274
272
|
|
|
275
|
-
|
|
273
|
+
& > * {
|
|
276
274
|
vertical-align: middle;
|
|
277
275
|
display: inline-block;
|
|
278
276
|
font-size: 14px;
|
|
@@ -335,13 +333,11 @@ iframe {
|
|
|
335
333
|
flex-direction: column;
|
|
336
334
|
}
|
|
337
335
|
|
|
338
|
-
.flex-box
|
|
339
|
-
.flex-column
|
|
336
|
+
.flex-box > *,
|
|
337
|
+
.flex-column > * {
|
|
340
338
|
flex: none;
|
|
341
339
|
}
|
|
342
340
|
|
|
343
|
-
|
|
344
|
-
|
|
345
341
|
.flex {
|
|
346
342
|
&-wrap {
|
|
347
343
|
flex-wrap: wrap;
|
|
@@ -394,12 +390,6 @@ iframe {
|
|
|
394
390
|
}
|
|
395
391
|
}
|
|
396
392
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
393
|
/* 旋转图标90度
|
|
404
394
|
-------------- */
|
|
405
395
|
.rotate90 {
|
|
@@ -486,7 +476,6 @@ iframe {
|
|
|
486
476
|
/* 边框
|
|
487
477
|
-------------- */
|
|
488
478
|
.bd {
|
|
489
|
-
|
|
490
479
|
&-none,
|
|
491
480
|
&-0 {
|
|
492
481
|
border: none !important;
|
|
@@ -835,7 +824,6 @@ $list: 45, 60, 80, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 2
|
|
|
835
824
|
}
|
|
836
825
|
|
|
837
826
|
@keyframes ping {
|
|
838
|
-
|
|
839
827
|
75%,
|
|
840
828
|
100% {
|
|
841
829
|
transform: scale(2);
|
|
@@ -844,7 +832,6 @@ $list: 45, 60, 80, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 2
|
|
|
844
832
|
}
|
|
845
833
|
|
|
846
834
|
@keyframes pulse {
|
|
847
|
-
|
|
848
835
|
0%,
|
|
849
836
|
100% {
|
|
850
837
|
opacity: 1;
|
|
@@ -856,7 +843,6 @@ $list: 45, 60, 80, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 2
|
|
|
856
843
|
}
|
|
857
844
|
|
|
858
845
|
@keyframes bounce {
|
|
859
|
-
|
|
860
846
|
0%,
|
|
861
847
|
100% {
|
|
862
848
|
transform: translateY(-25%);
|
|
@@ -867,4 +853,4 @@ $list: 45, 60, 80, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 2
|
|
|
867
853
|
transform: translateY(0);
|
|
868
854
|
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
869
855
|
}
|
|
870
|
-
}
|
|
856
|
+
}
|
package/src/utils/axios.js
CHANGED
|
@@ -123,12 +123,33 @@ function errorFn(status, msg, noMsg, isErr, res) {
|
|
|
123
123
|
|
|
124
124
|
axios.interceptors.response.use(
|
|
125
125
|
(res) => {
|
|
126
|
+
res.status = 906
|
|
127
|
+
console.log(res, 'res')
|
|
126
128
|
let status = (res.data && res.data.code) || res.status
|
|
127
129
|
if (Number(status) === 200) {
|
|
128
130
|
return res
|
|
129
131
|
} else {
|
|
130
132
|
let msg = (res.data && (res.data.msg || res.data.message)) || ''
|
|
131
133
|
let noMsg = res.config && res.config.noMsg
|
|
134
|
+
// 如果是 blob 类型,需要读取错误信息
|
|
135
|
+
if (res.config.responseType === 'blob') {
|
|
136
|
+
return new Promise((resolve, reject) => {
|
|
137
|
+
const reader = new FileReader()
|
|
138
|
+
reader.onload = (e) => {
|
|
139
|
+
try {
|
|
140
|
+
const result = JSON.parse(e.target.result)
|
|
141
|
+
console.log(result, 'result')
|
|
142
|
+
msg = result.msg || result.message || msg
|
|
143
|
+
errorFn(status, msg, noMsg, false, res)
|
|
144
|
+
reject({ code: status, msg: msg, response: res })
|
|
145
|
+
} catch (error) {
|
|
146
|
+
// 如果解析失败,说明可能是正常的文件下载
|
|
147
|
+
resolve(res)
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
reader.readAsText(res.data)
|
|
151
|
+
})
|
|
152
|
+
}
|
|
132
153
|
|
|
133
154
|
return errorFn(status, msg, noMsg, false, res)
|
|
134
155
|
}
|
|
@@ -137,6 +158,24 @@ axios.interceptors.response.use(
|
|
|
137
158
|
let status = err.status
|
|
138
159
|
let msg = err.message || ''
|
|
139
160
|
let noMsg = err.config && err.config.noMsg
|
|
161
|
+
// 如果是 blob 类型的错误响应
|
|
162
|
+
if (err.config && err.config.responseType === 'blob') {
|
|
163
|
+
return new Promise((resolve, reject) => {
|
|
164
|
+
const reader = new FileReader()
|
|
165
|
+
reader.onload = (e) => {
|
|
166
|
+
try {
|
|
167
|
+
const result = JSON.parse(e.target.result)
|
|
168
|
+
msg = result.msg || result.message || msg
|
|
169
|
+
errorFn(status, msg, noMsg, true)
|
|
170
|
+
reject({ code: status, msg: msg, response: err.response })
|
|
171
|
+
} catch (error) {
|
|
172
|
+
errorFn(status, msg, noMsg, true)
|
|
173
|
+
reject(err)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
reader.readAsText(err.response.data)
|
|
177
|
+
})
|
|
178
|
+
}
|
|
140
179
|
|
|
141
180
|
return errorFn(status, msg, noMsg, true)
|
|
142
181
|
}
|