mirror of
https://github.com/201206030/novel-plus.git
synced 2025-06-24 04:46:37 +00:00
restful api改造
This commit is contained in:
@ -2,39 +2,13 @@ var SCYC = {
|
||||
}
|
||||
|
||||
$.extend($.fn.validatebox.defaults.rules, {
|
||||
checkBookName: {
|
||||
validator: function (value, param) {
|
||||
var url = "/aspx/book/booklist.aspx";
|
||||
var data = { bid: param, bname: value, act: "getbooknamerepeat" };
|
||||
var bool = false;
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: 'html',
|
||||
async: false,
|
||||
url: url,
|
||||
data: data,
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
if (result == "1") {
|
||||
$.fn.validatebox.defaults.rules.checkBookName.message = '该书名已存在,请重新输入';
|
||||
bool = false;
|
||||
} else {
|
||||
$.fn.validatebox.defaults.rules.checkBookName.message = '';
|
||||
bool = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
return bool;
|
||||
message: '';
|
||||
}
|
||||
},
|
||||
checkNiceName: {
|
||||
checkPenName: {
|
||||
validator: function (value, param) {
|
||||
var url = "/author/checkPenName";
|
||||
var data = { penName: value};
|
||||
var bool = false;
|
||||
$.ajax({
|
||||
type: "post",
|
||||
type: "get",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
url: url,
|
||||
@ -42,10 +16,10 @@ $.extend($.fn.validatebox.defaults.rules, {
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
if (result.data) {
|
||||
$.fn.validatebox.defaults.rules.checkNiceName.message = '笔名已存在,请重新输入';
|
||||
$.fn.validatebox.defaults.rules.checkPenName.message = '笔名已存在,请重新输入';
|
||||
bool = false;
|
||||
} else {
|
||||
$.fn.validatebox.defaults.rules.checkNiceName.message = '';
|
||||
$.fn.validatebox.defaults.rules.checkPenName.message = '';
|
||||
bool = true;
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@
|
||||
function search(curr, limit) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/news/listByPage",
|
||||
data: {'curr':curr,'limit':limit},
|
||||
dataType: "json",
|
||||
|
@ -118,7 +118,7 @@
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/author/listIncomeMonthByPage",
|
||||
data: {'curr':curr,'limit':limit},
|
||||
dataType: "json",
|
||||
|
@ -124,7 +124,7 @@
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/author/listIncomeDailyByPage",
|
||||
data: data,
|
||||
dataType: "json",
|
||||
|
@ -134,9 +134,9 @@
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/author/queryIndexContent",
|
||||
data: {'indexId':indexId},
|
||||
type: "get",
|
||||
url: "/author/queryIndexContent/"+indexId,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
|
@ -144,7 +144,7 @@
|
||||
function search(curr, limit) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/author/listBookByPage",
|
||||
data: {'curr':curr,'limit':limit},
|
||||
dataType: "json",
|
||||
|
@ -144,7 +144,7 @@
|
||||
function search(curr, limit) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/queryIndexList",
|
||||
data: {'bookId': bookId, 'curr': curr, 'limit': limit, 'orderBy': 'index_num desc'},
|
||||
dataType: "json",
|
||||
@ -299,9 +299,9 @@
|
||||
|
||||
layer.close(index);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/author/deleteIndex",
|
||||
data: {'indexId': indexId},
|
||||
type: "delete",
|
||||
url: "/author/deleteIndex/"+indexId,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
|
@ -60,7 +60,7 @@
|
||||
作者笔名:
|
||||
</td>
|
||||
<td>
|
||||
<input name="penName" th:value="${author.penName}" type="text" maxlength="8" id="TxtNiceName" class="easyui-validatebox inpMain" data-options="required:true" validType="checkNiceName" />
|
||||
<input name="penName" th:value="${author.penName}" type="text" maxlength="8" id="TxtNiceName" class="easyui-validatebox inpMain" data-options="required:true" validType="checkPenName" />
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
@ -119,7 +119,7 @@
|
||||
function searchComments(curr, limit) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listCommentByPage",
|
||||
data: {'bookId': $("#bookId").val(),'curr':curr,'limit':limit},
|
||||
dataType: "json",
|
||||
|
@ -234,7 +234,7 @@
|
||||
}
|
||||
//查询是否在书架
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/queryIsInShelf",
|
||||
data: {'bookId':$("#bookId").val()},
|
||||
dataType: "json",
|
||||
|
@ -199,7 +199,7 @@
|
||||
var lastBookIndexId = $("#lastBookIndexId").val();
|
||||
if(lastBookIndexId){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/queryBookIndexAbout",
|
||||
data: {'bookId': bookId, 'lastBookIndexId': lastBookIndexId},
|
||||
dataType: "json",
|
||||
@ -226,7 +226,7 @@
|
||||
<script language="javascript" type="text/javascript">
|
||||
//查询是否在书架
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/queryIsInShelf",
|
||||
data: {'bookId': $("#bookId").val()},
|
||||
dataType: "json",
|
||||
@ -255,7 +255,7 @@
|
||||
|
||||
function loadCommentList(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listCommentByPage",
|
||||
data: {'bookId': $("#bookId").val()},
|
||||
dataType: "json",
|
||||
@ -335,7 +335,7 @@
|
||||
var bookCatId = $("#bookCatId").val();
|
||||
//查询同类推荐
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listRecBookByCatId",
|
||||
data: {'catId': bookCatId},
|
||||
dataType: "json",
|
||||
|
@ -88,7 +88,7 @@
|
||||
|
||||
function listRank(rankType){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listRank",
|
||||
data: {'type':rankType,'limit':30},
|
||||
dataType: "json",
|
||||
|
@ -163,7 +163,7 @@
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/searchByPage",
|
||||
data: searchData,
|
||||
dataType: "json",
|
||||
@ -227,7 +227,7 @@
|
||||
|
||||
function listBookCategory(c) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listBookCategory",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
|
@ -157,7 +157,7 @@
|
||||
$(function () {
|
||||
//加载首页书籍设置数据
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listBookSetting",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
@ -331,7 +331,7 @@
|
||||
})
|
||||
//首页新闻查询
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/news/listIndexNews",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
@ -359,7 +359,7 @@
|
||||
|
||||
//点击榜单数据查询
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listClickRank",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
@ -402,7 +402,7 @@
|
||||
})
|
||||
//新书榜单查询
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listNewRank",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
@ -446,7 +446,7 @@
|
||||
})
|
||||
//更新榜单查询
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listUpdateRank",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
@ -504,7 +504,7 @@
|
||||
})
|
||||
//友情链接查询
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/friendLink/listIndexLink",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
|
@ -195,7 +195,7 @@
|
||||
<script>
|
||||
//查询是否在书架
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/queryIsInShelf",
|
||||
data: {'bookId': $("#bookIdHidden").val()},
|
||||
dataType: "json",
|
||||
@ -221,7 +221,7 @@
|
||||
|
||||
//查询最新目录集合
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/queryNewIndexList",
|
||||
data: {'bookId': $("#bookIdHidden").val()},
|
||||
dataType: "json",
|
||||
|
@ -168,7 +168,7 @@
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/searchByPage",
|
||||
data: searchData,
|
||||
dataType: "json",
|
||||
|
@ -235,7 +235,7 @@
|
||||
<script>
|
||||
//加载首页书籍设置数据
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listBookSetting",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
@ -318,7 +318,7 @@
|
||||
|
||||
//更新榜单查询
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/book/listUpdateRank",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
|
@ -86,7 +86,7 @@
|
||||
|
||||
//查询用户信息
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/userInfo",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
|
@ -52,7 +52,7 @@
|
||||
function search(curr, limit) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/listCommentByPage",
|
||||
data: {'curr':curr,'limit':limit},
|
||||
dataType: "json",
|
||||
|
@ -80,7 +80,7 @@
|
||||
function search(curr, limit) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/listBookShelfByPage",
|
||||
data: {'curr':curr,'limit':limit},
|
||||
dataType: "json",
|
||||
|
@ -59,7 +59,7 @@
|
||||
function search(curr, limit) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/listUserFeedBackByPage",
|
||||
data: {'curr':curr,'limit':limit},
|
||||
dataType: "json",
|
||||
|
@ -67,7 +67,7 @@
|
||||
function search(curr, limit) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/listReadHistoryByPage",
|
||||
data: {'curr':curr,'limit':limit},
|
||||
dataType: "json",
|
||||
|
@ -57,7 +57,7 @@
|
||||
<script type="text/javascript">
|
||||
//查询用户信息
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/userInfo",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
|
@ -53,7 +53,7 @@
|
||||
<script type="text/javascript">
|
||||
//查询用户信息
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/userInfo",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
|
@ -45,7 +45,7 @@
|
||||
<script type="text/javascript">
|
||||
//查询用户信息
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/userInfo",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
|
@ -81,7 +81,7 @@
|
||||
<script type="text/javascript">
|
||||
//查询用户信息
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/userInfo",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
@ -113,7 +113,7 @@
|
||||
})
|
||||
//查询书架列表
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "get",
|
||||
url: "/user/listBookShelfByPage",
|
||||
data: {'limit':2},
|
||||
dataType: "json",
|
||||
|
Reference in New Issue
Block a user