f4cc47ed by 任超

style:登录

1 parent aff66904
......@@ -39,13 +39,20 @@ $(document).on('click', '#loginButton', function () {
userLoginRequest.phone = username
userLoginRequest.password = password
clicklogin(userLoginRequest)
layer.closeAll()
});
// cancellation
$(document).on('click', '#cancellation', function () {
delCookie();
window.open('' + localhostPaht + '/index.html', '_self')
layui.use('layer', function () {
layer.confirm('此操作将进行注销', {
btn: ['是','否'] //按钮
}, function(){
delCookie();
window.open('' + localhostPaht + '/index.html', '_self')
}, function(){
layer.msg('已取消');
});
})
});
function delCookie () {
var keys = document.cookie.match(/[^ =;]+(?==)/g)
......@@ -67,7 +74,6 @@ $(function () {
})
// 点击注册的时候
$(document).on('click', '#registerButton', function () {
// layer.closeAll()
window.open(`${localhostPaht}/staticViews/register.html`, '_self')
});
function clicklogin(data) {
......@@ -82,10 +88,11 @@ function clicklogin(data) {
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data !== null) {
setCookie(result.data);
$('.personalCenter').addClass('show')
$('.personalCenter').addClass('show');
$('.PersonLogin').html(getCookie('myCookie').username);
layer.closeAll();
} else if (result.code == 210) {
window.open(`${localhostPaht}/staticViews/register.html`, '_self')
layer.msg(result.message);
}
}
});
......