Roxas 4 年 前
コミット
e8f9c7967e

+ 1
- 1
lib/components/AudioPlayer/index.js.map
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 30
- 25
lib/components/Editor/Upload.js ファイルの表示

@@ -68,30 +68,35 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
68 68
 
69 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; }
70 70
 
71
-var client = function 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: _constant.OSS_ENDPOINT, //常量,你可以自己定义
77
-    bucket: _constant.OSS_BUCKET
78
-  });
79
-};
80
-
81
-var uploadPath = function uploadPath(path, file) {
82
-  return path + "/" + (0, _dayjs2.default)().format("YYYYMMDD") + "/" + _shortid2.default.generate() + "." + file.type.split("/")[1];
83
-};
84
-
85
-var UploadToOss = function UploadToOss(oss, path, file) {
86
-  var url = uploadPath(path, file);
87
-  return new Promise(function (resolve, reject) {
88
-    client(oss).multipartUpload(url, file).then(function (data) {
89
-      resolve(data);
90
-    }).catch(function (error) {
91
-      reject(error);
92
-    });
93
-  });
94
-};
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
+// };
95 100
 
96 101
 var App = function (_React$Component) {
97 102
   _inherits(App, _React$Component);
@@ -163,7 +168,7 @@ var App = function (_React$Component) {
163 168
       reader.onloadend = function () {
164 169
         info.onProgress({ percent: 20 });
165 170
         // DRIVER_LICENSE_PATH oss 的存储路径位置
166
-        UploadToOss(_this2.props.app.oss, _constant.DRIVER_LICENSE_PATH, file).then(function (data) {
171
+        _this2.props.app.UploadToOss(_this2.props.app.oss, _constant.DRIVER_LICENSE_PATH, file).then(function (data) {
167 172
           info.onProgress({ percent: 100 });
168 173
           info.onSuccess(data);
169 174
           _this2.props.onUpload({ path: data.name, uid: file.uid });

+ 1
- 1
lib/components/Editor/Upload.js.map
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 30
- 26
lib/components/Editor/index.js ファイルの表示

@@ -90,31 +90,35 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
90 90
 
91 91
 var TextArea = _input2.default.TextArea;
92 92
 
93
-
94
-var client = function client(oss) {
95
-  return new window.OSS.Wrapper({
96
-    accessKeyId: oss.access_key_id,
97
-    accessKeySecret: oss.access_key_secret,
98
-    stsToken: oss.security_token,
99
-    endpoint: _constant.OSS_ENDPOINT, //常量,你可以自己定义
100
-    bucket: _constant.OSS_BUCKET
101
-  });
102
-};
103
-
104
-var uploadPath = function uploadPath(path, file) {
105
-  return path + "/" + (0, _dayjs2.default)().format("YYYYMMDD") + "/" + _shortid2.default.generate() + "." + file.type.split("/")[1];
106
-};
107
-
108
-var UploadToOss = function UploadToOss(oss, path, file) {
109
-  var url = uploadPath(path, file);
110
-  return new Promise(function (resolve, reject) {
111
-    client(oss).multipartUpload(url, file).then(function (data) {
112
-      resolve(data);
113
-    }).catch(function (error) {
114
-      reject(error);
115
-    });
116
-  });
117
-};
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
+// };
118 122
 
119 123
 var Editor = function (_React$Component) {
120 124
   _inherits(Editor, _React$Component);
@@ -313,7 +317,7 @@ var Editor = function (_React$Component) {
313 317
       reader.readAsDataURL(file);
314 318
       reader.onloadend = function () {
315 319
         // DRIVER_LICENSE_PATH oss 的存储路径位置
316
-        UploadToOss(_this2.props.app.oss, _constant.DRIVER_LICENSE_PATH, file).then(function (data) {
320
+        _this2.props.app.UploadToOss(_this2.props.app.oss, _constant.DRIVER_LICENSE_PATH, file).then(function (data) {
317 321
           var fileList = _this2.state.fileList.concat({
318 322
             url: _constant.OSS_LINK + data.name,
319 323
             thumbUrl: _constant.OSS_LINK + data.name,

+ 1
- 1
lib/components/Editor/index.js.map
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 0
- 2
lib/constant.js ファイルの表示

@@ -7,8 +7,6 @@ var ERROR_DEFAULT = exports.ERROR_DEFAULT = "出错了!";
7 7
 
8 8
 var LIMIT = exports.LIMIT = 10; // 默认 limit
9 9
 
10
-var OSS_ENDPOINT = exports.OSS_ENDPOINT = "oss-cn-beijing.aliyuncs.com";
11
-var OSS_BUCKET = exports.OSS_BUCKET = "links-comment";
12 10
 var DRIVER_LICENSE_PATH = exports.DRIVER_LICENSE_PATH = "/comment";
13 11
 
14 12
 var OSS_LINK = exports.OSS_LINK = "//links-comment.oss-cn-beijing.aliyuncs.com";

+ 1
- 1
lib/constant.js.map ファイルの表示

@@ -1 +1 @@
1
-{"version":3,"sources":["../src/constant.js"],"names":["ERROR_DEFAULT","LIMIT","OSS_ENDPOINT","OSS_BUCKET","DRIVER_LICENSE_PATH","OSS_LINK","MAX_UPLOAD_NUMBER","URL_REGEXP","REGEXP","AVATAR","IMAGE_SPLIT","IMAGE_PROCESS","IMAGE_PROCESS_SMALL","IMAGE_PROCESS_LARGE","COMMENT_TYPE","COMMENT","REPLY","LANGUAGE_LINK","process","env","NODE_ENV"],"mappings":";;;;;AAAO,IAAMA,wCAAgB,MAAtB;;AAEA,IAAMC,wBAAQ,EAAd,C,CAAkB;;AAElB,IAAMC,sCAAe,6BAArB;AACA,IAAMC,kCAAa,eAAnB;AACA,IAAMC,oDAAsB,UAA5B;;AAEA,IAAMC,8BAAW,6CAAjB;;AAEA,IAAMC,gDAAoB,CAA1B;;AAEA,IAAMC,kCAAa,oGAAnB;;AAEA,IAAMC,0BAAS,eAAf;;AAEA,IAAMC,0BAAS,EAAf;;AAEA,IAAMC,oCAAc,aAApB;;AAEA,IAAMC,wCAAgB,mCAAtB;AACA,IAAMC,oDAAsB,mCAA5B;AACA,IAAMC,oDAAsB,mCAA5B;;AAEA,IAAMC,sCAAe;AAC1BC,WAAS,SADiB;AAE1BC,SAAO;AAFmB,CAArB;;AAKP;AACO,IAAMC,wCACXC,QAAQC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,GACI,sBADJ,GAEI,uBAHC","file":"constant.js","sourcesContent":["export const ERROR_DEFAULT = \"出错了!\";\n\nexport const LIMIT = 10; // 默认 limit\n\nexport const OSS_ENDPOINT = \"oss-cn-beijing.aliyuncs.com\";\nexport const OSS_BUCKET = \"links-comment\";\nexport const DRIVER_LICENSE_PATH = \"/comment\";\n\nexport const OSS_LINK = \"//links-comment.oss-cn-beijing.aliyuncs.com\";\n\nexport const MAX_UPLOAD_NUMBER = 4;\n\nexport const URL_REGEXP = /((http(s)?:)?\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g;\n\nexport const REGEXP = /\\[[^[\\]]+?\\]/g;\n\nexport const AVATAR = \"\";\n\nexport const IMAGE_SPLIT = \"IMAGE_SPLIT\";\n\nexport const IMAGE_PROCESS = \"?x-oss-process=image/resize,h_350\";\nexport const IMAGE_PROCESS_SMALL = \"?x-oss-process=image/resize,h_100\";\nexport const IMAGE_PROCESS_LARGE = \"?x-oss-process=image/resize,h_500\";\n\nexport const COMMENT_TYPE = {\n  COMMENT: \"comment\",\n  REPLY: \"reply\"\n};\n\n// 线上静态库地址\nexport const LANGUAGE_LINK =\n  process.env.NODE_ENV === \"production\"\n    ? \"//a.links123.cn/lang\"\n    : \"//a.links123.net/lang\";\n"]}
1
+{"version":3,"sources":["../src/constant.js"],"names":["ERROR_DEFAULT","LIMIT","DRIVER_LICENSE_PATH","OSS_LINK","MAX_UPLOAD_NUMBER","URL_REGEXP","REGEXP","AVATAR","IMAGE_SPLIT","IMAGE_PROCESS","IMAGE_PROCESS_SMALL","IMAGE_PROCESS_LARGE","COMMENT_TYPE","COMMENT","REPLY","LANGUAGE_LINK","process","env","NODE_ENV"],"mappings":";;;;;AAAO,IAAMA,wCAAgB,MAAtB;;AAEA,IAAMC,wBAAQ,EAAd,C,CAAkB;;AAElB,IAAMC,oDAAsB,UAA5B;;AAEA,IAAMC,8BAAW,6CAAjB;;AAEA,IAAMC,gDAAoB,CAA1B;;AAEA,IAAMC,kCAAa,oGAAnB;;AAEA,IAAMC,0BAAS,eAAf;;AAEA,IAAMC,0BAAS,EAAf;;AAEA,IAAMC,oCAAc,aAApB;;AAEA,IAAMC,wCAAgB,mCAAtB;AACA,IAAMC,oDAAsB,mCAA5B;AACA,IAAMC,oDAAsB,mCAA5B;;AAEA,IAAMC,sCAAe;AAC1BC,WAAS,SADiB;AAE1BC,SAAO;AAFmB,CAArB;;AAKP;AACO,IAAMC,wCACXC,QAAQC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,GACI,sBADJ,GAEI,uBAHC","file":"constant.js","sourcesContent":["export const ERROR_DEFAULT = \"出错了!\";\n\nexport const LIMIT = 10; // 默认 limit\n\nexport const DRIVER_LICENSE_PATH = \"/comment\";\n\nexport const OSS_LINK = \"//links-comment.oss-cn-beijing.aliyuncs.com\";\n\nexport const MAX_UPLOAD_NUMBER = 4;\n\nexport const URL_REGEXP = /((http(s)?:)?\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g;\n\nexport const REGEXP = /\\[[^[\\]]+?\\]/g;\n\nexport const AVATAR = \"\";\n\nexport const IMAGE_SPLIT = \"IMAGE_SPLIT\";\n\nexport const IMAGE_PROCESS = \"?x-oss-process=image/resize,h_350\";\nexport const IMAGE_PROCESS_SMALL = \"?x-oss-process=image/resize,h_100\";\nexport const IMAGE_PROCESS_LARGE = \"?x-oss-process=image/resize,h_500\";\n\nexport const COMMENT_TYPE = {\n  COMMENT: \"comment\",\n  REPLY: \"reply\"\n};\n\n// 线上静态库地址\nexport const LANGUAGE_LINK =\n  process.env.NODE_ENV === \"production\"\n    ? \"//a.links123.cn/lang\"\n    : \"//a.links123.net/lang\";\n"]}

+ 4
- 4
lib/version.json ファイルの表示

@@ -1,8 +1,8 @@
1 1
 {
2 2
     "name":       "comment",
3
-    "buildDate":  1588435719936,
3
+    "buildDate":  1594135597777,
4 4
     "version":    "1.0.4",
5
-    "numCommits": 215,
6
-    "hash":       "7d03c9b",
7
-    "dirty":      true
5
+    "numCommits": 217,
6
+    "hash":       "e6f4c20",
7
+    "dirty":      false
8 8
 }