style:登录
Showing
1 changed file
with
11 additions
and
4 deletions
... | @@ -39,13 +39,20 @@ $(document).on('click', '#loginButton', function () { | ... | @@ -39,13 +39,20 @@ $(document).on('click', '#loginButton', function () { |
39 | userLoginRequest.phone = username | 39 | userLoginRequest.phone = username |
40 | userLoginRequest.password = password | 40 | userLoginRequest.password = password |
41 | clicklogin(userLoginRequest) | 41 | clicklogin(userLoginRequest) |
42 | layer.closeAll() | ||
43 | }); | 42 | }); |
44 | 43 | ||
45 | // cancellation | 44 | // cancellation |
46 | $(document).on('click', '#cancellation', function () { | 45 | $(document).on('click', '#cancellation', function () { |
46 | layui.use('layer', function () { | ||
47 | layer.confirm('此操作将进行注销', { | ||
48 | btn: ['是','否'] //按钮 | ||
49 | }, function(){ | ||
47 | delCookie(); | 50 | delCookie(); |
48 | window.open('' + localhostPaht + '/index.html', '_self') | 51 | window.open('' + localhostPaht + '/index.html', '_self') |
52 | }, function(){ | ||
53 | layer.msg('已取消'); | ||
54 | }); | ||
55 | }) | ||
49 | }); | 56 | }); |
50 | function delCookie () { | 57 | function delCookie () { |
51 | var keys = document.cookie.match(/[^ =;]+(?==)/g) | 58 | var keys = document.cookie.match(/[^ =;]+(?==)/g) |
... | @@ -67,7 +74,6 @@ $(function () { | ... | @@ -67,7 +74,6 @@ $(function () { |
67 | }) | 74 | }) |
68 | // 点击注册的时候 | 75 | // 点击注册的时候 |
69 | $(document).on('click', '#registerButton', function () { | 76 | $(document).on('click', '#registerButton', function () { |
70 | // layer.closeAll() | ||
71 | window.open(`${localhostPaht}/staticViews/register.html`, '_self') | 77 | window.open(`${localhostPaht}/staticViews/register.html`, '_self') |
72 | }); | 78 | }); |
73 | function clicklogin(data) { | 79 | function clicklogin(data) { |
... | @@ -82,10 +88,11 @@ function clicklogin(data) { | ... | @@ -82,10 +88,11 @@ function clicklogin(data) { |
82 | success: function (result) {//返回数据根据结果进行相应的处理 | 88 | success: function (result) {//返回数据根据结果进行相应的处理 |
83 | if (result.code == 200 && result.data !== null) { | 89 | if (result.code == 200 && result.data !== null) { |
84 | setCookie(result.data); | 90 | setCookie(result.data); |
85 | $('.personalCenter').addClass('show') | 91 | $('.personalCenter').addClass('show'); |
86 | $('.PersonLogin').html(getCookie('myCookie').username); | 92 | $('.PersonLogin').html(getCookie('myCookie').username); |
93 | layer.closeAll(); | ||
87 | } else if (result.code == 210) { | 94 | } else if (result.code == 210) { |
88 | window.open(`${localhostPaht}/staticViews/register.html`, '_self') | 95 | layer.msg(result.message); |
89 | } | 96 | } |
90 | } | 97 | } |
91 | }); | 98 | }); | ... | ... |
-
Please register or sign in to post a comment