Socket
Book a DemoInstallSign in
Socket

@x-edu/attachments

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@x-edu/attachments

| 参数 | 参数类型 | 是否必填 | 参数说明 | 默认值 | | ---------- | -------- | -------- | ------------------------------------------------------------ |----| | attachmentPreviewEnable | number | 是 | 是否开启预览|1| | sdpAppId | string | 是 | sdpAppId|| |

latest
npmnpm
Version
0.1.25
Version published
Maintainers
0
Created
Source

x-edu/attachments

参数: {Object} options

参数参数类型是否必填参数说明默认值
attachmentPreviewEnablenumber是否开启预览1
sdpAppIdstringsdpAppId
envstring环境preproduction
ucucuc
userInfoobject用户信息{}
getCSToken() => { }geToken''
attachmentUploadPathstring文件上传路径''
containerClassNamestring容器classNanme
editableboolean是否开启上传false
descriptionstring描述添加图片、视频、音频、文件等附件
extraPropsobject上传按钮前面的扩展
fileSizeLimitnumber大小限制10 * 1024 * 1024
attachmentMaxCountnumber上传数量限制8
btnNamestring上传按钮名称添加附件
fileDatas[]文件预览列表[]
filePreview() => { }自定义文件预览
fileDownload() => { }自定义文件下载
uploadFileTypearray文件上传类型[]
videoUrlobjectfishUI的video组件地址配置null

VerifyCodePhone 文件上传

const uc = new UC({
  ...
})
export default function Demo() {
  const [userInfo, setUserInfo] = useState(null)
 const getCSToken = () => {}
  useEffect(() => {
    async function init() {
      try {
        await uc.login({
          ...
        })
        const info = await uc.getInfo() // 伪代码
        setUserInfo(info)
      } catch (error) {
        console.log(error)
      }
    }
    init()
  }, [])

  if (!userInfo) {
    return null
  }

  return (
       <Attachments
          fileDatas={data}
          editable={false}
          uc={uc}
          getCSToken={getCSToken}
          userInfo={userInfo}
          imgOnlyPreview={true}
          attachmentUploadPath="/xxxx/xxx"
          env="preproduction"
          attachmentPreviewEnable="1"
        />
  )
}

FAQs

Package last updated on 06 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.