Skip to content

Commit ee39d9e

Browse files
committed
refactor: 精简代码
1 parent ddbea49 commit ee39d9e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/BootstrapBlazor/wwwroot/modules/upload.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Data from "./data.js"
22
import EventHandler from "./event-handler.js"
3-
import { readFileAsync } from "./utility.js"
43

54
export function init(id) {
65
const el = document.getElementById(id)
@@ -98,10 +97,7 @@ export async function getPreviewUrl(id, fileName) {
9897
if (files) {
9998
const file = [...files].find(v => v.name === fileName);
10099
if (file) {
101-
const data = await readFileAsync(file);
102-
if (data) {
103-
url = URL.createObjectURL(data);
104-
}
100+
url = URL.createObjectURL(file);
105101
}
106102
}
107103
return url;

0 commit comments

Comments
 (0)