.
This commit is contained in:
parent
bc97a6d36d
commit
f2cc75b5bd
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,4 +8,3 @@
|
|||||||
.idea/
|
.idea/
|
||||||
/.idea/
|
/.idea/
|
||||||
/out/
|
/out/
|
||||||
config.properties
|
|
@ -24,7 +24,7 @@ public class LoginInterceptor implements Interceptor {
|
|||||||
if ("XMLHttpRequest".equals(request.getHeader("X-Requested-With"))){
|
if ("XMLHttpRequest".equals(request.getHeader("X-Requested-With"))){
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
controller.render("/user/login.html");
|
controller.redirect("/user/login");
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
inv.invoke();
|
inv.invoke();
|
||||||
|
@ -72,10 +72,10 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'face'], f
|
|||||||
if(typeof res === 'string'){
|
if(typeof res === 'string'){
|
||||||
res = JSON.parse(res);
|
res = JSON.parse(res);
|
||||||
}
|
}
|
||||||
if(res.retcode === 0) {
|
if(res.code === 1) {
|
||||||
success && success(res);
|
success && success(res);
|
||||||
} else {
|
} else {
|
||||||
layer.msg(res.retinfo || res.code, {shift: 6});
|
layer.msg(res.msg || res.code, {shift: 6});
|
||||||
options.error && options.error();
|
options.error && options.error();
|
||||||
}
|
}
|
||||||
}, error: function(e){
|
}, error: function(e){
|
||||||
|
@ -77,7 +77,7 @@ layui.define(['fly','laypage'], function(exports){
|
|||||||
del: function(div){
|
del: function(div){
|
||||||
layer.confirm('确认删除该求解么?', function(index){
|
layer.confirm('确认删除该求解么?', function(index){
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
fly.json('/os/content/set', {
|
fly.json('/content/set', {
|
||||||
id: div.data('id')
|
id: div.data('id')
|
||||||
,v: -1
|
,v: -1
|
||||||
,field:"status"
|
,field:"status"
|
||||||
@ -90,7 +90,7 @@ layui.define(['fly','laypage'], function(exports){
|
|||||||
//设置置顶、状态
|
//设置置顶、状态
|
||||||
,set: function(div){
|
,set: function(div){
|
||||||
var othis = $(this);
|
var othis = $(this);
|
||||||
fly.json('/os/content/set', {
|
fly.json('/content/set', {
|
||||||
id: div.data('id')
|
id: div.data('id')
|
||||||
,v: othis.attr('v')
|
,v: othis.attr('v')
|
||||||
,field: othis.attr('field')
|
,field: othis.attr('field')
|
||||||
@ -102,7 +102,7 @@ layui.define(['fly','laypage'], function(exports){
|
|||||||
//收藏
|
//收藏
|
||||||
,collect: function(div){
|
,collect: function(div){
|
||||||
var othis = $(this), type = othis.data('type');
|
var othis = $(this), type = othis.data('type');
|
||||||
fly.json('/os/content/collect', {
|
fly.json('/content/collect', {
|
||||||
contentId: div.data('id')
|
contentId: div.data('id')
|
||||||
,ok: type === 'add'? 1:-1
|
,ok: type === 'add'? 1:-1
|
||||||
}, function(res){
|
}, function(res){
|
||||||
@ -231,13 +231,9 @@ layui.define(['fly','laypage'], function(exports){
|
|||||||
form.on('submit(jie-add)', function(data){
|
form.on('submit(jie-add)', function(data){
|
||||||
var bean = {};
|
var bean = {};
|
||||||
["contentId","title", "content", "type"].forEach(function (value) {
|
["contentId","title", "content", "type"].forEach(function (value) {
|
||||||
bean[value] = data.field[value];
|
bean["content."+value] = data.field[value];
|
||||||
});
|
});
|
||||||
console.log(bean);
|
fly.json("/jie/save",bean,function (res) {
|
||||||
|
|
||||||
fly.json("/os/content/save",{
|
|
||||||
bean:JSON.stringify(bean)
|
|
||||||
},function (res) {
|
|
||||||
layer.msg("发布成功",{time:2000},function () {
|
layer.msg("发布成功",{time:2000},function () {
|
||||||
location.href = "/";
|
location.href = "/";
|
||||||
});
|
});
|
||||||
@ -251,7 +247,7 @@ layui.define(['fly','laypage'], function(exports){
|
|||||||
});
|
});
|
||||||
console.log(bean);
|
console.log(bean);
|
||||||
|
|
||||||
fly.json("/os/comment/save",{
|
fly.json("/comment/save",{
|
||||||
bean:JSON.stringify(bean)
|
bean:JSON.stringify(bean)
|
||||||
},function (res) {
|
},function (res) {
|
||||||
layer.msg("回复成功",{time:2000},function () {
|
layer.msg("回复成功",{time:2000},function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user