Browse Source

refactor&build: 删除无用代码与无用库

Roxas 3 years ago
parent
commit
3be5e3a936

+ 0
- 38
lib/components/Editor/Upload.js View File

40
 
40
 
41
 var _react2 = _interopRequireDefault(_react);
41
 var _react2 = _interopRequireDefault(_react);
42
 
42
 
43
-var _dayjs = require("dayjs");
44
-
45
-var _dayjs2 = _interopRequireDefault(_dayjs);
46
-
47
-var _shortid = require("shortid");
48
-
49
-var _shortid2 = _interopRequireDefault(_shortid);
50
-
51
 var _reactIntlUniversal = require("react-intl-universal");
43
 var _reactIntlUniversal = require("react-intl-universal");
52
 
44
 
53
 var _reactIntlUniversal2 = _interopRequireDefault(_reactIntlUniversal);
45
 var _reactIntlUniversal2 = _interopRequireDefault(_reactIntlUniversal);
68
 
60
 
69
 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
61
 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
70
 
62
 
71
-// const client = oss => {
72
-//   return new window.OSS.Wrapper({
73
-//     accessKeyId: oss.access_key_id,
74
-//     accessKeySecret: oss.access_key_secret,
75
-//     stsToken: oss.security_token,
76
-//     endpoint: OSS_ENDPOINT, //常量,你可以自己定义
77
-//     bucket: OSS_BUCKET
78
-//   });
79
-// };
80
-
81
-// const uploadPath = (path, file) => {
82
-//   return `${path}/${dayjs().format("YYYYMMDD")}/${shortid.generate()}.${
83
-//     file.type.split("/")[1]
84
-//   }`;
85
-// };
86
-
87
-// const UploadToOss = (oss, path, file) => {
88
-//   const url = uploadPath(path, file);
89
-//   return new Promise((resolve, reject) => {
90
-//     client(oss)
91
-//       .multipartUpload(url, file)
92
-//       .then(data => {
93
-//         resolve(data);
94
-//       })
95
-//       .catch(error => {
96
-//         reject(error);
97
-//       });
98
-//   });
99
-// };
100
-
101
 var App = function (_React$Component) {
63
 var App = function (_React$Component) {
102
   _inherits(App, _React$Component);
64
   _inherits(App, _React$Component);
103
 
65
 

+ 1
- 1
lib/components/Editor/Upload.js.map
File diff suppressed because it is too large
View File


+ 0
- 38
lib/components/Editor/index.js View File

36
 
36
 
37
 require("antd/es/input/style");
37
 require("antd/es/input/style");
38
 
38
 
39
-var _dayjs = require("dayjs");
40
-
41
-var _dayjs2 = _interopRequireDefault(_dayjs);
42
-
43
-var _shortid = require("shortid");
44
-
45
-var _shortid2 = _interopRequireDefault(_shortid);
46
-
47
 var _propTypes = require("prop-types");
39
 var _propTypes = require("prop-types");
48
 
40
 
49
 var _propTypes2 = _interopRequireDefault(_propTypes);
41
 var _propTypes2 = _interopRequireDefault(_propTypes);
90
 
82
 
91
 var TextArea = _input2.default.TextArea;
83
 var TextArea = _input2.default.TextArea;
92
 
84
 
93
-// const client = oss => {
94
-//   return new window.OSS.Wrapper({
95
-//     accessKeyId: oss.access_key_id,
96
-//     accessKeySecret: oss.access_key_secret,
97
-//     stsToken: oss.security_token,
98
-//     endpoint: OSS_ENDPOINT, //常量,你可以自己定义
99
-//     bucket: OSS_BUCKET
100
-//   });
101
-// };
102
-
103
-// const uploadPath = (path, file) => {
104
-//   return `${path}/${dayjs().format("YYYYMMDD")}/${shortid.generate()}.${
105
-//     file.type.split("/")[1]
106
-//   }`;
107
-// };
108
-
109
-// const UploadToOss = (oss, path, file) => {
110
-//   const url = uploadPath(path, file);
111
-//   return new Promise((resolve, reject) => {
112
-//     client(oss)
113
-//       .multipartUpload(url, file)
114
-//       .then(data => {
115
-//         resolve(data);
116
-//       })
117
-//       .catch(error => {
118
-//         reject(error);
119
-//       });
120
-//   });
121
-// };
122
-
123
 var Editor = function (_React$Component) {
85
 var Editor = function (_React$Component) {
124
   _inherits(Editor, _React$Component);
86
   _inherits(Editor, _React$Component);
125
 
87
 

+ 1
- 1
lib/components/Editor/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 2
package.json View File

23
     "react-dom": "^16.4.1",
23
     "react-dom": "^16.4.1",
24
     "react-intl-universal": "^1.15.2",
24
     "react-intl-universal": "^1.15.2",
25
     "react-scripts": "1.1.4",
25
     "react-scripts": "1.1.4",
26
-    "shortid": "^2.2.11",
27
     "webpack-version-file-plugin": "^0.3.3"
26
     "webpack-version-file-plugin": "^0.3.3"
28
   },
27
   },
29
   "lint-staged": {
28
   "lint-staged": {
42
     "lib": "babel ./src --out-dir ./lib --source-maps --copy-files"
41
     "lib": "babel ./src --out-dir ./lib --source-maps --copy-files"
43
   },
42
   },
44
   "devDependencies": {
43
   "devDependencies": {
45
-    "cross-env": "^5.2.0",
46
     "babel-cli": "^6.26.0",
44
     "babel-cli": "^6.26.0",
47
     "babel-plugin-import": "^1.8.0",
45
     "babel-plugin-import": "^1.8.0",
48
     "babel-plugin-transform-object-rest-spread": "^6.26.0",
46
     "babel-plugin-transform-object-rest-spread": "^6.26.0",
49
     "babel-preset-env": "^1.7.0",
47
     "babel-preset-env": "^1.7.0",
50
     "babel-preset-es2015": "^6.24.1",
48
     "babel-preset-es2015": "^6.24.1",
51
     "babel-preset-react": "^6.24.1",
49
     "babel-preset-react": "^6.24.1",
50
+    "cross-env": "^5.2.0",
52
     "husky": "^0.14.3",
51
     "husky": "^0.14.3",
53
     "lint-staged": "^7.2.0",
52
     "lint-staged": "^7.2.0",
54
     "node-sass": "^4.9.4",
53
     "node-sass": "^4.9.4",

+ 0
- 32
src/components/Editor/Upload.js View File

1
 import React from "react";
1
 import React from "react";
2
 import { Upload, Icon, Modal, message, Spin } from "antd";
2
 import { Upload, Icon, Modal, message, Spin } from "antd";
3
-import dayjs from "dayjs";
4
-import shortid from "shortid";
5
 import intl from "react-intl-universal";
3
 import intl from "react-intl-universal";
6
 import { DRIVER_LICENSE_PATH, ERROR_DEFAULT } from "../../constant";
4
 import { DRIVER_LICENSE_PATH, ERROR_DEFAULT } from "../../constant";
7
 import Comment from "../../Comment";
5
 import Comment from "../../Comment";
8
 import "./Upload.css";
6
 import "./Upload.css";
9
 
7
 
10
-// const client = oss => {
11
-//   return new window.OSS.Wrapper({
12
-//     accessKeyId: oss.access_key_id,
13
-//     accessKeySecret: oss.access_key_secret,
14
-//     stsToken: oss.security_token,
15
-//     endpoint: OSS_ENDPOINT, //常量,你可以自己定义
16
-//     bucket: OSS_BUCKET
17
-//   });
18
-// };
19
-
20
-// const uploadPath = (path, file) => {
21
-//   return `${path}/${dayjs().format("YYYYMMDD")}/${shortid.generate()}.${
22
-//     file.type.split("/")[1]
23
-//   }`;
24
-// };
25
-
26
-// const UploadToOss = (oss, path, file) => {
27
-//   const url = uploadPath(path, file);
28
-//   return new Promise((resolve, reject) => {
29
-//     client(oss)
30
-//       .multipartUpload(url, file)
31
-//       .then(data => {
32
-//         resolve(data);
33
-//       })
34
-//       .catch(error => {
35
-//         reject(error);
36
-//       });
37
-//   });
38
-// };
39
-
40
 class App extends React.Component {
8
 class App extends React.Component {
41
   constructor(props) {
9
   constructor(props) {
42
     super(props);
10
     super(props);

+ 0
- 32
src/components/Editor/index.js View File

1
-import dayjs from "dayjs";
2
-import shortid from "shortid";
3
 import PropTypes from "prop-types";
1
 import PropTypes from "prop-types";
4
 import classnames from "classnames";
2
 import classnames from "classnames";
5
 import React, { Fragment } from "react";
3
 import React, { Fragment } from "react";
16
 
14
 
17
 const { TextArea } = Input;
15
 const { TextArea } = Input;
18
 
16
 
19
-// const client = oss => {
20
-//   return new window.OSS.Wrapper({
21
-//     accessKeyId: oss.access_key_id,
22
-//     accessKeySecret: oss.access_key_secret,
23
-//     stsToken: oss.security_token,
24
-//     endpoint: OSS_ENDPOINT, //常量,你可以自己定义
25
-//     bucket: OSS_BUCKET
26
-//   });
27
-// };
28
-
29
-// const uploadPath = (path, file) => {
30
-//   return `${path}/${dayjs().format("YYYYMMDD")}/${shortid.generate()}.${
31
-//     file.type.split("/")[1]
32
-//   }`;
33
-// };
34
-
35
-// const UploadToOss = (oss, path, file) => {
36
-//   const url = uploadPath(path, file);
37
-//   return new Promise((resolve, reject) => {
38
-//     client(oss)
39
-//       .multipartUpload(url, file)
40
-//       .then(data => {
41
-//         resolve(data);
42
-//       })
43
-//       .catch(error => {
44
-//         reject(error);
45
-//       });
46
-//   });
47
-// };
48
-
49
 class Editor extends React.Component {
17
 class Editor extends React.Component {
50
   constructor(props) {
18
   constructor(props) {
51
     super(props);
19
     super(props);