Skip to content

Commit

Permalink
feat: 添加账户设置功能页面且兼容移动端 (#1022)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgexie authored Apr 12, 2024
1 parent 296db37 commit 332678b
Show file tree
Hide file tree
Showing 25 changed files with 860 additions and 22 deletions.
3 changes: 2 additions & 1 deletion locales/en.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
buttons:
pureAccountSettings: Account Settings
pureLoginOut: LoginOut
pureLogin: Login
pureSystemSet: Open ProjectConfig
Expand Down Expand Up @@ -175,4 +176,4 @@ login:
purePassWordRuleReg: The password format should be any combination of 8-18 digits
purePassWordSureReg: Please enter confirm password
purePassWordDifferentReg: The two passwords do not match!
purePassWordUpdateReg: Password has been updated
purePassWordUpdateReg: Password has been updated
3 changes: 2 additions & 1 deletion locales/zh-CN.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
buttons:
pureAccountSettings: 账户设置
pureLoginOut: 退出系统
pureLogin: 登录
pureSystemSet: 打开项目配置
Expand Down Expand Up @@ -175,4 +176,4 @@ login:
purePassWordRuleReg: 密码格式应为8-18位数字、字母、符号的任意两种组合
purePassWordSureReg: 请输入确认密码
purePassWordDifferentReg: 两次密码不一致!
purePassWordUpdateReg: 修改密码成功
purePassWordUpdateReg: 修改密码成功
5 changes: 4 additions & 1 deletion mock/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export default defineFakeRoute([
return {
success: true,
data: {
avatar: "https://avatars.githubusercontent.com/u/44761321",
username: "admin",
nickname: "小铭",
// 一个用户可能有多个角色
roles: ["admin"],
accessToken: "eyJhbGciOiJIUzUxMiJ9.admin",
Expand All @@ -22,8 +24,9 @@ export default defineFakeRoute([
return {
success: true,
data: {
avatar: "https://avatars.githubusercontent.com/u/52823142",
username: "common",
// 一个用户可能有多个角色
nickname: "小林",
roles: ["common"],
accessToken: "eyJhbGciOiJIUzUxMiJ9.common",
refreshToken: "eyJhbGciOiJIUzUxMiJ9.commonRefresh",
Expand Down
59 changes: 59 additions & 0 deletions mock/mine.ts
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 // 当前页数
}
};
}
}
]);
Loading

0 comments on commit 332678b

Please sign in to comment.