select-svg 基本完成

Former-commit-id: 8e7f1a63631ec0370683eadb16a9203b835f293d [formerly 8e7f1a63631ec0370683eadb16a9203b835f293d [formerly 8e7f1a63631ec0370683eadb16a9203b835f293d [formerly 8e7f1a63631ec0370683eadb16a9203b835f293d [formerly 8e6796da5ea041da9ed2fcbf89e84c91e2b7b230 [formerly 226e52a0e20b8a9cd011e2a2b0b0da2c25b9db4b]]]]]
Former-commit-id: 4fd47532611745f6cefcbbb3f9f9409c6cbb978c
Former-commit-id: 4a9f59b88aa4d6a164010e2cf80a20a6ad704efb
Former-commit-id: 8b2408f7205cf68a8920e6287ad7cdc6da541d13 [formerly 50abaafae7d85ed49404b471297543a95c773e68]
Former-commit-id: e9c5c24e393c7cc06f275b8249a1ff10e5aea3e2
Former-commit-id: 133e32b20973babb6cb2815c5f88f925e1d68cf2
Former-commit-id: 5b4528bd6e10f53f5ca19948af5fbe40a18ae4d3
Former-commit-id: 429cc57574024a3d073657f7c773104ec29ced39
Former-commit-id: b78065290d0d26c7fe4c6b2fd41288fb115686df
This commit is contained in:
liyang
2018-12-12 20:57:40 +08:00
parent 8104fb1db6
commit d7a2b04f45
15 changed files with 380 additions and 102 deletions

View File

@@ -1,5 +1,3 @@
import Mock from 'mockjs'
const userDB = [
{
username: 'admin',
@@ -21,23 +19,26 @@ const userDB = [
}
]
Mock.mock('/api/login', 'post', ({ url, type, body }) => {
const bodyObj = JSON.parse(body)
const user = userDB.find(e => e.username === bodyObj.username && e.password === bodyObj.password)
if (user) {
return {
code: 0,
msg: '登录成功',
data: {
...user,
token: 'd787syv8dys8cas80d9s0a0d8f79ads56f7s4d56f879a8as89fd980s7dg'
export default {
path: RegExp('/api/login'),
method: 'post',
handle ({ body }) {
const user = userDB.find(e => e.username === body.username && e.password === body.password)
if (user) {
return {
code: 0,
msg: '登录成功',
data: {
...user,
token: 'd787syv8dys8cas80d9s0a0d8f79ads56f7s4d56f879a8as89fd980s7dg'
}
}
} else {
return {
code: 401,
msg: '用户名或密码错误',
data: {}
}
}
} else {
return {
code: 401,
msg: '用户名或密码错误',
data: {}
}
}
})
}