import { getApp } from '/@/hooks/userApp';

export const changeUrl = (name: string) => {
  if (name.indexOf('http') != -1) {
    return name;
  } else {
    if (
      (typeof name === 'string' && name.substring(0, 4) == 'blob') ||
      (typeof name === 'string' && name.substring(0, 10) == 'data:image')
    ) {
      return name;
    } else {
      return getApp().resource.getUserResourceURL(name);
    }
  }
};
