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
d4e69f28
authored
2020-12-14 10:15:07 +0800
by
焦小希
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
样式修改,登录接口联调
1 parent
b299931a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
staticCss/common.css
staticJs/login.js
staticCss/common.css
View file @
d4e69f2
...
...
@@ -287,7 +287,7 @@ div.footer .system_service ul li a:hover {
left
:
0
;
top
:
-5px
;
font-size
:
14px
;
color
:
#fff
;
/* color: #fff; */
}
/* --------------进度条美化---------------- */
::-webkit-scrollbar
{
...
...
staticJs/login.js
View file @
d4e69f2
...
...
@@ -2,7 +2,7 @@ function login(){
layui
.
use
(
'layer'
,
function
()
{
layer
.
open
({
type
:
1
,
title
:
'登
陆
信息'
,
title
:
'登
录
信息'
,
shadeClose
:
false
,
area
:
[
'500px'
,
'320px'
],
scrollbar
:
false
,
...
...
@@ -13,25 +13,47 @@ function login(){
+
'<li><span><a class="require">*</a>密码</span>:<input id="IDcard"></li>'
+
'</ul>'
+
'<div class="btns">'
+
'<button type="button" id="loginButton">登
陆
</button>'
+
'<button type="button" id="loginButton">登
录
</button>'
+
'<button type="button" id="registerButton">注册</button></div>'
+
'</div>'
});
})
}
// 时间委托解决冒泡
$
(
document
).
off
().
on
(
'click'
,
'
p
'
,
function
(){
$
(
document
).
off
().
on
(
'click'
,
'
.PersonLogin
'
,
function
(){
//所执行的代码
login
()
});
// 点击登陆的时候
$
(
document
).
on
(
'click'
,
'#loginButton'
,
function
(){
layer
.
closeAll
()
var
userLoginRequest
=
{}
var
username
=
$
(
'#userName'
).
val
()
var
password
=
$
(
'#IDcard'
).
val
()
userLoginRequest
.
username
=
username
userLoginRequest
.
password
=
password
clicklogin
(
userLoginRequest
)
// layer.closeAll()
});
// 点击注册的时候
$
(
document
).
on
(
'click'
,
'#registerButton'
,
function
(){
// layer.closeAll()
window
.
open
(
`
${
localhostPaht
}
/staticViews/register.html`
,
'_self'
)
});
function
clicklogin
(
data
){
$
.
ajax
({
type
:
"post"
,
//提交方式
url
:
portal
.
api_url
+
"/protal/users/login"
,
//路径
headers
:{
//***关键******
'Content-Type'
:
'application/json;charset=UTF-8'
,
},
dataType
:
"json"
,
data
:
JSON
.
stringify
(
data
),
//***关键******
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
console
.
log
(
232323
,
result
)
}
}
});
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment