123456789101112131415161718192021222324252627282930313233343536 |
- {
- "code": function({
- _req,
- Mock
- }) {
- let body = _req.body;
- if ((body.username === 'admin' && body.password === 'e10adc3949ba59abbe56e057f20f883e') || (body.username === 'user' && body.password === 'e10adc3949ba59abbe56e057f20f883e')) {
- return 200
- } else {
- return 500;
- }
- },
- "data": function({
- _req,
- Mock
- }) {
- let body = _req.body;
- if (body.username === 'admin' && body.password === 'e10adc3949ba59abbe56e057f20f883e') return Mock.mock({
- 'token': "bqddxxwqmfncffacvbpkuxvwvqrhln"
- })
- if (body.username === 'user' && body.password === 'e10adc3949ba59abbe56e057f20f883e') return Mock.mock({
- 'token': "unufvdotdqxuzfbdygovfmsbftlvbn"
- })
- },
- "msg": function({
- _req,
- Mock
- }) {
- let body = _req.body;
- if ((body.username === 'admin' && body.password === 'e10adc3949ba59abbe56e057f20f883e') || (body.username === 'user' && body.password === 'e10adc3949ba59abbe56e057f20f883e')) {
- return '成功'
- } else {
- return '用户名或密码错误';
- }
- },
- }
|