重构华夏erp的整体ui风格

This commit is contained in:
季圣华
2019-09-13 22:16:29 +08:00
parent 4b82ad7f29
commit 9247e77398
345 changed files with 119676 additions and 620 deletions

Binary file not shown.

View File

@@ -0,0 +1,122 @@
/*!
* 消息推送实现
* @author ThinkGem
*/
$(function () {
unreadMsg()
});
function unreadMsg() {
$.get(ctx + "/msg/unreadMsg?__notUpdateSession=true&__t=" + new Date().getTime(), function (d) {
var b = $("#msgList").empty();
var a = d.count || 0, c = d.list || [];
for (i = 0; i < c.length; i++) {
b.append(js.template("msgListTpl", c[i]))
}
$("#msgNum, #msgNum2").text(a);
$(".timeago").timeago();
pullPoolMsg();
if (window.ppmInt) {
clearInterval(window.ppmInt)
}
window.ppmInt = setInterval(pullPoolMsg, 60 * 1000)
})
}
function pullPoolMsg() {
var a = $("#msgList");
var b = a.attr("data-mergeMsgLimit");
$.get(ctx + "/msg/pullPoolMsg?__notUpdateSession=true&__t=" + new Date().getTime(), function (e) {
for (i = 0; i < e.length; i++) {
if (!(e.length > b)) {
var g = js.template("msgTipTpl", e[i]);
js.showMessage(g, e[i].msgContentEntity.title, "info", 1000 * 60);
doFlashTitle()
}
if (e[i].id && e[i].id != "") {
a.prepend(js.template("msgListTpl", e[i]))
}
}
if (e.length > b) {
var f = {
msgContentEntity: {
title: a.attr("data-mergeMsgTitle"),
content: js.text(a.attr("data-mergeMsgContent"), e.length)
}, sendDate: "", sendUserName: "", id: ""
};
var g = js.template("msgTipTpl", f);
js.showMessage(g, null, "info", 1000 * 60);
doFlashTitle()
}
var c = parseInt($("#msgNum").text());
if (!isNaN(c)) {
c += e.length || 0
} else {
c = a.find("li").length
}
$("#msgNum, #msgNum2").text(c);
$(".timeago").timeago()
})
}
function readMsg(c, d, e) {
var a = $(c).data("href");
if (e == "") {
a = ctx + "/msg/list"
}
var b = js.addTabPage($(c), d, a);
if (b) {
$("#" + b + "-frame").on("load", function () {
setTimeout(unreadMsg, 1000)
})
}
}
var isWindowFocus = true;
if ("onfocusin" in document) {
document.onfocusin = function () {
isWindowFocus = true
};
document.onfocusout = function () {
isWindowFocus = false
}
} else {
window.onfocus = function () {
isWindowFocus = true
};
window.onblur = function () {
isWindowFocus = false
}
}
var flashStep = 0;
var flashTitleRun = false;
var normalTitle = document.title;
var flashTitle = function () {
if (isWindowFocus) {
document.title = normalTitle;
flashTitleRun = false;
return
}
flashTitleRun = true;
flashStep++;
if (flashStep == 3) {
flashStep = 1
}
if (flashStep == 1) {
document.title = "【新消息】" + normalTitle
}
if (flashStep == 2) {
document.title = "【   】" + normalTitle
}
setTimeout("flashTitle()", 500)
};
function doFlashTitle() {
if (!flashTitleRun) {
flashTitle()
}
var a = document.getElementById("audioMessage");
if (a) {
a.play()
}
};

View File

