The injection and leakage of charge carriers have a significant impact on the optoelectronic performance of GaN-based lasers. In order to improve the limitation of the laser on charge carriers, a slope-shape hole-barrier layer (HBL) and electron-barrier layer (EBL) structure are proposed for near-UV (NUV) GaN-based lasers. We used Crosslight LASTIP for the simulation and theoretical analysis of the energy bands of HBL and EBL. Our simulations suggest that the energy bands of slope-shape HBL and EBL structures are modulated, which could effectively suppress carrier leakage, improve carrier injection efficiency, increase stimulated radiation recombination rate in quantum wells, reduce the threshold current, improve optical field distribution, and, ultimately, improve laser output power. Therefore, using slope-shape HBL and EBL structures can achieve the superior electrical and optical performance of lasers.