We investigate the transport properties of a NbSe2 nanodevice consisting of a thin region, a thick region and a step junction. The superconducting critical current density of each region of the nanodevice has been studied as a function of temperature and magnetic field. We find that the critical current density has similar values for both the thin and thick regions away from the junction, while the critical current density of the thin region of the junction increases to approximately 1.8 times as compared with the values obtained for the other regions. We attribute such an enhancement of critical current density to the vortex pinning at the surface step. Our study verifies the enhancement of the critical current density by the geometrical-type pinning and sheds light on the application of 2D superconductors.