function makeForm() {
// 创建一个 form
const tempForm = document.createElement("form");
tempForm.id = "tempForm";
tempForm.name = "tempForm";
// 添加到 body 中
document.body.appendChild(tempForm);
// 创建一个用户名输入
const nameinput = document.createElement("input");
// 设置相应参数
nameinput.type = "text";
nameinput.name = "userName";
nameinput.value = "testName";
// 创建一个密码输入
const passinput = document.createElement("input");
// 设置相应参数
passinput.type = "password";
passinput.name = "password";
passinput.value ="testPassword";
// 将该输入框插入到 form 中
tempForm.appendChild(nameinput);
tempForm.appendChild(passinput);
// form 的提交方式
tempForm.method = "POST";
// form 提交路径
tempForm.action = "/user/login";
// 对该 form 执行提交
tempForm.submit();
// 删除该 form
document.body.removeChild(tempForm);
}