doway-coms 1.4.34 → 1.4.36

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.
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "doway-coms",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "doway-coms.common.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC"
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doway-coms",
3
- "version": "1.4.34",
3
+ "version": "1.4.36",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -337,7 +337,6 @@ import {
337
337
  Icon,
338
338
  Select,
339
339
  SelectOption,
340
- RangePicker,
341
340
  Tag,
342
341
  DatePicker,
343
342
  InputGroup,
@@ -355,9 +354,9 @@ export default {
355
354
  Icon,
356
355
  Select,
357
356
  SelectOption: Select.Option,
358
- RangePicker,
359
357
  Tag,
360
358
  DatePicker,
359
+ RangePicker: DatePicker.RangePicker,
361
360
  Input,
362
361
  InputGroup: Input.Group,
363
362
  InputNumber,
@@ -28,12 +28,28 @@ service.interceptors.request.use(
28
28
  // respone interceptor
29
29
  service.interceptors.response.use(
30
30
  response => {
31
- // store.dispatch(
32
- // "setLastRequireTime",
33
- // moment().format("YYYY-MM-DD HH:mm:ss")
34
- // );
35
-
36
31
  const res = response.data
32
+ // 导出文件进入判断
33
+ if (res instanceof Blob) {
34
+ if (res.type === 'application/json') {
35
+ const enc = new TextDecoder('utf-8');
36
+ res.arrayBuffer().then((buffer) => {
37
+ const tempData = JSON.parse(enc.decode(new Uint8Array(buffer))) || {};
38
+ if (tempData['code'] && tempData['code'] === 500) {
39
+ notification.error({
40
+ message: '错误信息',
41
+ top:"100px",
42
+ description: h => {
43
+ return h('div', null, [
44
+ h('p', { domProps: { innerHTML: tempData['msg'] } }, null)
45
+ ])
46
+ }
47
+ })
48
+ }
49
+ });
50
+ }
51
+ return response;
52
+ }
37
53
  if (res.status === 200 || res.code === 200) {
38
54
  return response.data
39
55
  }
@@ -41,7 +57,6 @@ service.interceptors.response.use(
41
57
  return response.data
42
58
  }
43
59
  if (res.code === 401) {
44
- // alert('会话过期2');
45
60
  store.dispatch('logOut')
46
61
  return Promise.reject(res.msg)
47
62
  }
@@ -53,10 +68,7 @@ service.interceptors.response.use(
53
68
  h('p', { domProps: { innerHTML: res.msg } }, null)
54
69
  ])
55
70
  }
56
- // description:parseContent.content
57
71
  })
58
-
59
- // notification['error']({ message: '错误信息', description: res.msg })
60
72
  return Promise.reject(res.msg)
61
73
  },
62
74
  error => {