fixed:完善login.html
parent
a2b1923ec5
commit
e18b311001
104
css/okadmin.css
104
css/okadmin.css
|
|
@ -3,13 +3,14 @@
|
||||||
@import "../lib/fonts/myfont.css";
|
@import "../lib/fonts/myfont.css";
|
||||||
@import "../lib/nprogress/nprogress.css";
|
@import "../lib/nprogress/nprogress.css";
|
||||||
|
|
||||||
#navBar .layui-nav-child{
|
#navBar .layui-nav-child {
|
||||||
/*transition: height .5s;*/
|
/*transition: height .5s;*/
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 5px 0!important;
|
padding: 5px 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#navBar .layui-nav-itemed .layui-nav-child,
|
#navBar .layui-nav-itemed .layui-nav-child,
|
||||||
#navBar .layui-nav-child dd{
|
#navBar .layui-nav-child dd {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -17,16 +18,19 @@
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**不显示滚动条样式*/
|
/**不显示滚动条样式*/
|
||||||
.not-scroll::-webkit-scrollbar{
|
.not-scroll::-webkit-scrollbar {
|
||||||
height: 0;
|
height: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.scrollBody::-webkit-scrollbar{
|
|
||||||
|
.scrollBody::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**去掉after**/
|
/**去掉after**/
|
||||||
.no-line.layui-this:after {
|
.no-line.layui-this:after {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
|
|
@ -476,20 +480,23 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*中国天气样式*/
|
/*中国天气样式*/
|
||||||
.weather-ok{
|
.weather-ok {
|
||||||
height: 49px;
|
height: 49px;
|
||||||
line-height: 49px;
|
line-height: 49px;
|
||||||
}
|
}
|
||||||
.weather-ok .iframe-style{
|
|
||||||
|
.weather-ok .iframe-style {
|
||||||
/*height: 415px;*/
|
/*height: 415px;*/
|
||||||
/*height: 375px;*/
|
/*height: 375px;*/
|
||||||
height: 50px;
|
height: 50px;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.weather-ok .iframe-style:hover{
|
|
||||||
|
.weather-ok .iframe-style:hover {
|
||||||
height: 380px;
|
height: 380px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*主体内容样式*/
|
/*主体内容样式*/
|
||||||
.okadmin .content-body {
|
.okadmin .content-body {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
@ -500,6 +507,7 @@
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
.okadmin .content-body:after {
|
.okadmin .content-body:after {
|
||||||
content: "";
|
content: "";
|
||||||
max-height: 1px;
|
max-height: 1px;
|
||||||
|
|
@ -528,10 +536,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*主体内容选项卡内容样式*/
|
/*主体内容选项卡内容样式*/
|
||||||
.content-body .layui-tab{
|
.content-body .layui-tab {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
/*position: relative;*/
|
/*position: relative;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.okadmin .content-body .layui-tab-content {
|
.okadmin .content-body .layui-tab-content {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 40px;
|
top: 40px;
|
||||||
|
|
@ -621,27 +630,50 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********登录页的样式**********/
|
/**********登录页的样式**********/
|
||||||
.page-fill{
|
.page-fill {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
#login .layui-icon{ font-size:16px !important;}
|
|
||||||
#login .mag0{ margin:0 !important; }
|
#login .layui-icon {
|
||||||
#login ::selection { background: #ff5722; color: #fff; }
|
font-size: 16px !important;
|
||||||
#login .layui-red{ color:#f00 !important; font-weight:bold;}
|
}
|
||||||
#login .layui-blue{ color:#01AAED !important;}
|
|
||||||
#login .layui-form-item.layui-input-focus input{ border-color:#ff6700 !important;}
|
#login .mag0 {
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#login ::selection {
|
||||||
|
background: #ff5722;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#login .layui-red {
|
||||||
|
color: #f00 !important;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#login .layui-blue {
|
||||||
|
color: #01AAED !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#login .layui-form-item.layui-input-focus input {
|
||||||
|
border-color: #ff6700 !important;
|
||||||
|
}
|
||||||
|
|
||||||
#login .layui-block {
|
#login .layui-block {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#login {
|
#login {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-image: url('../images/login-bg.jpg');
|
background-image: url('../images/login-bg.jpg');
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
#login form.layui-form {
|
#login form.layui-form {
|
||||||
padding: 0 20px 20px 20px;
|
padding: 0 20px 20px 20px;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
|
|
@ -692,9 +724,11 @@
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
}
|
}
|
||||||
#login #code{
|
|
||||||
|
#login #code {
|
||||||
padding-right: 110px;
|
padding-right: 110px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#login #imgCode .img {
|
#login #imgCode .img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 1px;
|
top: 1px;
|
||||||
|
|
@ -704,29 +738,35 @@
|
||||||
width: 100px;
|
width: 100px;
|
||||||
background: #C4E1CE;
|
background: #C4E1CE;
|
||||||
}
|
}
|
||||||
#login .layui-form-item input{
|
|
||||||
background: #FFF!important;
|
#login .layui-form-item input {
|
||||||
|
background: #FFF !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#login .layui-form-item input,
|
#login .layui-form-item input,
|
||||||
#login .layui-form-item label{
|
#login .layui-form-item label {
|
||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
-webkit-transition: all 0.3s ease-in-out;
|
-webkit-transition: all 0.3s ease-in-out;
|
||||||
}
|
}
|
||||||
#login .layui-form-item input::placeholder{
|
|
||||||
color: transparent!important;
|
#login .layui-form-item input::placeholder {
|
||||||
|
color: transparent !important;
|
||||||
}
|
}
|
||||||
#login .layui-form-item.layui-input-focus input::placeholder{
|
|
||||||
color: #757575!important;
|
#login .layui-form-item.layui-input-focus input::placeholder {
|
||||||
|
color: #757575 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#login .layui-form-item.layui-input-focus label,
|
#login .layui-form-item.layui-input-focus label,
|
||||||
#login .layui-form-item.layui-input-active label{
|
#login .layui-form-item.layui-input-active label {
|
||||||
top: -10px;
|
top: -10px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #ff6700;
|
color: #ff6700;
|
||||||
background: #fff!important;
|
background: #fff !important;
|
||||||
}
|
}
|
||||||
#login #codeImg canvas{
|
|
||||||
cursor:pointer;
|
#login #codeImg canvas {
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -755,9 +795,11 @@
|
||||||
background: rgba(0, 0, 0, .5);
|
background: rgba(0, 0, 0, .5);
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@media screen and (max-width: 970px) {/*当屏幕宽度小于970时执行*/
|
|
||||||
.ok-hide-md{
|
@media screen and (max-width: 970px) {
|
||||||
display: none!important;
|
/*当屏幕宽度小于970时执行*/
|
||||||
|
.ok-hide-md {
|
||||||
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
layui.define(["jquery"], function (exprots) {
|
layui.define(["jquery"], function (exprots) {
|
||||||
var $ = layui.jquery;
|
var $ = layui.jquery;
|
||||||
|
|
||||||
function GVerify(options) { //创建一个图形验证码对象,接收options对象为参数
|
function GVerify(options) {
|
||||||
this.options = { //默认options参数值
|
this.options = {
|
||||||
id: "", //容器Id
|
id: "",
|
||||||
canvasId: "verifyCanvas", //canvas的ID
|
canvasId: "verifyCanvas",
|
||||||
width: "100", //默认canvas宽度
|
width: "100",
|
||||||
height: "30", //默认canvas高度
|
height: "30",
|
||||||
type: "blend", //图形验证码默认类型blend:数字字母混合类型、number:纯数字、letter:纯字母
|
type: "blend",
|
||||||
code: ""
|
code: ""
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Object.prototype.toString.call(options) == "[object Object]") {//判断传入参数类型
|
if (Object.prototype.toString.call(options) == "[object Object]") {
|
||||||
for (var i in options) { //根据传入的参数,修改默认参数值
|
for (var i in options) {
|
||||||
this.options[i] = options[i];
|
this.options[i] = options[i];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -27,13 +27,10 @@ layui.define(["jquery"], function (exprots) {
|
||||||
}
|
}
|
||||||
|
|
||||||
GVerify.prototype = {
|
GVerify.prototype = {
|
||||||
/**版本号**/
|
|
||||||
version: '1.0.0',
|
version: '1.0.0',
|
||||||
|
|
||||||
/**初始化方法**/
|
|
||||||
_init: function () {
|
_init: function () {
|
||||||
var con = $(this.options.id);
|
var con = $(this.options.id);
|
||||||
// console.log(con);
|
|
||||||
var canvas = document.createElement("canvas");
|
var canvas = document.createElement("canvas");
|
||||||
this.options.width = con.outerWidth() > 0 ? con.outerWidth() : "100";
|
this.options.width = con.outerWidth() > 0 ? con.outerWidth() : "100";
|
||||||
this.options.height = con.outerHeight() > 0 ? con.outerHeight() : "30";
|
this.options.height = con.outerHeight() > 0 ? con.outerHeight() : "30";
|
||||||
|
|
@ -50,7 +47,6 @@ layui.define(["jquery"], function (exprots) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**生成验证码**/
|
|
||||||
refresh: function () {
|
refresh: function () {
|
||||||
this.options.code = "";
|
this.options.code = "";
|
||||||
var canvas = document.getElementById(this.options.canvasId);
|
var canvas = document.getElementById(this.options.canvasId);
|
||||||
|
|
@ -65,7 +61,7 @@ layui.define(["jquery"], function (exprots) {
|
||||||
ctx.fillStyle = randomColor(180, 240);
|
ctx.fillStyle = randomColor(180, 240);
|
||||||
ctx.fillRect(0, 0, this.options.width, this.options.height);
|
ctx.fillRect(0, 0, this.options.width, this.options.height);
|
||||||
|
|
||||||
if (this.options.type == "blend") { //判断验证码类型
|
if (this.options.type == "blend") {
|
||||||
var txtArr = this.options.numArr.concat(this.options.letterArr);
|
var txtArr = this.options.numArr.concat(this.options.letterArr);
|
||||||
} else if (this.options.type == "number") {
|
} else if (this.options.type == "number") {
|
||||||
var txtArr = this.options.numArr;
|
var txtArr = this.options.numArr;
|
||||||
|
|
@ -76,8 +72,8 @@ layui.define(["jquery"], function (exprots) {
|
||||||
for (var i = 1; i <= 4; i++) {
|
for (var i = 1; i <= 4; i++) {
|
||||||
var txt = txtArr[randomNum(0, txtArr.length)];
|
var txt = txtArr[randomNum(0, txtArr.length)];
|
||||||
this.options.code += txt;
|
this.options.code += txt;
|
||||||
ctx.font = randomNum(this.options.height / 2, this.options.height) + 'px SimHei'; //随机生成字体大小
|
ctx.font = randomNum(this.options.height / 2, this.options.height) + 'px SimHei';
|
||||||
ctx.fillStyle = randomColor(50, 160); //随机生成字体颜色
|
ctx.fillStyle = randomColor(50, 160);
|
||||||
ctx.shadowOffsetX = randomNum(-3, 3);
|
ctx.shadowOffsetX = randomNum(-3, 3);
|
||||||
ctx.shadowOffsetY = randomNum(-3, 3);
|
ctx.shadowOffsetY = randomNum(-3, 3);
|
||||||
ctx.shadowBlur = randomNum(-3, 3);
|
ctx.shadowBlur = randomNum(-3, 3);
|
||||||
|
|
@ -85,15 +81,12 @@ layui.define(["jquery"], function (exprots) {
|
||||||
var x = this.options.width / 5 * i;
|
var x = this.options.width / 5 * i;
|
||||||
var y = this.options.height / 2;
|
var y = this.options.height / 2;
|
||||||
var deg = randomNum(-30, 30);
|
var deg = randomNum(-30, 30);
|
||||||
/**设置旋转角度和坐标原点**/
|
|
||||||
ctx.translate(x, y);
|
ctx.translate(x, y);
|
||||||
ctx.rotate(deg * Math.PI / 180);
|
ctx.rotate(deg * Math.PI / 180);
|
||||||
ctx.fillText(txt, 0, 0);
|
ctx.fillText(txt, 0, 0);
|
||||||
/**恢复旋转角度和坐标原点**/
|
|
||||||
ctx.rotate(-deg * Math.PI / 180);
|
ctx.rotate(-deg * Math.PI / 180);
|
||||||
ctx.translate(-x, -y);
|
ctx.translate(-x, -y);
|
||||||
}
|
}
|
||||||
/**绘制干扰线**/
|
|
||||||
for (var i = 0; i < 4; i++) {
|
for (var i = 0; i < 4; i++) {
|
||||||
ctx.strokeStyle = randomColor(40, 180);
|
ctx.strokeStyle = randomColor(40, 180);
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|
@ -101,7 +94,6 @@ layui.define(["jquery"], function (exprots) {
|
||||||
ctx.lineTo(randomNum(0, this.options.width), randomNum(0, this.options.height));
|
ctx.lineTo(randomNum(0, this.options.width), randomNum(0, this.options.height));
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
}
|
}
|
||||||
/**绘制干扰点**/
|
|
||||||
for (var i = 0; i < this.options.width / 4; i++) {
|
for (var i = 0; i < this.options.width / 4; i++) {
|
||||||
ctx.fillStyle = randomColor(0, 255);
|
ctx.fillStyle = randomColor(0, 255);
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|
@ -110,31 +102,26 @@ layui.define(["jquery"], function (exprots) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**验证验证码**/
|
|
||||||
validate: function (code) {
|
validate: function (code) {
|
||||||
var code = code.toLowerCase();
|
var code = code.toLowerCase();
|
||||||
var v_code = this.options.code.toLowerCase();
|
var v_code = this.options.code.toLowerCase();
|
||||||
if (code == v_code) {
|
if (code == v_code) {
|
||||||
return "true";
|
return "true";
|
||||||
} else {
|
} else {
|
||||||
// this.refresh();
|
|
||||||
return "验证码不正确,请重新输入";
|
return "验证码不正确,请重新输入";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**生成字母数组**/
|
|
||||||
function getAllLetter() {
|
function getAllLetter() {
|
||||||
var letterStr = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
|
var letterStr = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
|
||||||
return letterStr.split(",");
|
return letterStr.split(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**生成一个随机数**/
|
|
||||||
function randomNum(min, max) {
|
function randomNum(min, max) {
|
||||||
return Math.floor(Math.random() * (max - min) + min);
|
return Math.floor(Math.random() * (max - min) + min);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**生成一个随机色**/
|
|
||||||
function randomColor(min, max) {
|
function randomColor(min, max) {
|
||||||
var r = randomNum(min, max);
|
var r = randomNum(min, max);
|
||||||
var g = randomNum(min, max);
|
var g = randomNum(min, max);
|
||||||
|
|
@ -143,6 +130,5 @@ layui.define(["jquery"], function (exprots) {
|
||||||
}
|
}
|
||||||
|
|
||||||
exprots("okGVerify", GVerify);
|
exprots("okGVerify", GVerify);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
"use strict";
|
||||||
|
layui.define([], function(exprots) {
|
||||||
|
var okMock = {
|
||||||
|
api: {
|
||||||
|
login: "https://www.easy-mock.com/mock/5d5d0dd46cfcbd1b8627bf1d/ok-admin-v2.0/login",
|
||||||
|
menu: {
|
||||||
|
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/menu/list"
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/list",
|
||||||
|
batchNormal: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/batchNormal",
|
||||||
|
batchStop: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/batchStop",
|
||||||
|
batchDel: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/batchDel",
|
||||||
|
add: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/add",
|
||||||
|
edit: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/edit"
|
||||||
|
},
|
||||||
|
role: {
|
||||||
|
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/role/list"
|
||||||
|
},
|
||||||
|
permission: {
|
||||||
|
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/permission/list"
|
||||||
|
},
|
||||||
|
article: {
|
||||||
|
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/article/list"
|
||||||
|
},
|
||||||
|
log: {
|
||||||
|
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/log/list"
|
||||||
|
},
|
||||||
|
message: {
|
||||||
|
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/message/list"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exprots("okMock", okMock);
|
||||||
|
});
|
||||||
|
|
@ -2,9 +2,13 @@
|
||||||
layui.define(["layer"], function(exprots) {
|
layui.define(["layer"], function(exprots) {
|
||||||
var $ = layui.jquery;
|
var $ = layui.jquery;
|
||||||
var okUtils = {
|
var okUtils = {
|
||||||
// 是否前后端分离
|
/**
|
||||||
|
* 是否前后端分离
|
||||||
|
*/
|
||||||
isFrontendBackendSeparate: false,
|
isFrontendBackendSeparate: false,
|
||||||
// 服务器地址
|
/**
|
||||||
|
* 服务器地址
|
||||||
|
*/
|
||||||
baseUrl: "http://localhost:8080",
|
baseUrl: "http://localhost:8080",
|
||||||
/**
|
/**
|
||||||
* 获取body的总宽度
|
* 获取body的总宽度
|
||||||
|
|
@ -47,7 +51,7 @@ layui.define(["layer"], function(exprots) {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.status == 1000) {
|
if (data.status == 1000) {
|
||||||
// 业务正常
|
// 业务正常
|
||||||
deferred.resolve(data.data)
|
deferred.resolve(data)
|
||||||
} else {
|
} else {
|
||||||
// 业务异常
|
// 业务异常
|
||||||
layer.msg(data.msg, {icon: 7, time: 2000});
|
layer.msg(data.msg, {icon: 7, time: 2000});
|
||||||
|
|
@ -94,35 +98,6 @@ layui.define(["layer"], function(exprots) {
|
||||||
$(".layui-laypage-btn")[0].click();
|
$(".layui-laypage-btn")[0].click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mockApi: {
|
|
||||||
login: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/login",
|
|
||||||
menu: {
|
|
||||||
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/menu/list"
|
|
||||||
},
|
|
||||||
user: {
|
|
||||||
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/list",
|
|
||||||
batchNormal: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/batchNormal",
|
|
||||||
batchStop: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/batchStop",
|
|
||||||
batchDel: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/batchDel",
|
|
||||||
add: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/add",
|
|
||||||
edit: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/edit"
|
|
||||||
},
|
|
||||||
role: {
|
|
||||||
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/role/list"
|
|
||||||
},
|
|
||||||
permission: {
|
|
||||||
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/permission/list"
|
|
||||||
},
|
|
||||||
article: {
|
|
||||||
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/article/list"
|
|
||||||
},
|
|
||||||
log: {
|
|
||||||
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/log/list"
|
|
||||||
},
|
|
||||||
message: {
|
|
||||||
list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/message/list"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
exprots("okUtils", okUtils);
|
exprots("okUtils", okUtils);
|
||||||
|
|
|
||||||
|
|
@ -1,224 +1,225 @@
|
||||||
/** layui-v2.5.4 MIT License By https://www.layui.com */
|
/** layui-v2.5.4 MIT License By https://www.layui.com */
|
||||||
if (!Object.assign) {
|
if (!Object.assign) {
|
||||||
Object.defineProperty(Object, "assign", {
|
Object.defineProperty(Object, "assign", {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function(target, firstSource) {
|
value: function (target, firstSource) {
|
||||||
"use strict";
|
"use strict";
|
||||||
if (target === undefined || target === null)
|
if (target === undefined || target === null)
|
||||||
throw new TypeError("Cannot convert first argument to object");
|
throw new TypeError("Cannot convert first argument to object");
|
||||||
var to = Object(target);
|
var to = Object(target);
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
for (var i = 1; i < arguments.length; i++) {
|
||||||
var nextSource = arguments[i];
|
var nextSource = arguments[i];
|
||||||
if (nextSource === undefined || nextSource === null) continue;
|
if (nextSource === undefined || nextSource === null) continue;
|
||||||
var keysArray = Object.keys(Object(nextSource));
|
var keysArray = Object.keys(Object(nextSource));
|
||||||
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
|
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
|
||||||
var nextKey = keysArray[nextIndex];
|
var nextKey = keysArray[nextIndex];
|
||||||
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
||||||
if (desc !== undefined && desc.enumerable) to[nextKey] = nextSource[nextKey];
|
if (desc !== undefined && desc.enumerable) to[nextKey] = nextSource[nextKey];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return to;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
return to;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
!function (e) {
|
!function (e) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var okmodules = {
|
var okmodules = {
|
||||||
"okTab": "okmodules/okTab",
|
"okTab": "okmodules/okTab",
|
||||||
"countUp": "okmodules/countUp",
|
"countUp": "okmodules/countUp",
|
||||||
"okUtils": "okmodules/okUtils",
|
"okUtils": "okmodules/okUtils",
|
||||||
"okGVerify": "okmodules/okGVerify",
|
"okGVerify": "okmodules/okGVerify",
|
||||||
"qrcode": "okmodules/qrcode",
|
"qrcode": "okmodules/qrcode",
|
||||||
"jQqrcode": "okmodules/jQqrcode",
|
"jQqrcode": "okmodules/jQqrcode",
|
||||||
"okAddlink": "okmodules/okAddlink",
|
"okAddlink": "okmodules/okAddlink",
|
||||||
"okLayer": "okmodules/okLayer",
|
"okLayer": "okmodules/okLayer",
|
||||||
};
|
"okMock": "okmodules/okMock",
|
||||||
var modulePath=Object.assign({
|
};
|
||||||
layer: "modules/layer",
|
var modulePath = Object.assign({
|
||||||
laydate: "modules/laydate",
|
layer: "modules/layer",
|
||||||
laypage: "modules/laypage",
|
laydate: "modules/laydate",
|
||||||
laytpl: "modules/laytpl",
|
laypage: "modules/laypage",
|
||||||
layim: "modules/layim",
|
laytpl: "modules/laytpl",
|
||||||
layedit: "modules/layedit",
|
layim: "modules/layim",
|
||||||
form: "modules/form",
|
layedit: "modules/layedit",
|
||||||
upload: "modules/upload",
|
form: "modules/form",
|
||||||
transfer: "modules/transfer",
|
upload: "modules/upload",
|
||||||
tree: "modules/tree",
|
transfer: "modules/transfer",
|
||||||
table: "modules/table",
|
tree: "modules/tree",
|
||||||
element: "modules/element",
|
table: "modules/table",
|
||||||
rate: "modules/rate",
|
element: "modules/element",
|
||||||
colorpicker: "modules/colorpicker",
|
rate: "modules/rate",
|
||||||
slider: "modules/slider",
|
colorpicker: "modules/colorpicker",
|
||||||
carousel: "modules/carousel",
|
slider: "modules/slider",
|
||||||
flow: "modules/flow",
|
carousel: "modules/carousel",
|
||||||
util: "modules/util",
|
flow: "modules/flow",
|
||||||
code: "modules/code",
|
util: "modules/util",
|
||||||
jquery: "modules/jquery",
|
code: "modules/code",
|
||||||
mobile: "modules/mobile",
|
jquery: "modules/jquery",
|
||||||
"layui.all": "../layui.all"
|
mobile: "modules/mobile",
|
||||||
},okmodules);
|
"layui.all": "../layui.all"
|
||||||
|
}, okmodules);
|
||||||
|
|
||||||
var t = document, o = {modules: {}, status: {}, timeout: 10, event: {}}, n = function () {
|
var t = document, o = {modules: {}, status: {}, timeout: 10, event: {}}, n = function () {
|
||||||
this.v = "2.5.4"
|
this.v = "2.5.4"
|
||||||
}, r = function () {
|
}, r = function () {
|
||||||
var e = t.currentScript ? t.currentScript.src : function () {
|
var e = t.currentScript ? t.currentScript.src : function () {
|
||||||
for (var e, o = t.scripts, n = o.length - 1, r = n; r > 0; r--) if ("interactive" === o[r].readyState) {
|
for (var e, o = t.scripts, n = o.length - 1, r = n; r > 0; r--) if ("interactive" === o[r].readyState) {
|
||||||
e = o[r].src;
|
e = o[r].src;
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return e || o[n].src
|
return e || o[n].src
|
||||||
}();
|
}();
|
||||||
return e.substring(0, e.lastIndexOf("/") + 1)
|
return e.substring(0, e.lastIndexOf("/") + 1)
|
||||||
}(), i = function (t) {
|
}(), i = function (t) {
|
||||||
e.console && console.error && console.error("Layui hint: " + t)
|
e.console && console.error && console.error("Layui hint: " + t)
|
||||||
}, a = "undefined" != typeof opera && "[object Opera]" === opera.toString(), u = modulePath;
|
}, a = "undefined" != typeof opera && "[object Opera]" === opera.toString(), u = modulePath;
|
||||||
n.prototype.cache = o, n.prototype.define = function (e, t) {
|
n.prototype.cache = o, n.prototype.define = function (e, t) {
|
||||||
var n = this, r = "function" == typeof e, i = function () {
|
var n = this, r = "function" == typeof e, i = function () {
|
||||||
var e = function (e, t) {
|
var e = function (e, t) {
|
||||||
layui[e] = t, o.status[e] = !0
|
layui[e] = t, o.status[e] = !0
|
||||||
};
|
};
|
||||||
return "function" == typeof t && t(function (n, r) {
|
return "function" == typeof t && t(function (n, r) {
|
||||||
e(n, r), o.callback[n] = function () {
|
e(n, r), o.callback[n] = function () {
|
||||||
t(e)
|
t(e)
|
||||||
|
}
|
||||||
|
}), this
|
||||||
|
};
|
||||||
|
return r && (t = e, e = []), !layui["layui.all"] && layui["layui.mobile"] ? i.call(n) : (n.use(e, i), n)
|
||||||
|
}, n.prototype.use = function (e, n, l) {
|
||||||
|
function s(e, t) {
|
||||||
|
var n = "PLaySTATION 3" === navigator.platform ? /^complete$/ : /^(complete|loaded)$/;
|
||||||
|
("load" === e.type || n.test((e.currentTarget || e.srcElement).readyState)) && (o.modules[f] = t, d.removeChild(v), function r() {
|
||||||
|
return ++m > 1e3 * o.timeout / 4 ? i(f + " is not a valid module") : void (o.status[f] ? c() : setTimeout(r, 4))
|
||||||
|
}())
|
||||||
}
|
}
|
||||||
}), this
|
|
||||||
};
|
|
||||||
return r && (t = e, e = []), !layui["layui.all"] && layui["layui.mobile"] ? i.call(n) : (n.use(e, i), n)
|
|
||||||
}, n.prototype.use = function (e, n, l) {
|
|
||||||
function s(e, t) {
|
|
||||||
var n = "PLaySTATION 3" === navigator.platform ? /^complete$/ : /^(complete|loaded)$/;
|
|
||||||
("load" === e.type || n.test((e.currentTarget || e.srcElement).readyState)) && (o.modules[f] = t, d.removeChild(v), function r() {
|
|
||||||
return ++m > 1e3 * o.timeout / 4 ? i(f + " is not a valid module") : void (o.status[f] ? c() : setTimeout(r, 4))
|
|
||||||
}())
|
|
||||||
}
|
|
||||||
|
|
||||||
function c() {
|
function c() {
|
||||||
l.push(layui[f]), e.length > 1 ? y.use(e.slice(1), n, l) : "function" == typeof n && n.apply(layui, l)
|
l.push(layui[f]), e.length > 1 ? y.use(e.slice(1), n, l) : "function" == typeof n && n.apply(layui, l)
|
||||||
}
|
}
|
||||||
|
|
||||||
var y = this, p = o.dir = o.dir ? o.dir : r, d = t.getElementsByTagName("head")[0];
|
var y = this, p = o.dir = o.dir ? o.dir : r, d = t.getElementsByTagName("head")[0];
|
||||||
e = "string" == typeof e ? [e] : e, window.jQuery && jQuery.fn.on && (y.each(e, function (t, o) {
|
e = "string" == typeof e ? [e] : e, window.jQuery && jQuery.fn.on && (y.each(e, function (t, o) {
|
||||||
"jquery" === o && e.splice(t, 1)
|
"jquery" === o && e.splice(t, 1)
|
||||||
}), layui.jquery = layui.$ = jQuery);
|
}), layui.jquery = layui.$ = jQuery);
|
||||||
var f = e[0], m = 0;
|
var f = e[0], m = 0;
|
||||||
if (l = l || [], o.host = o.host || (p.match(/\/\/([\s\S]+?)\//) || ["//" + location.host + "/"])[0], 0 === e.length || layui["layui.all"] && u[f] || !layui["layui.all"] && layui["layui.mobile"] && u[f]) return c(), y;
|
if (l = l || [], o.host = o.host || (p.match(/\/\/([\s\S]+?)\//) || ["//" + location.host + "/"])[0], 0 === e.length || layui["layui.all"] && u[f] || !layui["layui.all"] && layui["layui.mobile"] && u[f]) return c(), y;
|
||||||
if (o.modules[f]) !function g() {
|
if (o.modules[f]) !function g() {
|
||||||
return ++m > 1e3 * o.timeout / 4 ? i(f + " is not a valid module") : void ("string" == typeof o.modules[f] && o.status[f] ? c() : setTimeout(g, 4))
|
return ++m > 1e3 * o.timeout / 4 ? i(f + " is not a valid module") : void ("string" == typeof o.modules[f] && o.status[f] ? c() : setTimeout(g, 4))
|
||||||
}(); else {
|
}(); else {
|
||||||
var v = t.createElement("script"),
|
var v = t.createElement("script"),
|
||||||
h = (u[f] ? p + "lay/" : /^\{\/\}/.test(y.modules[f]) ? "" : o.base || "") + (y.modules[f] || f) + ".js";
|
h = (u[f] ? p + "lay/" : /^\{\/\}/.test(y.modules[f]) ? "" : o.base || "") + (y.modules[f] || f) + ".js";
|
||||||
h = h.replace(/^\{\/\}/, ""), v.async = !0, v.charset = "utf-8", v.src = h + function () {
|
h = h.replace(/^\{\/\}/, ""), v.async = !0, v.charset = "utf-8", v.src = h + function () {
|
||||||
var e = o.version === !0 ? o.v || (new Date).getTime() : o.version || "";
|
var e = o.version === !0 ? o.v || (new Date).getTime() : o.version || "";
|
||||||
return e ? "?v=" + e : ""
|
return e ? "?v=" + e : ""
|
||||||
}(), d.appendChild(v), !v.attachEvent || v.attachEvent.toString && v.attachEvent.toString().indexOf("[native code") < 0 || a ? v.addEventListener("load", function (e) {
|
}(), d.appendChild(v), !v.attachEvent || v.attachEvent.toString && v.attachEvent.toString().indexOf("[native code") < 0 || a ? v.addEventListener("load", function (e) {
|
||||||
s(e, h)
|
s(e, h)
|
||||||
}, !1) : v.attachEvent("onreadystatechange", function (e) {
|
}, !1) : v.attachEvent("onreadystatechange", function (e) {
|
||||||
s(e, h)
|
s(e, h)
|
||||||
}), o.modules[f] = h
|
}), o.modules[f] = h
|
||||||
}
|
}
|
||||||
return y
|
return y
|
||||||
}, n.prototype.getStyle = function (t, o) {
|
}, n.prototype.getStyle = function (t, o) {
|
||||||
var n = t.currentStyle ? t.currentStyle : e.getComputedStyle(t, null);
|
var n = t.currentStyle ? t.currentStyle : e.getComputedStyle(t, null);
|
||||||
return n[n.getPropertyValue ? "getPropertyValue" : "getAttribute"](o)
|
return n[n.getPropertyValue ? "getPropertyValue" : "getAttribute"](o)
|
||||||
}, n.prototype.link = function (e, n, r) {
|
}, n.prototype.link = function (e, n, r) {
|
||||||
var a = this, u = t.createElement("link"), l = t.getElementsByTagName("head")[0];
|
var a = this, u = t.createElement("link"), l = t.getElementsByTagName("head")[0];
|
||||||
"string" == typeof n && (r = n);
|
"string" == typeof n && (r = n);
|
||||||
var s = (r || e).replace(/\.|\//g, ""), c = u.id = "layuicss-" + s, y = 0;
|
var s = (r || e).replace(/\.|\//g, ""), c = u.id = "layuicss-" + s, y = 0;
|
||||||
return u.rel = "stylesheet", u.href = e + (o.debug ? "?v=" + (new Date).getTime() : ""), u.media = "all", t.getElementById(c) || l.appendChild(u), "function" != typeof n ? a : (function p() {
|
return u.rel = "stylesheet", u.href = e + (o.debug ? "?v=" + (new Date).getTime() : ""), u.media = "all", t.getElementById(c) || l.appendChild(u), "function" != typeof n ? a : (function p() {
|
||||||
return ++y > 1e3 * o.timeout / 100 ? i(e + " timeout") : void (1989 === parseInt(a.getStyle(t.getElementById(c), "width")) ? function () {
|
return ++y > 1e3 * o.timeout / 100 ? i(e + " timeout") : void (1989 === parseInt(a.getStyle(t.getElementById(c), "width")) ? function () {
|
||||||
n()
|
n()
|
||||||
}() : setTimeout(p, 100))
|
}() : setTimeout(p, 100))
|
||||||
}(), a)
|
}(), a)
|
||||||
}, o.callback = {}, n.prototype.factory = function (e) {
|
}, o.callback = {}, n.prototype.factory = function (e) {
|
||||||
if (layui[e]) return "function" == typeof o.callback[e] ? o.callback[e] : null
|
if (layui[e]) return "function" == typeof o.callback[e] ? o.callback[e] : null
|
||||||
}, n.prototype.addcss = function (e, t, n) {
|
}, n.prototype.addcss = function (e, t, n) {
|
||||||
return layui.link(o.dir + "css/" + e, t, n)
|
return layui.link(o.dir + "css/" + e, t, n)
|
||||||
}, n.prototype.img = function (e, t, o) {
|
}, n.prototype.img = function (e, t, o) {
|
||||||
var n = new Image;
|
var n = new Image;
|
||||||
return n.src = e, n.complete ? t(n) : (n.onload = function () {
|
return n.src = e, n.complete ? t(n) : (n.onload = function () {
|
||||||
n.onload = null, "function" == typeof t && t(n)
|
n.onload = null, "function" == typeof t && t(n)
|
||||||
}, void (n.onerror = function (e) {
|
}, void (n.onerror = function (e) {
|
||||||
n.onerror = null, "function" == typeof o && o(e)
|
n.onerror = null, "function" == typeof o && o(e)
|
||||||
}))
|
}))
|
||||||
}, n.prototype.config = function (e) {
|
}, n.prototype.config = function (e) {
|
||||||
e = e || {};
|
e = e || {};
|
||||||
for (var t in e) o[t] = e[t];
|
for (var t in e) o[t] = e[t];
|
||||||
return this
|
return this
|
||||||
}, n.prototype.modules = function () {
|
}, n.prototype.modules = function () {
|
||||||
var e = {};
|
var e = {};
|
||||||
for (var t in u) e[t] = u[t];
|
for (var t in u) e[t] = u[t];
|
||||||
return e
|
return e
|
||||||
}(), n.prototype.extend = function (e) {
|
}(), n.prototype.extend = function (e) {
|
||||||
var t = this;
|
var t = this;
|
||||||
e = e || {};
|
e = e || {};
|
||||||
for (var o in e) t[o] || t.modules[o] ? i("模块名 " + o + " 已被占用") : t.modules[o] = e[o];
|
for (var o in e) t[o] || t.modules[o] ? i("模块名 " + o + " 已被占用") : t.modules[o] = e[o];
|
||||||
return t
|
return t
|
||||||
}, n.prototype.router = function (e) {
|
}, n.prototype.router = function (e) {
|
||||||
var t = this, e = e || location.hash, o = {path: [], search: {}, hash: (e.match(/[^#](#.*$)/) || [])[1] || ""};
|
var t = this, e = e || location.hash, o = {path: [], search: {}, hash: (e.match(/[^#](#.*$)/) || [])[1] || ""};
|
||||||
return /^#\//.test(e) ? (e = e.replace(/^#\//, ""), o.href = "/" + e, e = e.replace(/([^#])(#.*$)/, "$1").split("/") || [], t.each(e, function (e, t) {
|
return /^#\//.test(e) ? (e = e.replace(/^#\//, ""), o.href = "/" + e, e = e.replace(/([^#])(#.*$)/, "$1").split("/") || [], t.each(e, function (e, t) {
|
||||||
/^\w+=/.test(t) ? function () {
|
/^\w+=/.test(t) ? function () {
|
||||||
t = t.split("="), o.search[t[0]] = t[1]
|
t = t.split("="), o.search[t[0]] = t[1]
|
||||||
}() : o.path.push(t)
|
}() : o.path.push(t)
|
||||||
}), o) : o
|
}), o) : o
|
||||||
}, n.prototype.data = function (t, o, n) {
|
}, n.prototype.data = function (t, o, n) {
|
||||||
if (t = t || "layui", n = n || localStorage, e.JSON && e.JSON.parse) {
|
if (t = t || "layui", n = n || localStorage, e.JSON && e.JSON.parse) {
|
||||||
if (null === o) return delete n[t];
|
if (null === o) return delete n[t];
|
||||||
o = "object" == typeof o ? o : {key: o};
|
o = "object" == typeof o ? o : {key: o};
|
||||||
try {
|
try {
|
||||||
var r = JSON.parse(n[t])
|
var r = JSON.parse(n[t])
|
||||||
} catch (i) {
|
} catch (i) {
|
||||||
var r = {}
|
var r = {}
|
||||||
}
|
}
|
||||||
return "value" in o && (r[o.key] = o.value), o.remove && delete r[o.key], n[t] = JSON.stringify(r), o.key ? r[o.key] : r
|
return "value" in o && (r[o.key] = o.value), o.remove && delete r[o.key], n[t] = JSON.stringify(r), o.key ? r[o.key] : r
|
||||||
}
|
}
|
||||||
}, n.prototype.sessionData = function (e, t) {
|
}, n.prototype.sessionData = function (e, t) {
|
||||||
return this.data(e, t, sessionStorage)
|
return this.data(e, t, sessionStorage)
|
||||||
}, n.prototype.device = function (t) {
|
}, n.prototype.device = function (t) {
|
||||||
var o = navigator.userAgent.toLowerCase(), n = function (e) {
|
var o = navigator.userAgent.toLowerCase(), n = function (e) {
|
||||||
var t = new RegExp(e + "/([^\\s\\_\\-]+)");
|
var t = new RegExp(e + "/([^\\s\\_\\-]+)");
|
||||||
return e = (o.match(t) || [])[1], e || !1
|
return e = (o.match(t) || [])[1], e || !1
|
||||||
}, r = {
|
}, r = {
|
||||||
os: function () {
|
os: function () {
|
||||||
return /windows/.test(o) ? "windows" : /linux/.test(o) ? "linux" : /iphone|ipod|ipad|ios/.test(o) ? "ios" : /mac/.test(o) ? "mac" : void 0
|
return /windows/.test(o) ? "windows" : /linux/.test(o) ? "linux" : /iphone|ipod|ipad|ios/.test(o) ? "ios" : /mac/.test(o) ? "mac" : void 0
|
||||||
}(), ie: function () {
|
}(), ie: function () {
|
||||||
return !!(e.ActiveXObject || "ActiveXObject" in e) && ((o.match(/msie\s(\d+)/) || [])[1] || "11")
|
return !!(e.ActiveXObject || "ActiveXObject" in e) && ((o.match(/msie\s(\d+)/) || [])[1] || "11")
|
||||||
}(), weixin: n("micromessenger")
|
}(), weixin: n("micromessenger")
|
||||||
};
|
};
|
||||||
return t && !r[t] && (r[t] = n(t)), r.android = /android/.test(o), r.ios = "ios" === r.os, r
|
return t && !r[t] && (r[t] = n(t)), r.android = /android/.test(o), r.ios = "ios" === r.os, r
|
||||||
}, n.prototype.hint = function () {
|
}, n.prototype.hint = function () {
|
||||||
return {error: i}
|
return {error: i}
|
||||||
}, n.prototype.each = function (e, t) {
|
}, n.prototype.each = function (e, t) {
|
||||||
var o, n = this;
|
var o, n = this;
|
||||||
if ("function" != typeof t) return n;
|
if ("function" != typeof t) return n;
|
||||||
if (e = e || [], e.constructor === Object) {
|
if (e = e || [], e.constructor === Object) {
|
||||||
for (o in e) if (t.call(e[o], o, e[o])) break
|
for (o in e) if (t.call(e[o], o, e[o])) break
|
||||||
} else for (o = 0; o < e.length && !t.call(e[o], o, e[o]); o++) ;
|
} else for (o = 0; o < e.length && !t.call(e[o], o, e[o]); o++) ;
|
||||||
return n
|
return n
|
||||||
}, n.prototype.sort = function (e, t, o) {
|
}, n.prototype.sort = function (e, t, o) {
|
||||||
var n = JSON.parse(JSON.stringify(e || []));
|
var n = JSON.parse(JSON.stringify(e || []));
|
||||||
return t ? (n.sort(function (e, o) {
|
return t ? (n.sort(function (e, o) {
|
||||||
var n = /^-?\d+$/, r = e[t], i = o[t];
|
var n = /^-?\d+$/, r = e[t], i = o[t];
|
||||||
return n.test(r) && (r = parseFloat(r)), n.test(i) && (i = parseFloat(i)), r && !i ? 1 : !r && i ? -1 : r > i ? 1 : r < i ? -1 : 0
|
return n.test(r) && (r = parseFloat(r)), n.test(i) && (i = parseFloat(i)), r && !i ? 1 : !r && i ? -1 : r > i ? 1 : r < i ? -1 : 0
|
||||||
}), o && n.reverse(), n) : n
|
}), o && n.reverse(), n) : n
|
||||||
}, n.prototype.stope = function (t) {
|
}, n.prototype.stope = function (t) {
|
||||||
t = t || e.event;
|
t = t || e.event;
|
||||||
try {
|
try {
|
||||||
t.stopPropagation()
|
t.stopPropagation()
|
||||||
} catch (o) {
|
} catch (o) {
|
||||||
t.cancelBubble = !0
|
t.cancelBubble = !0
|
||||||
}
|
}
|
||||||
}, n.prototype.onevent = function (e, t, o) {
|
}, n.prototype.onevent = function (e, t, o) {
|
||||||
return "string" != typeof e || "function" != typeof o ? this : n.event(e, t, null, o)
|
return "string" != typeof e || "function" != typeof o ? this : n.event(e, t, null, o)
|
||||||
}, n.prototype.event = n.event = function (e, t, n, r) {
|
}, n.prototype.event = n.event = function (e, t, n, r) {
|
||||||
var i = this, a = null, u = t.match(/\((.*)\)$/) || [], l = (e + "." + t).replace(u[0], ""), s = u[1] || "",
|
var i = this, a = null, u = t.match(/\((.*)\)$/) || [], l = (e + "." + t).replace(u[0], ""), s = u[1] || "",
|
||||||
c = function (e, t) {
|
c = function (e, t) {
|
||||||
var o = t && t.call(i, n);
|
var o = t && t.call(i, n);
|
||||||
o === !1 && null === a && (a = !1)
|
o === !1 && null === a && (a = !1)
|
||||||
};
|
};
|
||||||
return r ? (o.event[l] = o.event[l] || {}, o.event[l][s] = [r], this) : (layui.each(o.event[l], function (e, t) {
|
return r ? (o.event[l] = o.event[l] || {}, o.event[l][s] = [r], this) : (layui.each(o.event[l], function (e, t) {
|
||||||
return "{*}" === s ? void layui.each(t, c) : ("" === e && layui.each(t, c), void (s && e === s && layui.each(t, c)))
|
return "{*}" === s ? void layui.each(t, c) : ("" === e && layui.each(t, c), void (s && e === s && layui.each(t, c)))
|
||||||
}), a)
|
}), a)
|
||||||
}, e.layui = new n
|
}, e.layui = new n
|
||||||
}(window);
|
}(window);
|
||||||
|
|
|
||||||
|
|
@ -14,16 +14,16 @@
|
||||||
<form class="layui-form">
|
<form class="layui-form">
|
||||||
<div class="login_face"><img src="../images/logo.png" class="userAvatar"></div>
|
<div class="login_face"><img src="../images/logo.png" class="userAvatar"></div>
|
||||||
<div class="layui-form-item input-item">
|
<div class="layui-form-item input-item">
|
||||||
<label for="userName">用户名</label>
|
<label for="username">用户名</label>
|
||||||
<input type="text" lay-verify="required" name="userName" placeholder="请输入用户名" autocomplete="off" id="userName" class="layui-input">
|
<input type="text" lay-verify="required" name="username" placeholder="请输入账号" autocomplete="off" id="username" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item input-item">
|
<div class="layui-form-item input-item">
|
||||||
<label for="password">密码</label>
|
<label for="password">密码</label>
|
||||||
<input type="password" lay-verify="required|pass" name="password" placeholder="请输入密码" autocomplete="off" id="password" class="layui-input">
|
<input type="password" lay-verify="required|password" name="password" placeholder="请输入密码" autocomplete="off" id="password" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item input-item" id="imgCode">
|
<div class="layui-form-item input-item" id="imgCode">
|
||||||
<label for="code">验证码</label>
|
<label for="captcha">验证码</label>
|
||||||
<input type="text" lay-verify="required|yzmCode" name="code" placeholder="请输入验证码" autocomplete="off" id="code" class="layui-input">
|
<input type="text" lay-verify="required|captcha" name="captcha" placeholder="请输入验证码" autocomplete="off" id="captcha" class="layui-input">
|
||||||
<div class="img ok-none-select" id="codeImg"></div>
|
<div class="img ok-none-select" id="codeImg"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
@ -35,18 +35,19 @@
|
||||||
<!--js逻辑-->
|
<!--js逻辑-->
|
||||||
<script src="../lib/layui/layui.js"></script>
|
<script src="../lib/layui/layui.js"></script>
|
||||||
<script>
|
<script>
|
||||||
layui.use(["form", "jquery", "okGVerify"], function () {
|
layui.use(["form", "okGVerify", "okUtils", "okMock", "okLayer"], function () {
|
||||||
var form = layui.form;
|
var form = layui.form;
|
||||||
var $ = layui.jquery;
|
var $ = layui.jquery;
|
||||||
var okGVerify = layui.okGVerify;
|
var okGVerify = layui.okGVerify;
|
||||||
|
var okUtils = layui.okUtils;
|
||||||
|
var okMock = layui.okMock;
|
||||||
|
var okLayer = layui.okLayer;
|
||||||
|
|
||||||
var verifyCode = new okGVerify("#codeImg");
|
var verifyCode = new okGVerify("#codeImg");
|
||||||
// var res = verifyCode.validate(document.getElementById("code").value);
|
|
||||||
form.verify({
|
form.verify({
|
||||||
pass: [
|
password: [/^[\S]{6,12}$/, '密码必须6到12位,且不能出现空格'],
|
||||||
/^[\S]{6,12}$/,
|
captcha: function (val) {
|
||||||
'密码必须6到12位,且不能出现空格'
|
|
||||||
],
|
|
||||||
yzmCode: function (val) {
|
|
||||||
if (verifyCode.validate(val) != "true") {
|
if (verifyCode.validate(val) != "true") {
|
||||||
return verifyCode.validate(val)
|
return verifyCode.validate(val)
|
||||||
}
|
}
|
||||||
|
|
@ -54,13 +55,17 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
form.on('submit(login)', function (data) {
|
form.on('submit(login)', function (data) {
|
||||||
layer.msg("登陆中...", {icon: 6, time: 1000, anim: 0}, function () {
|
okUtils.ajax(okMock.api.login, "post", data.field).done(function (response) {
|
||||||
window.location = "../index.html";
|
console.log(response)
|
||||||
|
okLayer.msg.greenTick(response.msg, function () {
|
||||||
|
window.location = "../index.html";
|
||||||
|
})
|
||||||
|
}).fail(function (error) {
|
||||||
|
console.log(error)
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//表单输入效果
|
|
||||||
$("#login .input-item .layui-input").click(function (e) {
|
$("#login .input-item .layui-input").click(function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
$(this).addClass("layui-input-focus").find(".layui-input").focus();
|
$(this).addClass("layui-input-focus").find(".layui-input").focus();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue