文件夹
配置在 config/default.js ,当然可以在具体文件配置,但是这儿方便一点
在线 demo:https://auth.bilibilianime.com/
仓库: https://github.com...({
url: `${url}/api/${route}`,
method: "POST",
contentType: "application/json",
data:...app.post("/api/register",[nameValid,pwdValid,captcha],async (req, res) => {
console.log(req.body)...我没有做 token 定期失效.
token 加密需要用到 SECRET, 最好是做成环境变量, 此处我定义成全局变量
app.post("/api/login",[nameValid,pwdValid...next():res.status(422).send("验证码不正确")
};
需要处理一下跨域问题, 因为生成验证码和验证验证码的 api 不同, 这样
session 可以共享
app.all("