@@ -0,0 +1,100 @@
//创建menu
var userBusinessList = null;
var type = null;
var options = "";
var kid = null;
var lei = null;
var functions = "";
var btnStrList = []; //按钮权限列表
//初始化系统基础信息
function initSystemData(kid, type) {
$.ajax({
type: "get",
url: "/userBusiness/getBasicData",
data: ({
KeyId: kid,
Type: type
}),
//设置为同步
async: false,
dataType: "json",
success: function (res) {
if (res && res.code === 200) {
userBusinessList = res.data.userBusinessList;
}
else {
userBusinessList = null;
}
}
});
}
//初始化页面选项卡
function initSelectInfo(lei) {
if (userBusinessList != null) {
if (userBusinessList.length > 0) {
options = userBusinessList[0].value;
if (options != "") {
options = options.substring(1, options.length - 1);
}
//功能菜单列表
if (lei == 2) {
functions += options + '][';
}
//按钮权限列表
else if (lei == 3) {
var btnStr = userBusinessList[0].btnstr;
if (btnStr != null) {
var btnObj = JSON.parse(btnStr);
for (var j = 0; j < btnObj.length; j++) {
btnStrList.push(btnObj[j]);
}
}
}
}
}
}
var id =sessionStorage.getItem("userId");
initSystemData(id, 'UserRole');
initSelectInfo(1);
var arr = options.split('][');
for (var i in arr) {
initSystemData(arr[i], 'RoleFunctions'); //根据角色找functions
initSelectInfo(2); //功能菜单列表
initSelectInfo(3); //查询角色对应的按钮权限
}
if (functions != "") {
functions = "[" + functions.substring(0, functions.length - 1);
//alert(functions);
}
if (btnStrList.length > 0) {
window.winBtnStrList = JSON.stringify(btnStrList); //将按钮功能列表存为全局变量
}
$.ajax({
type: "post",
url: "/functions/findMenu",
data: ({
pNumber: 0,
hasFunctions: functions
}),
dataType: "json",
async: false,
success: function (res) {
if (res) {
var json = {};
json.menu = res;
$.ajax({
type: "get",
url: "../../../pages/template/menu.html?1515",
async: false,
success: function (tem) {
if (tem) {
var template = Handlebars.compile(tem);
var htmlValue = template(json);
$(".sidebar-menu").html(htmlValue);
}
}
});
}
}
});

View File

@@ -0,0 +1,148 @@
/*!
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* @author ThinkGem
* @version 2019-2-16
*/
.fixed .main-header {
position: relative;
max-height: none
}
.fixed .content-wrapper, .fixed .right-side {
padding-top: 0
}
.fixed .main-header .navbar, .fixed .right-side {
margin-left: 0
}
.fixed .main-sidebar {
top: auto;
padding-top: 0;
position: relative;
height: 0
}
.main-header .logo small {
font-size: 17px
}
.main-header .navbar .dropdow-menu {
border-top: 0
}
.main-header .navbar .dropdown-menu li a {
color: #555;
padding: 5px 15px 5px 25px
}
.main-header .navbar .dropdown-menu li a:hover {
background: #e1e3e9;
color: #555
}
.main-header .navbar .dropdown-menu li.divider {
background-color: #ddd
}
.navbar-nav > .user-menu > .dropdown-menu {
width: auto
}
.navbar-nav > .messages-menu i.img-circle {
margin: auto 10px auto auto;
display: block;
width: 33px;
height: 33px;
padding: 9px;
font-weight: bold
}
.navbar-nav > .messages-menu > .dropdown-menu > li.header {
border-radius: 0;
background-color: #f9f9f9
}
.user-panel > .image > img {
width: 45px;
height: 45px;
background: #fff
}
.sidebar-collapse .user-panel > .image > img {
width: 27px;
height: 27px
}
.user-panel > .info {
padding-left: 11px
}
.sidebar-menu > li a {
overflow: hidden;
text-overflow: ellipsis
}
.sidebar-menu > li > a {
padding: 12px 15px 12px 12px;
font-size: 15px
}
.sidebar-menu > li > .treeview-menu {
margin: 0
}
.sidebar-menu > .treeview > .treeview-menu {
padding-left: 0
}
.sidebar-menu .treeview-menu > li > a {
padding: 7px 5px 8px 20px
}
.main-sidebar, .left-side {
width: 170px
}
.main-header .navbar, .content-wrapper, .right-side, .main-footer {
margin-left: 170px
}
@media (max-width: 767px) {
.main-header .logo {
width: 100%
}
.main-header .navbar, .content-wrapper, .right-side, .main-footer {
margin-left: 0
}
.sidebar-open .content-wrapper, .sidebar-open .main-footer {
-webkit-transform: translate(200px, 0);
-ms-transform: translate(200px, 0);
-o-transform: translate(200px, 0);
transform: translate(200px, 0)
}
.main-sidebar {
-webkit-transform: translate(-200px, 0);
-ms-transform: translate(-200px, 0);
-o-transform: translate(-200px, 0);
transform: translate(-200px, 0)
}
}
.main-header .logo {
width: auto;
min-width: 170px
}
@media (min-width: 768px) {
.sidebar-mini.sidebar-collapse .main-header .logo {
width: auto
}
.sidebar-mini.sidebar-collapse .main-header .navbar {
margin-left: 0
}
}

