style: 💄 mock接口根据 prettier 格式化

This commit is contained in:
ray
2025-01-13 18:28:03 +08:00
parent 01b8a6840c
commit 2cae42e8d9
6 changed files with 33 additions and 46 deletions

View File

@@ -3,8 +3,5 @@ import { createDefineMock } from "vite-plugin-mock-dev-server";
export const defineMock = createDefineMock((mock) => {
// 拼接url
mock.url = path.join(
import.meta.env.VITE_APP_BASE_API + "/api/v1/",
mock.url
);
mock.url = path.join(import.meta.env.VITE_APP_BASE_API + "/api/v1/", mock.url);
});

View File

@@ -127,8 +127,7 @@ export default defineMock([
},
{
id: 10,
title:
"v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
@@ -150,7 +149,7 @@ export default defineMock([
{
url: "notices",
method: ["POST"],
body({ body }) {
body() {
return {
code: "00000",
data: null,
@@ -220,8 +219,7 @@ export default defineMock([
list: [
{
id: 10,
title:
"v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
type: 1,
level: "L",
publisherName: "系统管理员",
@@ -403,8 +401,7 @@ const noticeMap: Record<string, any> = {
},
10: {
id: 10,
title:
"v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",

View File

@@ -214,14 +214,13 @@ export default defineMock([
{
url: "roles/:id/menuIds",
method: ["GET"],
body: ({ params }) => {
body: ({}) => {
return {
code: "00000",
data: [
1, 2, 31, 32, 33, 88, 3, 70, 71, 72, 4, 73, 75, 74, 5, 76, 77, 78, 6,
79, 81, 84, 85, 86, 87, 40, 41, 26, 30, 20, 21, 22, 23, 24, 89, 90,
91, 36, 37, 38, 39, 93, 94, 95, 97, 102, 89, 90, 91, 93, 94, 95, 97,
102, 103, 104,
1, 2, 31, 32, 33, 88, 3, 70, 71, 72, 4, 73, 75, 74, 5, 76, 77, 78, 6, 79, 81, 84, 85, 86,
87, 40, 41, 26, 30, 20, 21, 22, 23, 24, 89, 90, 91, 36, 37, 38, 39, 93, 94, 95, 97, 102,
89, 90, 91, 93, 94, 95, 97, 102, 103, 104,
],
msg: "一切ok",
};

View File

@@ -10,8 +10,7 @@ export default defineMock([
userId: 2,
username: "admin",
nickname: "系统管理员",
avatar:
"https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
roles: ["ADMIN"],
perms: [
"sys:notice:edit",
@@ -65,8 +64,7 @@ export default defineMock([
nickname: "系统管理员",
mobile: "17621210366",
gender: 1,
avatar:
"https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "",
status: 1,
deptId: 1,
@@ -78,8 +76,7 @@ export default defineMock([
nickname: "测试小用户",
mobile: "17621210366",
gender: 1,
avatar:
"https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "youlaitech@163.com",
status: 1,
deptId: 3,
@@ -161,10 +158,8 @@ export default defineMock([
url: "users/_export",
method: ["GET"],
headers: {
"Content-Disposition":
"attachment; filename=%E7%94%A8%E6%88%B7%E5%88%97%E8%A1%A8.xlsx",
"Content-Type":
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"Content-Disposition": "attachment; filename=%E7%94%A8%E6%88%B7%E5%88%97%E8%A1%A8.xlsx",
"Content-Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
},
},
@@ -177,8 +172,7 @@ export default defineMock([
id: 2,
username: "admin",
nickname: "系统管理员",
avatar:
"https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
gender: 1,
mobile: "17621210366",
email: null,
@@ -192,7 +186,7 @@ export default defineMock([
{
url: "users/profile",
method: ["PUT"],
body({ query }) {
body() {
return {
code: "00000",
data: null,
@@ -204,7 +198,7 @@ export default defineMock([
{
url: "users/password",
method: ["PUT"],
body({ query }) {
body() {
return {
code: "00000",
data: null,
@@ -222,8 +216,7 @@ const userMap: Record<string, any> = {
nickname: "系统管理员",
mobile: "17621210366",
gender: 1,
avatar:
"https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "",
status: 1,
deptId: 1,
@@ -235,8 +228,7 @@ const userMap: Record<string, any> = {
nickname: "测试小用户",
mobile: "17621210366",
gender: 1,
avatar:
"https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "youlaitech@163.com",
status: 1,
deptId: 3,