import { getToken, getTenantCode } from '@/utils/auth'

/** el-upload 与 axios 保持一致的上传请求头 */
export function getUploadHeaders() {
  const headers = { 'X-Frontend-Type': 'admin' }
  const tenantCode = getTenantCode()
  if (tenantCode) {
    headers['tenant-code'] = tenantCode
  }
  const token = getToken()
  if (token) {
    headers['Authorization'] = 'Bearer ' + token
  }
  return headers
}
