Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.portalStaticPage
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f4cc47ed
authored
2020-12-21 15:34:47 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:登录
1 parent
aff66904
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
staticJs/login.js
staticJs/login.js
View file @
f4cc47e
...
...
@@ -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
()
{
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
);
}
}
});
...
...
Please
register
or
sign in
to post a comment