View File

@@ -0,0 +1,425 @@
if (self.frameElement && self.frameElement.tagName == "IFRAME") {
top.location.reload();
/*!
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
*
* @author ThinkGem
* @version 2019-1-6
*/
}
+function (d) {
var b = "lte.pushmenu";
var e = {collapseScreenSize: 767, expandOnHover: false, expandTransitionDelay: 50};
var a = {
collapsed: ".sidebar-collapse",
open: ".sidebar-open",
mainSidebar: ".main-sidebar",
contentWrapper: ".content-wrapper",
searchInput: ".sidebar-form .form-control",
button: '[data-toggle="push-menu"]',
mini: ".sidebar-mini",
expanded: ".sidebar-expanded-on-hover",
layoutFixed: ".fixed"
};
var h = {
collapsed: "sidebar-collapse",
open: "sidebar-open",
mini: "sidebar-mini",
expanded: "sidebar-expanded-on-hover",
expandFeature: "sidebar-mini-expand-feature",
layoutFixed: "fixed"
};
var i = {expanded: "expanded.pushMenu", collapsed: "collapsed.pushMenu"};
var g = function (j) {
this.options = j;
this.init()
};
g.prototype.init = function () {
if (this.options.expandOnHover || (d("body").is(a.mini + a.layoutFixed))) {
this.expandOnHover();
d("body").addClass(h.expandFeature)
}
d(a.contentWrapper).click(function () {
if (d(window).width() <= this.options.collapseScreenSize && d("body").hasClass(h.open)) {
this.close()
}
}.bind(this));
d(a.searchInput).click(function (j) {
j.stopPropagation()
})
};
g.prototype.toggle = function () {
var k = d(window).width();
var j = !d("body").hasClass(h.collapsed);
if (k <= this.options.collapseScreenSize) {
j = d("body").hasClass(h.open)
}
if (!j) {
this.open()
} else {
this.close()
}
window.setTimeout(function () {
d(window).resize()
}, 100)
};
g.prototype.open = function () {
var j = d(window).width();
if (j > this.options.collapseScreenSize) {
d("body").removeClass(h.collapsed).trigger(d.Event(i.expanded))
} else {
d("body").addClass(h.open).trigger(d.Event(i.expanded))
}
};
g.prototype.close = function () {
var j = d(window).width();
if (j > this.options.collapseScreenSize) {
d("body").addClass(h.collapsed).trigger(d.Event(i.collapsed))
} else {
d("body").removeClass(h.open + " " + h.collapsed).trigger(d.Event(i.collapsed))
}
};
g.prototype.expandOnHover = function () {
d(a.mainSidebar).hover(function () {
if (d("body").is(a.mini + a.collapsed) && d(window).width() > this.options.collapseScreenSize) {
this.expand()
}
}.bind(this), function () {
if (d("body").is(a.expanded)) {
this.collapse()
}
}.bind(this))
};
g.prototype.expand = function () {
setTimeout(function () {
d("body").removeClass(h.collapsed).addClass(h.expanded)
}, this.options.expandTransitionDelay)
};
g.prototype.collapse = function () {
setTimeout(function () {
d("body").removeClass(h.expanded).addClass(h.collapsed)
}, this.options.expandTransitionDelay)
};
function f(j) {
return this.each(function () {
var m = d(this);
var l = m.data(b);
if (!l) {
var k = d.extend({}, e, m.data(), typeof j == "object" && j);
m.data(b, (l = new g(k)))
}
if (j == "toggle") {
l.toggle()
}
})
}
var c = d.fn.pushMenu;
d.fn.pushMenu = f;
d.fn.pushMenu.Constructor = g;
d.fn.pushMenu.noConflict = function () {
d.fn.pushMenu = c;
return this
};
d(document).on("click", a.button, function (j) {
j.preventDefault();
f.call(d(this), "toggle")
});
d(function () {
f.call(d(a.button));
d(a.button).css({cursor: "pointer"})
})
}(jQuery) + function (e) {
var b = "lte.tree";
var f = {animationSpeed: 50, accordion: true, followLink: true, trigger: ".treeview a"};
var a = {
tree: ".tree",
treeview: ".treeview",
treeviewMenu: ".treeview-menu",
open: ".menu-open, .active",
li: "li",
data: '[data-widget="tree"]',
active: ".active"
};
var h = {open: "menu-open", tree: "tree"};
var i = {collapsed: "collapsed.tree", expanded: "expanded.tree"};
var d = function (k, j) {
this.element = k;
this.options = j;
e(this.element).addClass(h.tree);
e(a.treeview + a.active, this.element).addClass(h.open);
this._setUpListeners()
};
d.prototype.toggle = function (n, m) {
var l = n.next(a.treeviewMenu);
var j = n.parent();
var k = j.hasClass(h.open);
if (!j.is(a.treeview)) {
return
}
if (!this.options.followLink || n.attr("href") == "#") {
m.preventDefault()
}
if (k) {
this.collapse(l, j)
} else {
this.expand(l, j)
}
if (l.children().length === 0) {
e(".active", this.element).removeClass("treeview-item active");
j.parents(".treeview:not(.active)").addClass("menu-open active");
j.addClass("treeview-item active")
}
};
d.prototype.expand = function (k, l) {
var n = e.Event(i.expanded);
if (this.options.accordion) {
var j = l.siblings(a.open);
var m = j.children(a.treeviewMenu);
this.collapse(m, j)
}
l.addClass(h.open);
k.slideDown(this.options.animationSpeed, function () {
e(this.element).trigger(n)
}.bind(this))
};
d.prototype.collapse = function (k, j) {
var l = e.Event(i.collapsed);
k.find(a.open).removeClass(h.open);
j.removeClass(h.open);
k.slideUp(this.options.animationSpeed, function () {
k.find(a.open + " > " + a.treeview).slideUp();
e(this.element).trigger(l)
}.bind(this))
};
d.prototype._setUpListeners = function () {
var j = this;
e(this.element).on("click", this.options.trigger, function (k) {
j.toggle(e(this), k)
})
};
function g(j) {
return this.each(function () {
var m = e(this);
var l = m.data(b);
if (!l) {
var k = e.extend({}, f, m.data(), typeof j == "object" && j);
m.data(b, new d(m, k))
}
})
}
var c = e.fn.tree;
e.fn.tree = g;
e.fn.tree.Constructor = d;
e.fn.tree.noConflict = function () {
e.fn.tree = c;
return this
};
e(function () {
e(a.data).each(function () {
g.call(e(this))
})
})
}(jQuery);
$(function () {
js.initTabPage("tabpanel", {
height: function () {
var g = $(window).height(), e = $(".main-header:visible").outerHeight(),
f = $(".main-footer:visible").outerHeight(), d = g - e - f;
return d < 300 ? 300 : d
}
});
$(window).resize();
var b = $("#desktopTabPage");
if (b.length > 0) {
var a = b.data("url");
if (a != "" && a != ctx) {
js.addTabPage(null, '<i class="fa fa-home"></i> ' + b.data("title"), a, false, false)
}
}
var c = $("#modifyPasswordTip");
if (c.length > 0 && c.data("message") != "") {
js.confirm(c.data("message"), function () {
$("#modifyPassword").click()
})
}
window.isMenuClickFlag = false;
$(window).bind("hashchange", function (h) {
if (!window.isMenuClickFlag) {
var g = window.location.hash.replace("#", "");
if (g && g != "" && g != window.location.pathname) {
var f = $('a.addTabPage[data-href="' + g + '"]:eq(0)');
if (f && f.length > 0) {
f.click()
} else {
if ($(".sidebar-menu").length > 0) {
js.addTabPage(null, js.text("tabpanel.newTabPage"), g)
}
}
} else {
var d = $(".sidebar-menu > li:eq(0):not(.active) > a:eq(0)");
if (d.data("href") == "blank") {
d.click()
}
}
}
window.isMenuClickFlag = false
}).trigger("hashchange");
$("#fullScreen").click(function () {
if ($(this).data("isOpen") == "true") {
$(this).data("isOpen", "false");
if (document.exitFullscreen) {
document.exitFullscreen()
} else {
if (document.msExitFullscreen) {
document.msExitFullscreen()
} else {
if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
} else {
if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen()
}
}
}
}
} else {
$(this).data("isOpen", "true");
var d = document.documentElement;
if (d.requestFullscreen) {
d.requestFullscreen()
} else {
if (d.msRequestFullscreen) {
d.msRequestFullscreen()
} else {
if (d.mozRequestFullScreen) {
d.mozRequestFullScreen()
} else {
if (d.webkitRequestFullScreen) {
d.webkitRequestFullScreen()
}
}
}
}
}
return false
}).tooltip();
$("#switchSkin").click(function () {
js.layer.open({
type: 2,
shadeClose: true,
title: $(this).attr("data-original-title"),
area: ["530px", "440px"],
content: ctx + "/switchSkin/select",
success: function (d, e) {
if ($(js.layer.window).width() < 500 || $(js.layer.window).height() < 390) {
js.layer.full(e)
}
},
})
}).tooltip()
});
+function (h) {
var g = "lte.layout";
var c = {slimscroll: true, resetHeight: true};
var b = {
wrapper: ".wrapper",
contentWrapper: ".content-wrapper",
layoutBoxed: ".layout-boxed",
mainFooter: ".main-footer:visible",
mainHeader: ".main-header:visible",
sidebar: ".sidebar",
controlSidebar: ".control-sidebar",
fixed: ".fixed",
sidebarMenu: ".sidebar-menu",
logo: ".main-header .logo"
};
var f = {fixed: "fixed", holdTransition: "hold-transition"};
var e = function (i) {
this.options = i;
this.bindedResize = false;
this.activate()
};
e.prototype.activate = function () {
this.fix();
this.fixSidebar();
h("body").removeClass(f.holdTransition);
if (!this.bindedResize) {
h(window).resize(function () {
this.fix();
this.fixSidebar();
h(b.logo + ", " + b.sidebar).one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend", function () {
this.fix();
this.fixSidebar()
}.bind(this));
var i = this;
setTimeout(function () {
i.fix();
i.fixSidebar()
}, 500)
}.bind(this));
this.bindedResize = true
}
};
e.prototype.fix = function () {
};
e.prototype.fixSidebar = function () {
if (!h("body").hasClass(f.fixed)) {
return
}
if (this.options.slimscroll) {
if (typeof h.fn.slimScroll !== "undefined") {
h(b.sidebar).slimScroll({height: (h(b.contentWrapper).height()) + "px", color: "#aaa", size: "3px"})
}
}
};
function d(i) {
return this.each(function () {
var l = h(this);
var k = l.data(g);
if (!k) {
var j = h.extend({}, c, l.data(), typeof i === "object" && i);
l.data(g, (k = new e(j)))
}
if (typeof i === "string") {
if (typeof k[i] === "undefined") {
throw new Error("No method named " + i)
}
k[i]()
}
})
}
var a = h.fn.layout;
h.fn.layout = d;
h.fn.layout.Constuctor = e;
h.fn.layout.noConflict = function () {
h.fn.layout = a;
return this
};
h(function () {
d.call(h("body"))
})
}(jQuery);
////////////////////
$(function () {
$('#sidebarLoginOut, #loginOut').off("click").on("click", function () {
$.messager.confirm("提示","确认要退出系统吗?",function(r){
if(r) {
sessionStorage.removeItem("userId");
location.href = '/user/logout';
}
});
})
});

