解决系统新建用户时,浏览器自动填充账号密码的问题

701 阅读1分钟

做项目的过程中,发现系统新建用户时,浏览器会自动填充账号和密码,解决问题如下:

1. 在不需要填充的组件中加入autocomplete = “new-password”


但是这个只适用于谷歌浏览器,于是,又找到了另外一种办法.


2. 在用户输入框前增加下面的输入框,用样式设置成隐藏效果,用于保存填充的用户名、密码;

<input type="text" name="hide_name" value="随便" style="position: absolute;z-index: -1;" disabled autocomplete = "off"/><input type="password" name="hide_pwd" value=" " style="position: absolute;z-index: -1;" disabled autocomplete = "off"/>