With the rapid development of artificial intelligence technology, the physics-informed neural network (PINN) has gradually emerged as an effective and potential method for solving N-S equations. The treatment of constraints is vital to the PINN prediction accuracy. Compared to soft constraints, hard constraints are advantageous for the avoidance of difficulties in guaranteeing definite conditions and determining penalty coefficients. However, the principles on the formulation of hard constraints of PINN currently remain to be formed, which hinders the application of PINN in engineering fields. In this study, hard-constraint-based PINN models are constructed for Couette flow, plate shear flow and stenotic/aneurysmal flow with curved geometries. Particular efforts have been devoted to assessing the impact of the model parameters of hard constraints, i.e., degree and scaling factor, on the prediction accuracy of PINN at different Reynolds numbers. The results show that the degree is the most important factor that influences the prediction accuracy, followed by the scaling factor. As for the N-S equations, the degree of hard constraints should be at least two, while the scaling factor is recommended to be maintained around 1.0. The outcomes of the present work are of reference value for the development of PINN methods in fluid mechanics.