Home > Article > Backend Development > Interface writing problem
For example, the login interface has three parameters: username, password, and signature. If the username is empty, it will return "The username cannot be empty." If the password is empty, it will return "Please fill in the password." Or should we say that there is one of these three parameters? Empty, the parameters returned directly are incomplete!
For example, the login interface has three parameters: username, password, and signature. If the username is empty, it will return "The username cannot be empty." If the password is empty, it will return "Please fill in the password." Or should we say that there is one of these three parameters? Empty, the parameters returned directly are incomplete!
There is no absolutely correct answer to this, but you can learn from my approach!
I usually can give as complete a prompt as possible, so from an experience perspective there is basically no learning cost for users
But there is a security issue here that deserves our attention. If you provide detailed prompts such as username cannot be found, password is wrong, etc., it will provide convenience for people who brute force password crackers, so I usually give prompts in places where there are security issues. The blur leaves no hidden dangers, such as incorrect username or password, and generally does not cause too much interference to normal users
Non-standard answer, for reference only!