urlTransform.js 361 Bytes
Newer Older
1 2
import config from '@/config/config';

钟是志's avatar
钟是志 committed
3
// 去除url中的 两个//
4
export default function urlTransform(url) {
钟是志's avatar
钟是志 committed
5 6
  if (url && url.indexOf(config.gateWayPort) > -1) {
    let uArr = url.split(config.gateWayPort);
钟是志's avatar
钟是志 committed
7 8 9 10
    if(uArr && uArr.length > 1){
      uArr[1] = uArr[1].replaceAll('\/\/', '\/');
      url = config.gateWayPort + uArr[1];
    }
钟是志's avatar
钟是志 committed
11
  }
12 13
  return url;
}