View File

@@ -0,0 +1,87 @@
/*!
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* @author ThinkGem
* @version 2019-2-16
*/
.login-page {
background: #e3e7ec
}
.login-page .login-box {
width: auto
}
.login-page .login-logo a {
color: #666
}
.login-page .login-logo small {
font-size: 16px
}
.login-page .login-box-body {
width: 360px;
margin: auto;
padding: 28px;
background: #fff;
box-shadow: 0 2px 6px #999;
border-radius: 5px
}
.login-page .login-box-body .form-control-feedback {
cursor: pointer;
pointer-events: auto
}
.login-page .form-group {
margin-top: 5px;
margin-bottom: 23px
}
.login-page .has-feedback .form-control {
height: 34px;
padding: 4px 10px
}
.login-page .input-group-btn .btn {
height: 34px
}
.login-page .btn {
padding: 5px 10px 4px 10px;
font-size: 15px
}
.login-page .select2-container .select2-selection--single {
padding: 6px 12px;
height: 34px
}
.login-page .select2-container--default.select2-container--focus .select2-selection--single {
border-color: #3c8dbc
}
.login-page .select2-container .select2-selection--single .select2-selection__rendered {
margin-top: -4px
}
.login-page .select2-container .select2-selection--single .select2-selection__arrow {
top: 1px
}
.login-page .select2-search--dropdown .select2-search__field {
padding: 4px
}
.login-page .select2-results__option {
padding: 6px 12px
}
.login-page .login-copyright {
text-align: center;
margin-top: 20px
}
.login-page .login-copyright, .login-page .login-copyright a {
color: #666
}

