'使用ES6语法,改善重构前端实现'
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
//import red from '../res/js/red'
|
||||
|
||||
const login = ({username, pwd}) => {
|
||||
return {username};
|
||||
const login = ({username, pwd}, callback) => {
|
||||
$.post("/user/login", {username, pwd}, function (json) {
|
||||
callback(json);
|
||||
});
|
||||
}
|
||||
|
||||
const logout = () => {
|
||||
red.getJSON("/user/logout",{}, function () {
|
||||
red.showMsg({msg:"退出成功"});
|
||||
setTimeout(() => {
|
||||
location.href = "/user/login.html";
|
||||
}, 2000)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
export {login, logout}
|
||||
|
||||
Reference in New Issue
Block a user