mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-20 06:23:47 +00:00
logout
This commit is contained in:
+4
-1
@@ -11,6 +11,10 @@ if (!global.adminUsersData) {
|
||||
{
|
||||
username: 'guest',
|
||||
password: 'guest'
|
||||
},
|
||||
{
|
||||
username: '吴彦祖',
|
||||
password: '123456'
|
||||
}
|
||||
]
|
||||
adminUsersData = data
|
||||
@@ -28,7 +32,6 @@ Watch.watch(adminUsersData, function () {
|
||||
|
||||
module.exports = {
|
||||
'POST /api/login' (req, res) {
|
||||
console.log(req);
|
||||
const userItem = req.body
|
||||
const response = {
|
||||
success: false,
|
||||
|
||||
+1
-2
@@ -22,7 +22,6 @@ const login = ({
|
||||
validateFieldsAndScroll
|
||||
}
|
||||
}) => {
|
||||
console.log(loginButtonLoading);
|
||||
|
||||
function handleOk() {
|
||||
validateFieldsAndScroll((errors, values) => {
|
||||
@@ -58,7 +57,7 @@ const login = ({
|
||||
message: '请填写密码'
|
||||
}
|
||||
]
|
||||
})(<Input size="large" placeholder="密码"/>)}
|
||||
})(<Input size="large" type="password" placeholder="密码"/>)}
|
||||
</FormItem>
|
||||
<Row>
|
||||
<Button type="primary" size="large" onClick={handleOk} loading={loginButtonLoading}>
|
||||
|
||||
@@ -65,7 +65,6 @@ function Users({ location, dispatch, users }) {
|
||||
field,
|
||||
keyword,
|
||||
onSearch(fieldsValue) {
|
||||
console.log(fieldsValue);
|
||||
dispatch({
|
||||
type: 'users/query',
|
||||
payload: fieldsValue,
|
||||
|
||||
+9
-5
@@ -1,5 +1,5 @@
|
||||
const Mock = require('mockjs')
|
||||
const mockData = [require("../../mock/users"),require("../../mock/app")]
|
||||
const mockData = [require("../../mock/users"), require("../../mock/app")]
|
||||
|
||||
function serialize(str) {
|
||||
let paramArray = str.split("&")
|
||||
@@ -12,9 +12,13 @@ function serialize(str) {
|
||||
|
||||
for (let i in mockData) {
|
||||
for (let key in mockData[i]) {
|
||||
Mock.mock(eval("/"+key.split(" ")[1].replace(/\//g,"\\\/")+"/"), key.split(" ")[0].toLowerCase(), function (options) {
|
||||
if(key.split(" ")[0].toLowerCase()=='get'){
|
||||
options.query = !!options.url.split("?")[1] ? serialize(options.url.split("?")[1]) : (!!options.body ? serialize(options.body) : {})
|
||||
Mock.mock(eval("/" + key.split(" ")[1].replace(/\//g, "\\\/") + "/"), key.split(" ")[0].toLowerCase(), function (options) {
|
||||
if (key.split(" ")[0].toLowerCase() == 'get') {
|
||||
options.query = !!options.url.split("?")[1]
|
||||
? serialize(options.url.split("?")[1])
|
||||
: (!!options.body
|
||||
? serialize(options.body)
|
||||
: {})
|
||||
}
|
||||
let res = {}
|
||||
let result = {}
|
||||
@@ -27,4 +31,4 @@ for (let i in mockData) {
|
||||
}
|
||||
}
|
||||
|
||||
Mock.setup({timeout: 400})
|
||||
Mock.setup({timeout: '200-600'})
|
||||
|
||||
Reference in New Issue
Block a user