View File

@@ -0,0 +1,130 @@
/*!
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
*
* @author ThinkGem
* @version 2019-1-6
*/
$("#username, #password").on("focus blur", function () {
var a = this;
setTimeout(function () {
var b = $(a).css("borderColor");
if (b != "") {
$(a).prev().css("color", b)
}
}, 100)
}).blur();
var userName = localStorage.getItem("username");
var password = localStorage.getItem("password");
if(userName){
$("#username").val(userName);
setTimeout(function() {
$("#rememberUserCode").parent().addClass("checked");
},200);
}
if(password){
$("#password").val(password);
setTimeout(function() {
$("#rememberMe").parent().addClass("checked");
},200);
}
//初始化键盘enter事件
$(document).keydown(function (event) {
//兼容 IE和firefox 事件
var e = window.event || event;
var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 username 和password的输入框才可以触发键盘事件 13键盘事件
if (k == "13" && (obj.id == "username" || obj.id == "password"))
loginFun();
});
//登录按钮绑定处理事件
$('#btnSubmit').off("click").on("click", function () {
var rememberUserCode = $("#rememberUserCode").parent().hasClass("checked");
var rememberMe = $("#rememberMe").parent().hasClass("checked");
localStorage.removeItem("username");
localStorage.removeItem("password");
if(rememberUserCode) {
localStorage.setItem("username",$("#username").val());
}
if(rememberMe) {
localStorage.setItem("username",$("#username").val());
localStorage.setItem("password",$("#password").val());
}
loginFun();
});
//检测用户输入数据
function loginFun() {
var username = $.trim($('#username').val());
var password = $.trim($('#password').val());
if (null == username || 0 == username.length) {
$("#username").val("").focus();
return;
}
if (null == password || 0 == password.length) {
$("#password").val("").focus();
return;
}
if (username != null && username.length != 0
&& password != null && password.length != 0) {
$("#username").focus();
$.ajax({
type: "post",
url: "/user/login",
dataType: "json",
data: ({
loginame: username,
password: hex_md5(password)
}),
success: function (res) {
if(res) {
var loginInfoTip = res.data.msgTip;
//用户名不存在,清空输入框并定位到用户名输入框
if (loginInfoTip.indexOf("user is not exist") != -1) {
$("#username").val("").focus();
$("#password").val("");
alert("用户名不存在");
return;
}
else if (loginInfoTip.indexOf("user password error") != -1) {
alert("用户密码错误");
return;
}
else if (loginInfoTip.indexOf("access service error") != -1) {
alert("后台访问错误");
return;
}
//跳转到用户管理界面
else if (loginInfoTip.indexOf("user can login") != -1 || loginInfoTip == "user already login") {
$.ajax({
type: "get",
url: "/user/getUserSession",
dataType: "json",
success: function (res) {
if(res && res.code === 200) {
if(res.data.user) {
var user = res.data.user;
sessionStorage.setItem("userId", user.id);
top.location.href = "/index.html";
}
}
},
//此处添加错误处理
error: function () {
alert("后台访问错误,请联系管理员!");
}
});
}
}
},
//此处添加错误处理
error: function () {
alert("后台访问错误,请联系管理员!");
}
});
}
}

View File

@@ -0,0 +1,107 @@
/*!
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* @author ThinkGem
* @version 2019-2-16
*/
.register-page {
background: #e3e7ec
}
.register-page .register-box {
width: auto
}
.register-page .register-logo a {
color: #666
}
.register-page .register-logo small {
font-size: 16px
}
.register-page .register-box-body {
width: 360px;
margin: auto;
padding: 28px;
background: #fff;
box-shadow: 0 2px 6px #999;
border-radius: 5px
}
.register-page .register-box-body .form-control-feedback {
cursor: pointer;
pointer-events: auto
}
.register-page .form-group {
margin-top: 5px;
margin-bottom: 23px
}
.register-page .has-feedback .form-control {
height: 34px;
padding: 4px 10px
}
.register-page .input-group-btn .btn {
height: 34px
}
.register-page .btn {
padding: 5px 10px 4px 10px;
font-size: 15px
}
.register-page .select2-container .select2-selection--single {
padding: 6px 12px;
height: 34px
}
.register-page .select2-container--default.select2-container--focus .select2-selection--single {
border-color: #3c8dbc
}
.register-page .select2-container .select2-selection--single .select2-selection__rendered {
margin-top: -4px
}
.register-page .select2-container .select2-selection--single .select2-selection__arrow {
top: 1px
}
.register-page .select2-search--dropdown .select2-search__field {
padding: 4px
}
.register-page .select2-results__option {
padding: 6px 12px
}
.register-page .register-copyright {
text-align: center;
margin-top: 20px
}
.register-page .register-copyright, .register-page .register-copyright a {
color: #666
}
#validCode {
width: 146px;
height:33px;
}
#imgCaptcha{
width:85px;
height:30px;
padding:1px;
line-height:22px;
border:none;
left: 0px;
top: 0px;
}
.input-group-addon.p0 {
width:90px;
border-radius: 0px;
}

View File

@@ -0,0 +1,22 @@
//判断是否存在session如果不存在就跳到登录界面
$.ajax({
type: "get",
url: "/user/getUserSession",
dataType: "json",
async: false,
success: function (res) {
if(res && res.code === 200) {
if(res.data.user) {
var user = res.data.user;
sessionStorage.setItem("userId", user.id);
if (user.username) {
$(".main-header .user-menu .hidden-xs,.main-sidebar .info p").text(user.username);
} else {
top.location.href = '/login.html';
}
} else {
top.location.href = '/login.html';
}
}
}
});