949bea9d by 任超

Merge branch 'master' of yun.pashanhoo.com:renchao/portalStaticPage

2 parents 98400cd3 86f11914
Pipeline #23 for 949bea9d failed in 0 seconds
......@@ -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 {
......
......@@ -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
......