18 lines
		
	
	
		
			405 B
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			405 B
		
	
	
	
		
			Plaintext
		
	
	
| import { OSSclient } from '../oss'
 | |
| import { encoder } from './encoder'
 | |
| export const dcmUpload =  async function(name, file){
 | |
|   return new Promise(async resolve => {
 | |
|     try {
 | |
|       let blob = await encoder(file)
 | |
|       let res = await OSSclient.put(name, blob.blob)
 | |
|       resolve({
 | |
|         ...res,
 | |
|         image: blob.image
 | |
|       })
 | |
|     } catch (e) {
 | |
|       resolve(false)
 | |
|       console.log(e)
 | |
|     }
 | |
|   })
 | |
| }
 |