Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我希望通过upload上传组件实现本地加密 #1831

Closed
4 tasks done
starWillRed opened this issue Apr 24, 2024 · 5 comments · Fixed by #1919
Closed
4 tasks done

我希望通过upload上传组件实现本地加密 #1831

starWillRed opened this issue Apr 24, 2024 · 5 comments · Fixed by #1919
Labels
enhancement 改进或增强

Comments

@starWillRed
Copy link

议题条件

  • 我确认已查看官方使用文档:https://layui.dev ,但没有找到相关解决方案。
  • 我确认已在 Issues 中搜索过类似的问题,但没有找到相关解决方案。
  • 我已仔细阅读: 🍀 Layui Issue 贡献指南

议题类型

功能请求

使用版本

v2.9.8

问题描述

我调用了upload组件,并在before函数中通过obj参数获取了文件,随后我使用对称加密方式加密了文件,但没有找到方法给obj重新赋值加密后的文件,以便上传加密后的文件。

业务代码

截图补充

IMG_20240424_224311

浏览器

109

演示地址

No response

友好承诺

  • 我承诺将本着相互尊重、理解和友善的态度进行交流,共同维护 Layui 良好的社区氛围。
@Sight-wcg Sight-wcg added the enhancement 改进或增强 label Apr 24, 2024
@LSL1618
Copy link
Collaborator

LSL1618 commented Apr 26, 2024

在上传前改上传参数确实是比较常用的情况。

@Sight-wcg
Copy link
Collaborator

obj.resetFile 能否解决?

@starWillRed
Copy link
Author

obj.resetFile 能否解决?

我使用了resetFile,在控制台打印obj.pushFile()的时候,文件是resetFile之后的内容,但是在下一行代码中使用obj.preview()预览时,发现文件依然是resetFile之前的内容,上传的文件也依然是resetFile之前的内容。请问这是否意味着resetFile存在某些bug?

@Sight-wcg
Copy link
Collaborator

obj.resetFile 能否解决?

我使用了resetFile,在控制台打印obj.pushFile()的时候,文件是resetFile之后的内容,但是在下一行代码中使用obj.preview()预览时,发现文件依然是resetFile之前的内容,上传的文件也依然是resetFile之前的内容。请问这是否意味着resetFile存在某些bug?

没有重现,就没有办法确认

@starWillRed
Copy link
Author

obj.resetFile 能否解决?

我使用settimeout方法进一步测试了upload里面的choose、before、progress、done回调函数,发现是因为开启upload的自动上传后,会立即上传文件,而此时choose、before回调函数中的resetFile尚未执行完毕,obj内容自然也就尚未更改。希望在以后的版本更新中能修复这个问题,谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 改进或增强
Projects
None yet
3 participants