mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-26 18:28:57 +00:00
@@ -98,7 +98,7 @@
|
||||
开发:
|
||||
|
||||
```bash
|
||||
npm run dev # 使用mock拦截请求,数据存储在localStroge里
|
||||
npm run dev # 使用mock拦截请求,数据存储在localStorage里
|
||||
|
||||
打开 http://localhost:8000
|
||||
```
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ module.exports = {
|
||||
const { username, password } = req.body
|
||||
const user = adminUsers.filter((item) => item.username === username)
|
||||
|
||||
if (user && user[0].password === password) {
|
||||
if (user.length > 0 && user[0].password === password) {
|
||||
const now = new Date()
|
||||
now.setDate(now.getDate() + 1)
|
||||
res.cookie('token', JSON.stringify({ id: user[0].id, deadline: now.getTime() }), {
|
||||
|
||||
Reference in New Issue
Block a user