Compare commits
2 Commits
8284b2362c
...
26472c467e
| Author | SHA1 | Date |
|---|---|---|
|
|
26472c467e | |
|
|
3fbe4e3f0a |
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
25
js/index.js
25
js/index.js
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -1,40 +1,37 @@
|
|||
|
||||
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);
|
||||
$.ajax({
|
||||
url: baseURL+url,
|
||||
type: method,
|
||||
cache: false,
|
||||
timeout: timeout,
|
||||
contentType: contentType,
|
||||
headers:{
|
||||
"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)
|
||||
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)
|
||||
})
|
||||
};
|
||||
function postAjaxRequst (url, _data, callBack) {
|
||||
request(url, "POST", _data, "application/json", function(res) {
|
||||
return typeof callBack == "function" && callBack(res)
|
||||
})
|
||||
};
|
||||
|
||||
function request(url, method, data = {}, contentType, back) {
|
||||
console.log("data::: ", data);
|
||||
$.ajax({
|
||||
url: baseURL + url,
|
||||
type: method,
|
||||
cache: false,
|
||||
timeout: timeout,
|
||||
contentType: contentType,
|
||||
headers: {
|
||||
"X-Token": localStorage.getItem("token") || "",
|
||||
},
|
||||
dataType: "json",
|
||||
data: JSON.stringify(data),
|
||||
success: function (res) {
|
||||
return typeof back == "function" && back(res);
|
||||
},
|
||||
error: function (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);
|
||||
});
|
||||
}
|
||||
function postAjaxRequst(url, _data, callBack) {
|
||||
request(url, "POST", _data, "application/json", function (res) {
|
||||
return typeof callBack == "function" && callBack(res);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;">
|
||||
|
|
|
|||
Loading…
Reference in New Issue