Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit7021942

Browse files
committed
fix(uploader): add uid to filename && avoid unneed mount
1 parent18e3598 commit7021942

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

‎containers/DocUploader/logic.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ export const getOSSFileName = filename => {
4444
constuserName=store.accountInfo.nickname
4545
constuserId=store.accountInfo.id
4646
constid=store.viewingData.id||'new'
47+
constcurDate=newDate()
48+
constcurTime=curDate.getTime()
4749

48-
return`${community}-${thread}-${id}-${userName}-${userId}-${filename}`
50+
return`${community}-${thread}-${id}-${userName}-${userId}-${curTime}-${filename}`
4951
}
5052

5153
exportconstsendEvent=(state='start')=>{

‎containers/Preview/index.js‎

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,31 @@ class PreviewContainer extends React.Component {
4343

4444
return(
4545
<React.Fragment>
46-
<ModalPreviewvisible={modalVisible}>
47-
<Viewer
48-
type={type}
49-
root={root}
50-
attachment={attachmentData}
51-
attUser={attUserData}
52-
/>
53-
</ModalPreview>
46+
{modalVisible&&(
47+
<ModalPreviewvisible={modalVisible}>
48+
<Viewer
49+
type={type}
50+
root={root}
51+
attachment={attachmentData}
52+
attUser={attUserData}
53+
/>
54+
</ModalPreview>
55+
)}
5456

55-
<SliderPreview
56-
visible={slideVisible}
57-
type={type}
58-
imageUploading={imageUploading}
59-
>
60-
<Viewer
57+
{slideVisible&&(
58+
<SliderPreview
59+
visible={slideVisible}
6160
type={type}
62-
root={root}
63-
attachment={attachmentData}
64-
attUser={attUserData}
65-
/>
66-
</SliderPreview>
61+
imageUploading={imageUploading}
62+
>
63+
<Viewer
64+
type={type}
65+
root={root}
66+
attachment={attachmentData}
67+
attUser={attUserData}
68+
/>
69+
</SliderPreview>
70+
)}
6771
</React.Fragment>
6872
)
6973
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp