longyvfengyun
2023-12-25 d8d792a6842832e8f6af6604274c438b25053afe
1
2
3
4
5
6
7
8
9
10
function getFileName(path) {
  let pos1 = path.lastIndexOf('/');
  let pos2 = path.lastIndexOf('\\');
  let pos  = Math.max(pos1, pos2)
  if( pos<0 )
    return path;
  else
    return path.substring(pos+1);
}
export default getFileName;