Skip to content

Commit

Permalink
style: 用 eslint 和 prettier 处理全部代码语法和格式问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kangood committed Feb 18, 2024
1 parent a9c2c64 commit 3ae8aa8
Show file tree
Hide file tree
Showing 215 changed files with 12,640 additions and 12,239 deletions.
18 changes: 9 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import AntdConfig from '@/theme/antd';
import { MotionLazy } from './components/animate/motion-lazy';

function App() {
return (
<AntdConfig>
<AntdApp>
<MotionLazy>
<Router />
</MotionLazy>
</AntdApp>
</AntdConfig>
);
return (
<AntdConfig>
<AntdApp>
<MotionLazy>
<Router />
</MotionLazy>
</AntdApp>
</AntdConfig>
);
}

export default App;
14 changes: 7 additions & 7 deletions src/_mock/_org.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { ORG_LIST } from '@/_mock/assets';
import { OrgApi } from '@/api/services/orgService';

const orgList = rest.get(`/api${OrgApi.Org}`, (req, res, ctx) => {
return res(
ctx.json({
status: 0,
message: '',
data: ORG_LIST,
}),
);
return res(
ctx.json({
status: 0,
message: '',
data: ORG_LIST,
}),
);
});

export default [orgList];
64 changes: 32 additions & 32 deletions src/_mock/_user.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,45 @@ import { UserApi } from '@/api/services/userService';
import { USER_LIST } from './assets';

const signIn = rest.post(`/api${UserApi.SignIn}`, async (req, res, ctx) => {
const { account, password } = await req.json();
const { account, password } = await req.json();

const user = USER_LIST.find((item) => item.account === account);
const user = USER_LIST.find((item) => item.account === account);

if (!user || user.password !== password) {
return res(
ctx.json({
status: 10001,
message: 'Incorrect account or password.',
}),
);
}

if (!user || user.password !== password) {
return res(
ctx.json({
status: 10001,
message: 'Incorrect account or password.',
}),
ctx.json({
status: 0,
message: '',
data: {
user,
accessToken: faker.string.uuid(),
refreshToken: faker.string.uuid(),
},
}),
);
}

return res(
ctx.json({
status: 0,
message: '',
data: {
user,
accessToken: faker.string.uuid(),
refreshToken: faker.string.uuid(),
},
}),
);
});

const userList = rest.get('/api/user', (req, res, ctx) => {
return res(
ctx.status(200),
ctx.delay(1000),
ctx.json(
Array.from({ length: 10 }).map(() => ({
fullname: faker.person.fullName(),
email: faker.internet.email(),
avatar: faker.image.avatar(),
address: faker.location.streetAddress(),
})),
),
);
return res(
ctx.status(200),
ctx.delay(1000),
ctx.json(
Array.from({ length: 10 }).map(() => ({
fullname: faker.person.fullName(),
email: faker.internet.email(),
avatar: faker.image.avatar(),
address: faker.location.streetAddress(),
})),
),
);
});

export default [signIn, userList];
Loading

0 comments on commit 3ae8aa8

Please sign in to comment.