-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
860 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { defineFakeRoute } from "vite-plugin-fake-server/client"; | ||
import { faker } from "@faker-js/faker/locale/zh_CN"; | ||
|
||
export default defineFakeRoute([ | ||
// 账户设置-个人信息 | ||
{ | ||
url: "/mine", | ||
method: "get", | ||
response: () => { | ||
return { | ||
success: true, | ||
data: { | ||
avatar: "https://avatars.githubusercontent.com/u/44761321", | ||
username: "admin", | ||
nickname: "小铭", | ||
email: "[email protected]", | ||
phone: "15888886789", | ||
description: "一个热爱开源的前端工程师" | ||
} | ||
}; | ||
} | ||
}, | ||
// 账户设置-个人安全日志 | ||
{ | ||
url: "/mine-logs", | ||
method: "get", | ||
response: () => { | ||
let list = [ | ||
{ | ||
id: 1, | ||
ip: faker.internet.ipv4(), | ||
address: "中国河南省信阳市", | ||
system: "macOS", | ||
browser: "Chrome", | ||
summary: "账户登录", // 详情 | ||
operatingTime: new Date() // 时间 | ||
}, | ||
{ | ||
id: 2, | ||
ip: faker.internet.ipv4(), | ||
address: "中国广东省深圳市", | ||
system: "Windows", | ||
browser: "Firefox", | ||
summary: "绑定了手机号码", | ||
operatingTime: new Date().setDate(new Date().getDate() - 1) | ||
} | ||
]; | ||
return { | ||
success: true, | ||
data: { | ||
list, | ||
total: list.length, // 总条目数 | ||
pageSize: 10, // 每页显示条目个数 | ||
currentPage: 1 // 当前页数 | ||
} | ||
}; | ||
} | ||
} | ||
]); |
Oops, something went wrong.