f_000013 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. import __vite__cjsImport0_lodash from "/node_modules/.vite/deps/lodash.js?v=0e19d92d"; const set = __vite__cjsImport0_lodash["set"];
  2. import loading from "/src/components/Provider/Loading.tsx";
  3. import { message } from "/node_modules/.vite/deps/ant-design-vue.js?v=f7d2fa05";
  4. import __vite__cjsImport3_aliOss from "/node_modules/.vite/deps/ali-oss.js?v=a26e0da8"; const OSS = __vite__cjsImport3_aliOss.__esModule ? __vite__cjsImport3_aliOss.default : __vite__cjsImport3_aliOss;
  5. export class UploadController {
  6. request;
  7. blobURLMaps = /* @__PURE__ */ new Map();
  8. constructor(request) {
  9. this.request = request;
  10. }
  11. getBlobURLName(url) {
  12. return this.blobURLMaps.get(url)?.name;
  13. }
  14. createObjectURL(obj) {
  15. const url = URL.createObjectURL(obj);
  16. this.blobURLMaps.set(url, obj);
  17. return url;
  18. }
  19. revokeObjectURL(url) {
  20. URL.revokeObjectURL(url);
  21. this.blobURLMaps.delete(url);
  22. }
  23. selectFile(opts) {
  24. return new Promise((resolve, reject) => {
  25. const fileInput = document.createElement("input");
  26. fileInput.type = "file";
  27. fileInput.accept = opts?.accept || "images/*";
  28. fileInput.multiple = opts?.multiple || false;
  29. fileInput.onchange = function() {
  30. resolve([...this.files]);
  31. };
  32. window.addEventListener(
  33. "focus",
  34. () => {
  35. setTimeout(() => {
  36. reject(console.warn("select file cancel"));
  37. }, 300);
  38. },
  39. { once: true }
  40. );
  41. fileInput.click();
  42. });
  43. }
  44. async uploadBlobImages(data) {
  45. const todoMap = /* @__PURE__ */ new Map();
  46. addBlobToList(data);
  47. const todoList = todoMap.entries();
  48. let err = "";
  49. for (const item of todoList) {
  50. const [blobUrl, path] = item;
  51. const file = this.blobURLMaps.get(blobUrl);
  52. if (file) {
  53. const paths = path.split(",");
  54. loading.show("上传中");
  55. const ret = await this.uploadFiles(file);
  56. if (ret.url) {
  57. paths.forEach((p) => {
  58. set(data, p, ret.url);
  59. });
  60. this.revokeObjectURL(blobUrl);
  61. } else {
  62. err = ret.error || `上传文件失败[${path}]`;
  63. break;
  64. }
  65. } else {
  66. err = `上传文件为空[${path}]`;
  67. }
  68. }
  69. loading.hidden();
  70. if (err) {
  71. message.error(err);
  72. throw err;
  73. }
  74. function addBlobToList(data2, path = "") {
  75. if (data2 instanceof Object) {
  76. if (data2 instanceof Array) {
  77. data2.forEach((item, i) => {
  78. addBlobToList(item, path ? path + "." + i : i.toString());
  79. });
  80. } else {
  81. Object.entries(data2).forEach(([key, value]) => {
  82. addBlobToList(value, path ? path + "." + key : key);
  83. });
  84. }
  85. }
  86. if (typeof data2 === "string" && /^blob:/.test(data2)) {
  87. if (todoMap.has(data2)) {
  88. path = todoMap.get(data2) + "," + path;
  89. }
  90. todoMap.set(data2, path);
  91. }
  92. }
  93. }
  94. async getPolicy() {
  95. try {
  96. const res = await this.request("/upload/policy", {
  97. method: "GET"
  98. });
  99. console.log(res);
  100. if (res.errorNo != 200) {
  101. return { error: "获取上传签名失败!" };
  102. }
  103. const policy = res.result.body.Credentials;
  104. return policy;
  105. } catch (e) {
  106. return { error: "获取上传签名失败!" };
  107. }
  108. }
  109. async uploadFiles(file, path = "/images/") {
  110. const res = await this.getPolicy();
  111. if (res.error) {
  112. return res.error;
  113. }
  114. const ext = file.name.split(".");
  115. if (ext.length === 1)
  116. return { error: "上传失败!" };
  117. const fileExt = ext[ext.length - 1].toLowerCase();
  118. const fileName = this.randomName(12) + "." + fileExt;
  119. const client = new OSS({
  120. region: "oss-cn-chengdu",
  121. accessKeyId: res.AccessKeyId,
  122. accessKeySecret: res.AccessKeySecret,
  123. // 从STS服务获取的安全令牌(SecurityToken)。
  124. stsToken: res.SecurityToken,
  125. bucket: "baishuihu"
  126. });
  127. try {
  128. const options = {
  129. timeout: 6e5
  130. };
  131. const result = await client.put(path + fileName, file, options);
  132. return { url: result.url };
  133. } catch (e) {
  134. console.log(e);
  135. return { error: "上传失败!" };
  136. }
  137. }
  138. // async uploadFile(file: File): Promise<{ url?: string; error?: string }> {
  139. // const fromData = new FormData();
  140. // fromData.append("file", file);
  141. // try {
  142. // const ret = await this.request("/upload/file", {
  143. // method: "POST",
  144. // data: fromData,
  145. // headers: {
  146. // "Content-Type": "multipart/form-data",
  147. // },
  148. // });
  149. // if (ret.errorNo != 200) {
  150. // return { error: "上传失败!" };
  151. // }
  152. // const url = ret.result.url;
  153. // return { url };
  154. // } catch (e) {
  155. // return { error: "上传失败!" };
  156. // }
  157. // }
  158. getFileExt(file) {
  159. let ext = "unkown";
  160. if (file) {
  161. const exp = /^.+\.(.+)$/;
  162. if (file.name && exp.test(file.name)) {
  163. ext = exp.exec(file.name)[1];
  164. } else if (file.type) {
  165. ext = file.type.split("/").pop();
  166. }
  167. return ext.toLowerCase();
  168. } else {
  169. return ext;
  170. }
  171. }
  172. randomName(length) {
  173. const data = [
  174. "0",
  175. "1",
  176. "2",
  177. "3",
  178. "4",
  179. "5",
  180. "6",
  181. "7",
  182. "8",
  183. "9",
  184. "A",
  185. "B",
  186. "C",
  187. "D",
  188. "E",
  189. "F",
  190. "G",
  191. "H",
  192. "I",
  193. "J",
  194. "K",
  195. "L",
  196. "M",
  197. "N",
  198. "O",
  199. "P",
  200. "Q",
  201. "R",
  202. "S",
  203. "T",
  204. "U",
  205. "V",
  206. "W",
  207. "X",
  208. "Y",
  209. "Z",
  210. "a",
  211. "b",
  212. "c",
  213. "d",
  214. "e",
  215. "f",
  216. "g",
  217. "h",
  218. "i",
  219. "j",
  220. "k",
  221. "l",
  222. "m",
  223. "n",
  224. "o",
  225. "p",
  226. "q",
  227. "r",
  228. "s",
  229. "t",
  230. "u",
  231. "v",
  232. "w",
  233. "x",
  234. "y",
  235. "z"
  236. ];
  237. let nums = "";
  238. for (let i = 0; i < length; i++) {
  239. const r = parseInt(Math.random() * 61 + "");
  240. nums += data[r];
  241. }
  242. return nums;
  243. }
  244. }
  245. //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlVwbG9hZENvbnRyb2xsZXIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc2V0IH0gZnJvbSBcImxvZGFzaFwiO1xyXG5pbXBvcnQgbG9hZGluZyBmcm9tIFwiQC9jb21wb25lbnRzL1Byb3ZpZGVyL0xvYWRpbmdcIjtcclxuaW1wb3J0IHsgbWVzc2FnZSB9IGZyb20gXCJhbnQtZGVzaWduLXZ1ZVwiO1xyXG5pbXBvcnQgT1NTIGZyb20gXCJhbGktb3NzXCI7XHJcblxyXG5leHBvcnQgY2xhc3MgVXBsb2FkQ29udHJvbGxlciB7XHJcbiAgcmVxdWVzdDogYW55O1xyXG4gIGJsb2JVUkxNYXBzID0gbmV3IE1hcDxzdHJpbmcsIGFueT4oKTtcclxuICBjb25zdHJ1Y3RvcihyZXF1ZXN0OiBhbnkpIHtcclxuICAgIHRoaXMucmVxdWVzdCA9IHJlcXVlc3Q7XHJcbiAgfVxyXG4gIGdldEJsb2JVUkxOYW1lKHVybDogc3RyaW5nKSB7XHJcbiAgICByZXR1cm4gdGhpcy5ibG9iVVJMTWFwcy5nZXQodXJsKT8ubmFtZTtcclxuICB9XHJcbiAgY3JlYXRlT2JqZWN0VVJMKG9iajogQmxvYik6IHN0cmluZyB7XHJcbiAgICBjb25zdCB1cmwgPSBVUkwuY3JlYXRlT2JqZWN0VVJMKG9iaik7XHJcbiAgICB0aGlzLmJsb2JVUkxNYXBzLnNldCh1cmwsIG9iaik7XHJcbiAgICByZXR1cm4gdXJsO1xyXG4gIH1cclxuICByZXZva2VPYmplY3RVUkwodXJsOiBzdHJpbmcpIHt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cbiAgICBsb2FkaW5nLmhpZGRlbigpO1xyXG4gICAgaWYgKGVycikge1xyXG4gICAgICBtZXNzYWdlLmVycm9yKGVycik7XHJcbiAgICAgIHRocm93IGVycjtcclxuICAgIH1cclxuICAgIGZ1bmN0aW9uIGFkZEJsb2JUb0xpc3QoZGF0YTogYW55LCBwYXRoID0gXCJcIikge1xyXG4gICAgICBpZiAoZGF0YSBpbnN0YW5jZW9mIE9iamVjdCkge1xyXG4gICAgICAgIGlmIChkYXRhIGluc3RhbmNlb2YgQXJyYXkpIHtcclxuICAgICAgICAgIGRhdGEuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xyXG4gICAgICAgICAgICBhZGRCbG9iVG9MaXN0KGl0ZW0sIHBhdGggPyBwYXRoICsgXCIuXCIgKyBpIDogaS50b1N0cmluZygpKTtcclxuICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICBPYmplY3QuZW50cmllcyhkYXRhKS5mb3JFYWNoKChba2V5LCB2YWx1ZV0pID0+IHtcclxuICAgICAgICAgICAgYWRkQmxvYlRvTGlzdCh2YWx1ZSwgcGF0aCA/IHBhdGggKyBcIi5cIiArIGtleSA6IGtleSk7XHJcbiAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgICAgaWYgKHR5cGVvZiBkYXRhID09PSBcInN0cmluZ1wiICYmIC9eYmxvYjovLnRlc3QoZGF0YSkpIHtcclxuICAgICAgICBpZiAodG9kb01hcC5oYXMoZGF0YSkpIHtcclxuICAgICAgICAgIHBhdGggPSB0b2RvTWFwLmdldChkYXRhKSArIFwiLFwiICsgcGF0aDtcclxuICAgICAgICB9XHJcbiAgICAgICAgdG9kb01hcC5zZXQoZGF0YSwgcGF0aCk7XHJcbiAgICAgIH1cclxuICAgIH1cclxuICB9XHJcbiAgYXN5bmMgZ2V0UG9saWN5KCkge1xyXG4gICAgdHJ5IHtcclxuICAgICAgY29uc3QgcmVzID0gYX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lIHtcclxuICAgICAgcmV0dXJuIGV4dDtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIHJhbmRvbU5hbWUobGVuZ3RoOiBudW1iZXIpIHtcclxuICAgIGNvbnN0IGRhdGEgPSBbXHJcbiAgICAgIFwiMFwiLFxyXG4gICAgICBcIjFcIixcclxuICAgICAgXCIyXCIsXHJcbiAgICAgIFwiM1wiLFxyXG4gICAgICBcIjRcIixcclxuICAgICAgXCI1XCIsXHJcbiAgICAgIFwiNlwiLFxyXG4gICAgICBcIjdcIixcclxuICAgICAgXCI4XCIsXHJcbiAgICAgIFwiOVwiLFxyXG4gICAgICBcIkFcIixcclxuICAgICAgXCJCXCIsXHJcbiAgICAgIFwiQ1wiLFxyXG4gICAgICBcIkRcIixcclxuICAgICAgXCJFXCIsXHJcbiAgICAgIFwiRlwiLFxyXG4gICAgICBcIkdcIixcclxuICAgICAgXCJIXCIsXHJcbiAgICAgIFwiSVwiLFxyXG4gICAgICBcIkpcIixcclxuICAgICAgXCJLXCIsXHJcbiAgICAgIFwiTFwiLFxyXG4gICAgICBcIk1cIixcclxuICAgICAgXCJOXCIsXHJcbiAgICAgIFwiT1wiLFxyXG4gICAgICBcIlBcIixcclxuICAgICAgXCJRXCIsXHJcbiAgICAgIFwiUlwiLFxyXG4gICAgICBcIlNcIixcclxuICAgICAgXCJUXCIsXHJcbiAgICAgIFwiVVwiLFxyXG4gICAgICBcIlZcIixcclxuICAgICAgXCJXXCIsXHJcbiAgICAgIFwiWFwiLFxyXG4gICAgICBcIllcIixcclxuICAgICAgXCJaXCIsXHJcbiAgICAgIFwiYVwiLFxyXG4gICAgICBcImJcIixcclxuICAgICAgXCJjXCIsXHJcbiAgICAgIFwiZFwiLFxyXG4gICAgICBcImVcIixcclxuICAgICAgXCJmXCIsXHJcbiAgICAgIFwiZ1wiLFxyXG4gICAgICBcImhcIixcclxuICAgICAgXCJpXCIsXHJcbiAgICAgIFwialwiLFxyXG4gICAgICBcImtcIixcclxuICAgICAgXCJ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