Compare commits

...

2 Commits

Author SHA1 Message Date
石超 26472c467e Merge branch 'main' of http://123.132.248.154:10000/shichao/PanDuWeb 2024-07-17 17:29:02 +08:00
石超 3fbe4e3f0a '用户登录' 2024-07-17 17:28:54 +08:00
5 changed files with 67 additions and 61 deletions

View File

@ -142,11 +142,11 @@ $(function () {
$('.J_mainContent').find('iframe.J_iframe').hide().parents('.J_mainContent').append(str1);
//显示loading提示
// var loading = layer.load();
//
// $('.J_mainContent iframe:visible').load(function () {
// //iframe加载完成后隐藏loading提示
// layer.close(loading);
var loading = layer.load();
$('.J_mainContent iframe:visible').load(function () {
//iframe加载完成后隐藏loading提示
layer.close(loading);
// });
// 添加选项卡
$('.J_menuTabs .page-tabs-content').append(str);

View File

@ -26,7 +26,7 @@
<span><img alt="image" class="img-circle" src="img/profile_small.jpg" /></span>
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<span class="clear">
<span class="block m-t-xs"><strong class="font-bold">Beaut-ruoyi</strong></span>
<span class="block m-t-xs"><strong class="font-bold" id="user-name"></strong></span>
<span class="text-muted text-xs block">审核员<b class="caret"></b></span>
</span>
</a>
@ -211,9 +211,12 @@
<!-- 自定义js -->
<script src="js/hplus.js?v=4.1.0"></script>
<script type="text/javascript" src="js/contabs.js"></script>
<script src="js/request.js"></script>
<!-- 第三方插件 -->
<script src="js/plugins/pace/pace.min.js"></script>
<script src="js/plugins/toastr/toastr.min.js"></script>
<!-- 业务js -->
<script src="js/index.js"></script>
</body>

View File

@ -1,4 +1,27 @@
$(document).ready(function () {
$(window).ready(function () {
let token = localStorage.getItem("token");
let url_path = window.location.pathname;
if (url_path.indexOf("login.html") == -1) {
if (token) {
getAjaxRequst("/api/Check/GetUserProfile",{}, function (res) {
console.log('res::: ', res);
console.log('res::: ', res);
if (res.code != 200) {
toastr.error("登录信息已过期,请重新登录");
localStorage.removeItem("token");
window.location.href = "login.html";
} else {
localStorage.setItem("account", res.result.account);
localStorage.setItem("name", res.result.name);
$("#user-name").text(res.result.name);
}
});
} else {
toastr.error("请先登录");
window.location.href = "login.html";
}
}
// Place JavaScript code here.
$("#login-btn").click(function () {
let account = $("#login-mobile").val();

View File

@ -1,11 +1,10 @@
const baseURL = 'http://192.168.10.102:9008';
const baseURL = "http://192.168.10.102:9008";
const timeout = 3000;
// requet ajax
function request(url, method, data = {}, contentType, back) {
console.log('data::: ', data);
console.log("data::: ", data);
$.ajax({
url: baseURL + url,
type: method,
@ -13,28 +12,26 @@ function request (url, method, data={}, contentType, back){
timeout: timeout,
contentType: contentType,
headers: {
"X-Token":localStorage.getItem('token') || ''
"X-Token": localStorage.getItem("token") || "",
},
dataType: "json",
data: JSON.stringify(data),
success: function (res) {
console.log(res)
return typeof back == "function" && back(res);
},
error: function (error) {
console.log(error)
console.log(error);
return typeof back == "function" && back(null);
}
},
});
};
}
function getAjaxRequst(url, _data, callBack) {
request(url, "GET", _data, "application/json", function (res) {
return typeof callBack == "function" && callBack(res)
})
};
return typeof callBack == "function" && callBack(res);
});
}
function postAjaxRequst(url, _data, callBack) {
request(url, "POST", _data, "application/json", function (res) {
return typeof callBack == "function" && callBack(res)
})
};
return typeof callBack == "function" && callBack(res);
});
}

View File

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -93,22 +92,6 @@
<input type="checkbox" value="张三">张三</label>
<label class="checkbox-inline i-checks">
<input type="checkbox" value="李四">李四</label>
<label class="checkbox-inline i-checks">
<input type="checkbox" value="王五">王五</label>
<label class="checkbox-inline i-checks">
<input type="checkbox" value="赵六">赵六</label>
<label class="checkbox-inline i-checks">
<input type="checkbox" value="钱七">钱七</label>
<label class="checkbox-inline i-checks">
<input type="checkbox" value="张三">张三</label>
<label class="checkbox-inline i-checks">
<input type="checkbox" value="李四">李四</label>
<label class="checkbox-inline i-checks">
<input type="checkbox" value="王五">王五</label>
<label class="checkbox-inline i-checks">
<input type="checkbox" value="赵六">赵六</label>
<label class="checkbox-inline i-checks">
<input type="checkbox" value="钱七">钱七</label>
</div>
</div>
<div class="modal-footer" style="border-top: 0px;position: absolute;bottom: 10px; right:10px;">