npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@efox/upload-file

v0.2.11

Published

支持所有类型的文件上传到腾讯云,上传完成上报文件MD5、类型、URL、项目名称、用户uid

Downloads

17

Readme

efox上传文件插件

支持所有类型的文件上传到腾讯云,上传完成上报文件MD5、类型、URL、项目名称、用户uid

安装

yarn add @efox/upload-file

全局注册

import efoxUploadFile from '@efox/upload-file'

Vue.use(efoxUploadFile, {
  env: '',
  uid: '',
  projectName: '',
  serverOrigin: '',
  defaultName: false,
  copy: true
})

参数 | type | 默认值 | 说明 ----- | ---- | ---- | --- evn | String | production | 环境 'production', 'development' uid | String | '' | 用户uid projectName | String | '' | 项目名称,会拼接到文件path上面,上传会验证 uid 是否有 projectName 权限,没有权限上传会失败 serverOrigin | String | https://static.moschat.com | 显示上传完成文件地址 origin defaultName | Boolean | false | 上传时文件名输入框默认使用的名称,false 使用 uuid 生成文件名,true 使用源文件名 copy | Boolean | false | 上传完成是否显示复制链接按钮

局部注册

import { EfoxUploadFile } from '@efox/upload-file'

export default {
  components: {
    EfoxUploadFile
  }
}

设置默认值

import { setConfig } from '@efox/upload-file'
setConfig({
  env: '',
  uid: '',
  projectName: '',
  serverOrigin: '',
  defaultName: true,
  copy: false
})

使用组件

<efox-upload-file
  projectName="moschat"
  uid="1001"
  serverOrigin="https://www.moschat.com"
  :defaultName="true"
  :copy="true"
  @success=onSuccess
></efox-upload-file>

文件上传完成回调 $emit('success'),参数结构如下

const payload = {
  cloudData: {
    ETag: "\"7259c10192786138b99fddc6a5c964f7\"",
    Location: "dianhu-1253537286.cos.eu-moscow.myqcloud.com/efoxfile/moschat/dota2skin_2.mp4",
    headers: {
      etag: "\"7259c10192786138b99fddc6a5c964f7\""
    },
    statusCode: 200
  },
  fileName: "/efoxfile/moschat/dota2skin_2.mp4"
  md5: "7259c10192786138b99fddc6a5c964f7"
  size: 1444852
  originUrl: "https://dianhu-1253537286.cos.eu-moscow.myqcloud.com/efoxfile/moschat/dota2skin_2.mp4" // 腾讯云源地址
  url: "https://static.moschat.com/efoxfile/moschat/dota2skin_2.mp4"
}