sys.ts 257 B

123456789101112
  1. import { UPLOAD_FILE } from './constant'
  2. import { axios } from './instance'
  3. type UploadFile = LocalFile | string
  4. export const uploadFile = async (file: UploadFile) => {
  5. if (typeof file === 'string') {
  6. return file
  7. } else {
  8. return file.url
  9. }
  10. }