update
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
body {
|
||||
background: #179898 url(../img/bj.png) repeat;
|
||||
}
|
||||
.login {
|
||||
box-shadow: 0px 0px 15px #ccc;
|
||||
width: 260px;
|
||||
margin-top: 200px;
|
||||
margin: 0 auto;
|
||||
background: #fff;
|
||||
padding: 60px 80px;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -210px;
|
||||
margin-left: -205px;
|
||||
}
|
||||
.login h2 {
|
||||
font-size: 28px;
|
||||
font-weight: 100;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.login .back {
|
||||
float: right;
|
||||
color: #666;
|
||||
}
|
||||
.layui-form-item {
|
||||
position: relative;
|
||||
}
|
||||
.layui-form-item .input-icon {
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 10px;
|
||||
color: #999;
|
||||
}
|
||||
.layui-form-item .layui-input {
|
||||
padding-left: 24px;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
body {
|
||||
background: #179898 url(../img/bj.png) repeat;
|
||||
}
|
||||
.login {
|
||||
box-shadow: 0px 0px 15px #ccc;
|
||||
width: 260px;
|
||||
margin-top: 200px;
|
||||
margin: 0 auto;
|
||||
background: #fff;
|
||||
padding: 60px 80px;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -210px;
|
||||
margin-left: -205px;
|
||||
h2 {
|
||||
font-size: 28px;
|
||||
font-weight: 100;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.back {
|
||||
float: right;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
.layui-form-item {
|
||||
position: relative;
|
||||
.input-icon {
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 10px;
|
||||
color: #999;
|
||||
}
|
||||
.layui-input {
|
||||
padding-left: 24px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
/*layui优化*/
|
||||
table .layui-form-switch {
|
||||
margin-top: 0;
|
||||
}
|
||||
.layui-form-select {
|
||||
z-index: 1000;
|
||||
}
|
||||
.layui-form-item .layui-input-inline,
|
||||
.layui-input-block {
|
||||
width: 500px;
|
||||
}
|
||||
.layui-form-onswitch,
|
||||
.layui-form-checked[lay-skin="primary"] i {
|
||||
border-color: #1aa094;
|
||||
background-color: #1aa094;
|
||||
}
|
||||
/*公共样式*/
|
||||
html,
|
||||
body,
|
||||
#app,
|
||||
.main,
|
||||
.right {
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
background-color: rgba(238, 238, 238, 0.2);
|
||||
}
|
||||
a {
|
||||
color: #1aa094;
|
||||
}
|
||||
a:hover {
|
||||
color: #333;
|
||||
}
|
||||
.cl {
|
||||
zoom: 1;
|
||||
}
|
||||
.cl:after {
|
||||
content: '\20';
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
.l {
|
||||
float: left;
|
||||
}
|
||||
.r {
|
||||
float: right;
|
||||
}
|
||||
.p20 {
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
foo,
|
||||
.foo {
|
||||
color: #f00;
|
||||
}
|
||||
/*滚动条*/
|
||||
::-webkit-scrollbar-corner {
|
||||
background: #1aa094;
|
||||
}
|
||||
::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #1aa094;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:window-inactive {
|
||||
background: #1aa094;
|
||||
}
|
||||
/*右侧滚动条*/
|
||||
.right::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
background-color: #eee;
|
||||
}
|
||||
.right::-webkit-scrollbar-thumb {
|
||||
background: #009688;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.right::-webkit-scrollbar-track-piece {
|
||||
background: transparent;
|
||||
}
|
||||
/*顶栏*/
|
||||
header {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #eee;
|
||||
position: fixed;
|
||||
z-index: 1001;
|
||||
color: #333;
|
||||
}
|
||||
header h1 {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
width: 150px;
|
||||
display: block;
|
||||
color: #fff;
|
||||
float: left;
|
||||
background-color: #404852;
|
||||
text-align: center;
|
||||
font-size: 36px;
|
||||
}
|
||||
header .breadcrumb {
|
||||
margin-left: 150px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
header .breadcrumb i {
|
||||
float: left;
|
||||
}
|
||||
header .breadcrumb ul {
|
||||
float: left;
|
||||
}
|
||||
header .breadcrumb li {
|
||||
float: left;
|
||||
margin: 0 3px;
|
||||
}
|
||||
.main {
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
/*左栏*/
|
||||
.left {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 150px;
|
||||
padding-top: 50px;
|
||||
height: 100%;
|
||||
background: #3c444d;
|
||||
overflow-x: auto;
|
||||
z-index: 100;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.left ul li {
|
||||
float: left;
|
||||
color: #333;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.left ul li.hidden div {
|
||||
display: none;
|
||||
}
|
||||
.left ul li.hidden i.arrow {
|
||||
transform: rotate(180deg);
|
||||
-ms-transform: rotate(180deg);
|
||||
-moz-transform: rotate(180deg);
|
||||
-webkit-transform: rotate(180deg);
|
||||
-o-transform: rotate(180deg);
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
.left ul li a {
|
||||
color: #ececec;
|
||||
padding: 10px 0 10px 20px;
|
||||
display: block;
|
||||
}
|
||||
.left ul li i:first-child {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.left ul li i.arrow {
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
font-size: 12px;
|
||||
padding-top: 4px;
|
||||
}
|
||||
.left ul li i.active {
|
||||
color: #eee;
|
||||
position: absolute;
|
||||
right: -6px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
top: 0px;
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
z-index: 1;
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
.left ul li > div {
|
||||
position: relative;
|
||||
background-color: #404852;
|
||||
}
|
||||
.left ul li > div a {
|
||||
padding-left: 45px;
|
||||
color: #b2b2b2;
|
||||
}
|
||||
.left ul li a:hover,
|
||||
.left ul li a.active {
|
||||
color: #009688;
|
||||
background: #28313c;
|
||||
}
|
||||
/*右侧*/
|
||||
.right {
|
||||
margin-left: 150px;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
padding-top: 70px;
|
||||
}
|
||||
.right iframe {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-left: 150px;
|
||||
padding-top: 50px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.right > a > i {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.right .arz {
|
||||
margin: 20px 0 0 30px;
|
||||
}
|
||||
.right .arz a {
|
||||
color: #fff;
|
||||
padding: 10px 18px;
|
||||
background: #009688;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.right .arz a i {
|
||||
position: relative;
|
||||
right: 3px;
|
||||
top: 1px;
|
||||
}
|
||||
.right .arz a:hover {
|
||||
opacity: 0.8;
|
||||
filter: alpha(opacity=80);
|
||||
color: #fff;
|
||||
}
|
||||
.bform {
|
||||
margin: 20px 30px 0 10px;
|
||||
}
|
||||
/*分页*/
|
||||
.page {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.page li {
|
||||
float: left;
|
||||
}
|
||||
.page li a,
|
||||
.page li span {
|
||||
padding: 5px 10px;
|
||||
background-color: #009688;
|
||||
color: #fff;
|
||||
margin-right: 5px;
|
||||
display: block;
|
||||
}
|
||||
.page li a:hover,
|
||||
.page li span {
|
||||
background-color: #999;
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
/*layui优化*/
|
||||
table {
|
||||
.layui-form-switch {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
.layui-form-select {
|
||||
z-index: 1000;
|
||||
}
|
||||
.layui-form-item .layui-input-inline,
|
||||
.layui-input-block {
|
||||
width: 500px;
|
||||
}
|
||||
.layui-form-onswitch,
|
||||
.layui-form-checked[lay-skin="primary"] i {
|
||||
border-color: #1aa094;
|
||||
background-color: #1aa094;
|
||||
}
|
||||
/*公共样式*/
|
||||
html,body,#app,.main,.right {
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
background-color: rgba(238, 238, 238, 0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
a {
|
||||
color: #1aa094;
|
||||
&:hover {
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.cl {
|
||||
zoom: 1;
|
||||
&:after {
|
||||
content: '\20';
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
.l {
|
||||
float: left;
|
||||
}
|
||||
.r {
|
||||
float: right;
|
||||
}
|
||||
.p20 {
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
foo, .foo {
|
||||
color: #f00;
|
||||
}
|
||||
/*滚动条*/
|
||||
::-webkit-scrollbar-corner {
|
||||
background: #1aa094;
|
||||
}
|
||||
::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #1aa094;
|
||||
&:window-inactive {
|
||||
background: #1aa094;
|
||||
}
|
||||
}
|
||||
|
||||
/*右侧滚动条*/
|
||||
.right::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
background-color: #eee;
|
||||
}
|
||||
.right::-webkit-scrollbar-thumb {
|
||||
background: #009688;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.right::-webkit-scrollbar-track-piece {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/*顶栏*/
|
||||
header {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #eee;
|
||||
position: fixed;
|
||||
z-index: 1001;
|
||||
color: #333;
|
||||
h1 {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
width: 150px;
|
||||
display: block;
|
||||
color: #fff;
|
||||
float: left;
|
||||
background-color: #404852;
|
||||
text-align: center;
|
||||
font-size: 36px;
|
||||
}
|
||||
.breadcrumb {
|
||||
margin-left: 150px;
|
||||
padding-left: 20px;
|
||||
i {
|
||||
float: left;
|
||||
}
|
||||
ul {
|
||||
float: left;
|
||||
}
|
||||
li {
|
||||
float: left;
|
||||
margin: 0 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.main {
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
/*左栏*/
|
||||
.left {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 150px;
|
||||
padding-top: 50px;
|
||||
height: 100%;
|
||||
background: #3c444d;
|
||||
overflow-x: auto;
|
||||
z-index: 100;
|
||||
box-sizing: border-box;
|
||||
ul {
|
||||
li {
|
||||
float: left;
|
||||
color: #333;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
&.hidden {
|
||||
div {
|
||||
display: none;
|
||||
}
|
||||
i {
|
||||
&.arrow {
|
||||
transform: rotate(180deg);
|
||||
-ms-transform: rotate(180deg);
|
||||
-moz-transform: rotate(180deg);
|
||||
-webkit-transform: rotate(180deg);
|
||||
-o-transform: rotate(180deg);
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
a {
|
||||
color: #ececec;
|
||||
padding: 10px 0 10px 20px;
|
||||
display: block;
|
||||
}
|
||||
i {
|
||||
&:first-child {
|
||||
margin-right: 5px;
|
||||
}
|
||||
&.arrow {
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
font-size: 12px;
|
||||
padding-top: 4px;
|
||||
}
|
||||
&.active {
|
||||
color: #eee;
|
||||
position: absolute;
|
||||
right: -6px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
top: 0px;
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
z-index: 1;
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
}
|
||||
& > div {
|
||||
position: relative;
|
||||
background-color: #404852;
|
||||
a {
|
||||
padding-left: 45px;
|
||||
color: #b2b2b2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.left ul li a:hover,
|
||||
.left ul li a.active {
|
||||
color: #009688;
|
||||
background: #28313c;
|
||||
}
|
||||
/*右侧*/
|
||||
.right {
|
||||
margin-left:150px;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
padding-top: 70px;
|
||||
iframe {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-left: 150px;
|
||||
padding-top: 50px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
& > a {
|
||||
& > i {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.arz {
|
||||
margin: 20px 0 0 30px;
|
||||
a {
|
||||
color: #fff;
|
||||
padding: 10px 18px;
|
||||
background: #009688;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border-radius: 2px;
|
||||
i {
|
||||
position: relative;
|
||||
right: 3px;
|
||||
top: 1px;
|
||||
}
|
||||
&:hover {
|
||||
opacity: .8;
|
||||
filter: alpha(opacity=80);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.bform {
|
||||
margin: 20px 30px 0 10px;
|
||||
}
|
||||
/*分页*/
|
||||
.page {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
li {
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
.page li a, .page li span {
|
||||
padding: 5px 10px;
|
||||
background-color: #009688;
|
||||
color: #fff;
|
||||
margin-right: 5px;
|
||||
display: block;
|
||||
}
|
||||
.page li a:hover, .page li span {
|
||||
background-color: #999;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 108 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
@@ -0,0 +1,53 @@
|
||||
const menu = [{
|
||||
"name": "首页",
|
||||
"icon": "",
|
||||
"url": "index.html",
|
||||
"hidden": false,
|
||||
"list": []
|
||||
}, {
|
||||
"name": "系统设置",
|
||||
"icon": "",
|
||||
"url": "",
|
||||
"hidden": false,
|
||||
"list": [{
|
||||
"name": "全局head",
|
||||
"url": "/web/index.html"
|
||||
}, {
|
||||
"name": "友情连接",
|
||||
"url": "/web/link.html"
|
||||
},{
|
||||
"name": "全局顶部",
|
||||
"url": "/web/header.html"
|
||||
}, {
|
||||
"name": "导航管理",
|
||||
"url": "/web/nav.html"
|
||||
}, {
|
||||
"name": "全局底部",
|
||||
"url": "/web/footer.html"
|
||||
}, {
|
||||
"name": "清除缓存",
|
||||
"url": "/index/web_cache.html"
|
||||
}, {
|
||||
"name": "文件管理",
|
||||
"url": "/file/index.html"
|
||||
}]
|
||||
}, {
|
||||
"name": "退出登录",
|
||||
"icon": "",
|
||||
"url": "/index/out.html",
|
||||
"list": []
|
||||
}];
|
||||
|
||||
const config = {
|
||||
name: "Tool",
|
||||
menu: menu,
|
||||
version: 'v1.6',
|
||||
official:'/'
|
||||
};
|
||||
|
||||
try {
|
||||
module.exports.name = "Tool";
|
||||
module.exports.menu = menu;
|
||||
}catch (e){
|
||||
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
|
||||
layui.use('form', function () {
|
||||
var form = layui.form,
|
||||
layer = layui.layer;
|
||||
});
|
||||
|
||||
var vue = new Vue({
|
||||
el:'#app',
|
||||
data:{
|
||||
webname:config.name,
|
||||
menu:[],
|
||||
address:[]
|
||||
},
|
||||
created:function(){
|
||||
this.menu = config.menu;
|
||||
this.thisActive();
|
||||
this.thisAttr();
|
||||
},
|
||||
methods:{
|
||||
//记住收展
|
||||
onActive:function (pid,id=false) {
|
||||
let data;
|
||||
if(id===false){
|
||||
data = this.menu[pid];
|
||||
if(data.url.length>0){
|
||||
this.menu.forEach((v,k)=>{
|
||||
v.active = false;
|
||||
v.list.forEach((v2,k2)=>{
|
||||
v2.active = false;
|
||||
})
|
||||
})
|
||||
data.active = true;
|
||||
}
|
||||
data.hidden = !data.hidden;
|
||||
}else{
|
||||
this.menu.forEach((v,k)=>{
|
||||
v.active = false;
|
||||
v.list.forEach((v2,k2)=>{
|
||||
v2.active = false;
|
||||
})
|
||||
})
|
||||
data = this.menu[pid].list[id];
|
||||
}
|
||||
|
||||
this.updateStorage();
|
||||
if(data.url.length>0){
|
||||
if(data.target){
|
||||
if(data.target=='_blank'){
|
||||
window.open(data.url);
|
||||
}else{
|
||||
window.location.href = data.url;
|
||||
}
|
||||
}else{
|
||||
window.location.href = data.url;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//更新菜单缓存
|
||||
updateStorage(){
|
||||
sessionStorage.menu = JSON.stringify(this.menu);
|
||||
},
|
||||
//菜单高亮
|
||||
thisActive:function(){
|
||||
let pathname = window.location.pathname;
|
||||
let host = window.location.host;
|
||||
let pid = false;
|
||||
let id = false;
|
||||
this.menu.forEach((v,k)=>{
|
||||
let url = v.url;
|
||||
if(url.length>0){
|
||||
if(url[0]!='/' && url.substr(0,4)!='Net'){
|
||||
url = '/'+url;
|
||||
}
|
||||
}
|
||||
if(pathname==url){
|
||||
pid = k;
|
||||
}
|
||||
v.list.forEach((v2,k2)=>{
|
||||
let url = v2.url;
|
||||
|
||||
if(url.length>0){
|
||||
if(url[0]!='/' && url.substr(0,4)!='Net'){
|
||||
url = '/'+url;
|
||||
}
|
||||
}
|
||||
if(pathname==url){
|
||||
pid = k;
|
||||
id = k2;
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
if(id!==false){
|
||||
this.menu[pid].list[id].active = true;
|
||||
}else{
|
||||
if(pid!==false){
|
||||
this.menu[pid].active = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.updateStorage();
|
||||
|
||||
},
|
||||
//当前位置
|
||||
thisAttr:function () {
|
||||
//当前位置
|
||||
let address = [{
|
||||
name:'首页',
|
||||
url:'index.html'
|
||||
}];
|
||||
this.menu.forEach((v,k)=>{
|
||||
v.list.forEach((v2,k2)=>{
|
||||
if(v2.active){
|
||||
address.push({
|
||||
name:v.name,
|
||||
url:'javascript:;'
|
||||
})
|
||||
address.push({
|
||||
name:v2.name,
|
||||
url:v2.url,
|
||||
})
|
||||
this.address = address;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
//删除
|
||||
$(".del").click(function () {
|
||||
var url = $(this).attr("href");
|
||||
var id = $(this).attr("data-id");
|
||||
|
||||
layer.confirm('你确定要删除么?', {
|
||||
btn: ['确定', '取消']
|
||||
}, function () {
|
||||
$.get(url, function (data) {
|
||||
if (data.code == 1) {
|
||||
$(id).fadeOut();
|
||||
layer.msg(data.msg, {icon: 1});
|
||||
} else {
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
});
|
||||
}, function () {
|
||||
layer.msg("您取消了删除!");
|
||||
});
|
||||
return false;
|
||||
});
|
||||
})
|
||||
|
||||
function delCache(){
|
||||
sessionStorage.clear();
|
||||
localStorage.clear();
|
||||
}
|
||||
|
||||
function msg(code=1,msg='',url='',s=3) {
|
||||
if(typeof code == 'object') {
|
||||
msg = code.msg;
|
||||
url = code.url || '';
|
||||
s = code.s || 3;
|
||||
code = code.code;
|
||||
}
|
||||
code = code==1 ? 1 : 2;
|
||||
layer.msg(msg, {icon: code,offset: 't',shade: [0.4, '#000']});
|
||||
if(url!=''){
|
||||
setTimeout(function () {
|
||||
window.location.href = url;
|
||||
},s*1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//百度统计,使用时请去掉
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?2b45cf3bb7ac4664bb612c10feebf85d";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* 检查版本更新
|
||||
* @type {string}
|
||||
*/
|
||||
|
||||
let html = `
|
||||
<div class="modal fade" id="versionUpdate" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="staticBackdropLabel">提示</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<p>
|
||||
发现新的版本: <b id="newVersion">v1.23</b>
|
||||
</p>
|
||||
<p>
|
||||
永不提示请删除: static/admin/js/update.js 中代码
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" id="noUpdate" data-dismiss="modal">关闭</button>
|
||||
<a type="button" href="http://www.qadmin.net/bsadmin.html" target="_blank" class="btn btn-primary">去看看</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
|
||||
let noUpdate = sessionStorage.getItem('noUpdate');
|
||||
if(noUpdate!=1){
|
||||
$.get(config.official+"/api/version/qadmin",res=>{
|
||||
if(res.code==1){
|
||||
if(config.version<res.data.v){
|
||||
|
||||
layer.confirm('发现新的版本: <b id="newVersion">'+res.data.v+'</b>?<p>\n 永不提示请删除: static/admin/js/update.js 中代码\n </p>', {
|
||||
btn: ['关闭','去看看'] //按钮
|
||||
}, function(){
|
||||
sessionStorage.setItem('noUpdate',1);
|
||||
console.log('不在提示');
|
||||
layer.closeAll()
|
||||
}, function(){
|
||||
window.location.href = 'http://www.qadmin.net/';
|
||||
layer.closeAll()
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user