log-uploader
Upload iscreen projects log click a button
Install
yarn add iscreen-log-uploader
Usage
import { createUploader } from 'iscreen-log-uploader'
const options = {
logPath: '/Users/savokiss/Documents/audios',
ossUrl: 'http://api-server.mofaxiao.com/aliyun/oss/sts_token',
ossType: 'interaction-audio'
}
const uploader = createUploader(options)
uploader.init()
const record = {
name: 'log.log',
date: '2019-09-17',
liveLessonId: 1111,
teachLessonId: 2222
}
uploader.on('debug', (...args) => {
console.log(...args)
})
uploader.on('upload-success', url => {
console.log('url', url)
})
// init 成功后才能调用 upload 方法
setTimeout(() => {
uploader.upload(record)
}, 5000)