Compare commits

...

33 Commits

Author SHA1 Message Date
d8e559ab50 修复规则 2024-11-02 21:19:27 +08:00
3849a9b86f build: 修改版本号 2024-11-02 18:32:01 +08:00
71b9d1d916 模版更新 2024-11-02 18:31:47 +08:00
4b9dbe969c 修复i笔趣阁爬虫规则 2024-11-02 18:26:40 +08:00
2136f7490f 增加爬虫规则 2024-11-02 13:24:28 +08:00
3586ffbc0a 优化 2024-09-21 11:14:07 +08:00
f78a2a36cf 优化 2024-09-21 11:10:44 +08:00
a8219253e9 优化 2024-09-21 10:15:45 +08:00
5c35f7af0a 更换默认logo图片 2024-09-16 21:08:32 +08:00
d55e1a3e22 revert: sql格式化还原 2024-08-06 22:42:43 +08:00
21a6a49ce9 fix: 作家稿费统计 2024-08-06 21:14:22 +08:00
3735023cef perf(novel-front): UI优化 2024-07-20 21:48:29 +08:00
89992dc781 perf(novel-crawl): 增加小说内容过滤 2024-06-01 09:56:07 +08:00
976db9420e build: 修改版本号 2024-05-31 20:59:34 +08:00
e33db86081 Update README.md 2024-05-28 12:34:00 +08:00
48a70c2aca build: 修改版本号 2024-05-28 09:45:23 +08:00
ea5c0e8bd1 模版更新 2024-05-28 09:42:27 +08:00
b0c249cdca fix: 默认logo图片失效 2024-05-26 22:50:57 +08:00
730fcb4c76 fix: 默认logo图片失效 2024-05-26 22:46:46 +08:00
b976a00389 perf: UI优化 2024-05-26 22:31:26 +08:00
6d9b563583 fix: 文件上传大小限制 2024-05-25 22:05:03 +08:00
bfb7d6cc5c fix: i笔趣阁域名更换 2024-05-12 17:26:59 +08:00
9d4dc409c6 fix: URI编码 2024-03-03 11:10:46 +08:00
34d211afbf fix: 只推荐有内容的小说 2024-02-21 19:27:48 +08:00
2d218076c4 chore: 修改打包默认模版 2024-02-18 10:28:29 +08:00
674e4df84c chore: 模版更新 2024-02-07 14:59:31 +08:00
331f56d112 fix: 移动端首页在数据量小于10时报错 2024-02-07 14:58:36 +08:00
f494aae2c7 chore: 模版更新 2024-02-07 14:23:32 +08:00
2fc533f8ae fix(novel-crawl): 登录页样式问题 2024-02-05 21:12:41 +08:00
82758271e3 feat: 增加语音播放小说内容 2024-02-05 12:05:26 +08:00
4c82c2d720 perf: 优化支付宝支付流程 2024-02-04 12:25:26 +08:00
4665b5c4b9 fix: bug 2024-02-03 16:14:36 +08:00
7bbabb3492 fix: 修复充值页面的未登录跳转路径 2024-02-03 14:03:23 +08:00
103 changed files with 1811 additions and 1441 deletions

View File

@ -61,9 +61,9 @@ novel-plus -- 父工程
### 绿色主题模版
[![点击查看大图](https://youdoc.gitee.io/resource/images/os/novel-plus/green.png)](https://youdoc.gitee.io/resource/images/os/novel-plus/green.png)
[![点击查看大图](https://youdoc.gitee.io/resource/images/os/novel-plus/green3.png)](https://youdoc.gitee.io/resource/images/os/novel-plus/green3.png)
[![点击查看大图](https://youdoc.gitee.io/resource/images/os/novel-plus/green2.png)](https://youdoc.gitee.io/resource/images/os/novel-plus/green2.png)
[![点击查看大图](https://www.xxyopen.com/images/green_novel.png)](https://www.xxyopen.com/images/green_novel.png)
[![点击查看大图](https://www.xxyopen.com/images/resource/os/novel-plus/green3.png)](https://www.xxyopen.com/images/resource/os/novel-plus/green3.png)
[![点击查看大图](https://www.xxyopen.com/images/resource/os/novel-plus/green2.png)](https://www.xxyopen.com/images/resource/os/novel-plus/green2.png)
## 演示视频

3
doc/sql/20240512.sql Normal file
View File

@ -0,0 +1,3 @@
update crawl_source
set crawl_rule = replace(crawl_rule, 'ibiquge.net', 'ibiquzw.org')
where id = 16;

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
<groupId>com.java2nb</groupId>
<artifactId>novel-admin</artifactId>
<version>4.3.0-RC1</version>
<version>4.4.0</version>
<packaging>jar</packaging>
<name>novel-admin</name>

View File

@ -18,11 +18,12 @@ spring:
profiles:
active: dev
#上传文件的最大值10M
#上传文件的最大值100M
servlet:
multipart:
max-file-size: 10485760
max-file-size: 100MB
max-request-size: 100MB
devtools:
restart:
enabled: true

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>novel</artifactId>
<groupId>com.java2nb</groupId>
<version>4.3.0-RC1</version>
<version>4.4.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -14,7 +14,10 @@ import org.springframework.http.ResponseEntity;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Date;
import java.util.Objects;
@ -37,10 +40,13 @@ public class FileUtil {
//本地图片保存
HttpHeaders headers = new HttpHeaders();
HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
ResponseEntity<Resource> resEntity = RestTemplateUtil.getInstance(Charsets.ISO_8859_1.name()).exchange(picSrc, HttpMethod.GET, requestEntity, Resource.class);
ResponseEntity<Resource> resEntity = RestTemplates.newInstance(Charsets.ISO_8859_1.name())
.exchange(picSrc, HttpMethod.GET, requestEntity, Resource.class);
input = Objects.requireNonNull(resEntity.getBody()).getInputStream();
Date currentDate = new Date();
picSrc = visitPrefix + DateUtils.formatDate(currentDate, "yyyy") + "/" + DateUtils.formatDate(currentDate, "MM") + "/" + DateUtils.formatDate(currentDate, "dd") + "/"
picSrc =
visitPrefix + DateUtils.formatDate(currentDate, "yyyy") + "/" + DateUtils.formatDate(currentDate, "MM")
+ "/" + DateUtils.formatDate(currentDate, "dd") + "/"
+ UUIDUtil.getUUID32()
+ picSrc.substring(picSrc.lastIndexOf("."));
File picFile = new File(picSavePath + picSrc);
@ -67,7 +73,6 @@ public class FileUtil {
closeStream(input, out);
}
return picSrc;
}

View File

@ -1,38 +1,24 @@
package com.java2nb.novel.core.utils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
/**
* @author Administrator
*/
@Slf4j
public class HttpUtil {
private static RestTemplate restTemplate = RestTemplateUtil.getInstance("utf-8");
public static String getByHttpClient(String url) {
try {
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
if (forEntity.getStatusCode() == HttpStatus.OK) {
return forEntity.getBody();
} else {
return null;
}
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private static final RestTemplate REST_TEMPLATE = RestTemplates.newInstance("utf-8");
public static String getByHttpClientWithChrome(String url) {
try {
HttpHeaders headers = new HttpHeaders();
headers.add("user-agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36");
headers.add("user-agent",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36");
HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
ResponseEntity<String> forEntity = restTemplate.exchange(url.toString(), HttpMethod.GET, requestEntity, String.class);
ResponseEntity<String> forEntity = REST_TEMPLATE.exchange(url, HttpMethod.GET, requestEntity, String.class);
if (forEntity.getStatusCode() == HttpStatus.OK) {
return forEntity.getBody();
@ -40,8 +26,9 @@ public class HttpUtil {
return null;
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
return null;
}
}
}

View File

@ -26,16 +26,16 @@ import java.util.List;
import java.util.Objects;
@Component
public class RestTemplateUtil {
public class RestTemplates {
private static HttpProxyProperties httpProxyProperties;
RestTemplateUtil(HttpProxyProperties properties) {
RestTemplates(HttpProxyProperties properties) {
httpProxyProperties = properties;
}
@SneakyThrows
public static RestTemplate getInstance(String charset) {
public static RestTemplate newInstance(String charset) {
TrustStrategy acceptingTrustStrategy = (X509Certificate[] chain, String authType) -> true;

View File

@ -11,10 +11,11 @@ spring:
generator:
write-numbers-as-strings: true
#上传文件的最大值1M
#上传文件的最大值100M
servlet:
multipart:
max-file-size: 1048576
max-file-size: 100MB
max-request-size: 100MB
mybatis:
configuration:

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>novel</artifactId>
<groupId>com.java2nb</groupId>
<version>4.3.0-RC1</version>
<version>4.4.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -1,23 +1,23 @@
package com.java2nb.novel.core.crawl;
import com.java2nb.novel.core.utils.HttpUtil;
import com.java2nb.novel.core.utils.RandomBookInfoUtil;
import com.java2nb.novel.core.utils.RestTemplateUtil;
import com.java2nb.novel.core.utils.StringUtil;
import com.java2nb.novel.entity.Book;
import com.java2nb.novel.entity.BookContent;
import com.java2nb.novel.entity.BookIndex;
import com.java2nb.novel.utils.Constants;
import com.java2nb.novel.utils.CrawlHttpClient;
import io.github.xxyopen.util.IdWorker;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -26,20 +26,19 @@ import java.util.regex.Pattern;
*
* @author Administrator
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class CrawlParser {
private static final IdWorker idWorker = IdWorker.INSTANCE;
private final IdWorker ID_WORKER = IdWorker.INSTANCE;
private static final RestTemplate restTemplate = RestTemplateUtil.getInstance("utf-8");
private static final ThreadLocal<Integer> retryCount = new ThreadLocal<>();
private final CrawlHttpClient crawlHttpClient;
@SneakyThrows
public static void parseBook(RuleBean ruleBean, String bookId, CrawlBookHandler handler) {
public void parseBook(RuleBean ruleBean, String bookId, CrawlBookHandler handler) {
Book book = new Book();
String bookDetailUrl = ruleBean.getBookDetailUrl().replace("{bookId}", bookId);
String bookDetailHtml = getByHttpClientWithChrome(bookDetailUrl);
String bookDetailHtml = crawlHttpClient.get(bookDetailUrl);
if (bookDetailHtml != null) {
Pattern bookNamePatten = PatternFactory.getPattern(ruleBean.getBookNamePatten());
Matcher bookNameMatch = bookNamePatten.matcher(bookDetailHtml);
@ -89,14 +88,15 @@ public class CrawlParser {
}
}
String desc = bookDetailHtml.substring(bookDetailHtml.indexOf(ruleBean.getDescStart()) + ruleBean.getDescStart().length());
String desc = bookDetailHtml.substring(
bookDetailHtml.indexOf(ruleBean.getDescStart()) + ruleBean.getDescStart().length());
desc = desc.substring(0, desc.indexOf(ruleBean.getDescEnd()));
//过滤掉简介中的特殊标签
desc = desc.replaceAll("<a[^<]+</a>", "")
.replaceAll("<font[^<]+</font>", "")
.replaceAll("<p>\\s*</p>", "")
.replaceAll("<p>", "")
.replaceAll("</p>", "<br/>");
.replaceAll("<font[^<]+</font>", "")
.replaceAll("<p>\\s*</p>", "")
.replaceAll("<p>", "")
.replaceAll("</p>", "<br/>");
//设置书籍简介
book.setBookDesc(desc);
if (StringUtils.isNotBlank(ruleBean.getStatusPatten())) {
@ -112,14 +112,16 @@ public class CrawlParser {
}
}
if (StringUtils.isNotBlank(ruleBean.getUpadateTimePatten()) && StringUtils.isNotBlank(ruleBean.getUpadateTimeFormatPatten())) {
if (StringUtils.isNotBlank(ruleBean.getUpadateTimePatten()) && StringUtils.isNotBlank(
ruleBean.getUpadateTimeFormatPatten())) {
Pattern updateTimePatten = PatternFactory.getPattern(ruleBean.getUpadateTimePatten());
Matcher updateTimeMatch = updateTimePatten.matcher(bookDetailHtml);
boolean isFindUpdateTime = updateTimeMatch.find();
if (isFindUpdateTime) {
String updateTime = updateTimeMatch.group(1);
//设置更新时间
book.setLastIndexUpdateTime(new SimpleDateFormat(ruleBean.getUpadateTimeFormatPatten()).parse(updateTime));
book.setLastIndexUpdateTime(
new SimpleDateFormat(ruleBean.getUpadateTimeFormatPatten()).parse(updateTime));
}
}
@ -141,7 +143,8 @@ public class CrawlParser {
handler.handle(book);
}
public static boolean parseBookIndexAndContent(String sourceBookId, Book book, RuleBean ruleBean, Map<Integer, BookIndex> existBookIndexMap, CrawlBookChapterHandler handler) {
public boolean parseBookIndexAndContent(String sourceBookId, Book book, RuleBean ruleBean,
Map<Integer, BookIndex> existBookIndexMap, CrawlBookChapterHandler handler) {
Date currentDate = new Date();
@ -149,11 +152,12 @@ public class CrawlParser {
List<BookContent> contentList = new ArrayList<>();
//读取目录
String indexListUrl = ruleBean.getBookIndexUrl().replace("{bookId}", sourceBookId);
String indexListHtml = getByHttpClientWithChrome(indexListUrl);
String indexListHtml = crawlHttpClient.get(indexListUrl);
if (indexListHtml != null) {
if (StringUtils.isNotBlank(ruleBean.getBookIndexStart())) {
indexListHtml = indexListHtml.substring(indexListHtml.indexOf(ruleBean.getBookIndexStart()) + ruleBean.getBookIndexStart().length());
indexListHtml = indexListHtml.substring(
indexListHtml.indexOf(ruleBean.getBookIndexStart()) + ruleBean.getBookIndexStart().length());
}
Pattern indexIdPatten = PatternFactory.getPattern(ruleBean.getIndexIdPatten());
@ -174,14 +178,16 @@ public class CrawlParser {
BookIndex hasIndex = existBookIndexMap.get(indexNum);
String indexName = indexNameMatch.group(1);
if (hasIndex == null || !StringUtils.deleteWhitespace(hasIndex.getIndexName()).equals(StringUtils.deleteWhitespace(indexName))) {
if (hasIndex == null || !StringUtils.deleteWhitespace(hasIndex.getIndexName())
.equals(StringUtils.deleteWhitespace(indexName))) {
String sourceIndexId = indexIdMatch.group(1);
String bookContentUrl = ruleBean.getBookContentUrl();
int calStart = bookContentUrl.indexOf("{cal_");
if (calStart != -1) {
//内容页URL需要进行计算才能得到
String calStr = bookContentUrl.substring(calStart, calStart + bookContentUrl.substring(calStart).indexOf("}"));
String calStr = bookContentUrl.substring(calStart,
calStart + bookContentUrl.substring(calStart).indexOf("}"));
String[] calArr = calStr.split("_");
int calType = Integer.parseInt(calArr[1]);
if (calType == 1) {
@ -206,13 +212,25 @@ public class CrawlParser {
}
String contentUrl = bookContentUrl.replace("{bookId}", sourceBookId).replace("{indexId}", sourceIndexId);
String contentUrl = bookContentUrl.replace("{bookId}", sourceBookId)
.replace("{indexId}", sourceIndexId);
//查询章节内容
String contentHtml = getByHttpClientWithChrome(contentUrl);
String contentHtml = crawlHttpClient.get(contentUrl);
if (contentHtml != null && !contentHtml.contains("正在手打中")) {
String content = contentHtml.substring(contentHtml.indexOf(ruleBean.getContentStart()) + ruleBean.getContentStart().length());
String content = contentHtml.substring(
contentHtml.indexOf(ruleBean.getContentStart()) + ruleBean.getContentStart().length());
content = content.substring(0, content.indexOf(ruleBean.getContentEnd()));
// 小说内容过滤
String filterContent = ruleBean.getFilterContent();
if (StringUtils.isNotBlank(filterContent)) {
String[] filterRules = filterContent.replace("\r\n", "\n").split("\n");
for (String filterRule : filterRules) {
if (StringUtils.isNotBlank(filterRule)) {
content = content.replaceAll(filterRule, "");
}
}
}
//插入章节目录和章节内容
BookIndex bookIndex = new BookIndex();
bookIndex.setIndexName(indexName);
@ -235,7 +253,7 @@ public class CrawlParser {
} else {
//章节插入
//设置目录和章节内容
Long indexId = idWorker.nextId();
Long indexId = ID_WORKER.nextId();
bookIndex.setId(indexId);
bookIndex.setBookId(book.getId());
@ -257,7 +275,6 @@ public class CrawlParser {
isFindIndex = indexIdMatch.find() & indexNameMatch.find();
}
if (indexList.size() > 0) {
//如果有爬到最新章节,则设置小说主表的最新章节信息
//获取爬取到的最新章节
@ -290,56 +307,4 @@ public class CrawlParser {
return false;
}
private static String getByHttpClient(String url) {
try {
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
if (forEntity.getStatusCode() == HttpStatus.OK) {
String body = forEntity.getBody();
assert body != null;
if (body.length() < Constants.INVALID_HTML_LENGTH) {
return processErrorHttpResult(url);
}
//成功获得html内容
return body;
}
} catch (Exception e) {
e.printStackTrace();
}
return processErrorHttpResult(url);
}
private static String getByHttpClientWithChrome(String url) {
try {
String body = HttpUtil.getByHttpClientWithChrome(url);
if (body != null && body.length() < Constants.INVALID_HTML_LENGTH) {
return processErrorHttpResult(url);
}
//成功获得html内容
return body;
} catch (Exception e) {
e.printStackTrace();
}
return processErrorHttpResult(url);
}
@SneakyThrows
private static String processErrorHttpResult(String url) {
Integer count = retryCount.get();
if (count == null) {
count = 0;
}
if (count < Constants.HTTP_FAIL_RETRY_COUNT) {
Thread.sleep(new Random().nextInt(10 * 1000));
retryCount.set(++count);
return getByHttpClient(url);
}
return null;
}
}

View File

@ -6,6 +6,7 @@ import java.util.Map;
/**
* 爬虫解析规则bean
*
* @author Administrator
*/
@Data
@ -13,17 +14,17 @@ public class RuleBean {
/**
* 小说更新列表url
* */
*/
private String updateBookListUrl;
/**
* 分类列表页URL规则
* */
*/
private String bookListUrl;
private Map<String,String> catIdRule;
private Map<String, String> catIdRule;
private Map<String,Byte> bookStatusRule;
private Map<String, Byte> bookStatusRule;
private String bookIdPatten;
private String pagePatten;
@ -51,5 +52,7 @@ public class RuleBean {
private String bookIndexStart;
private String filterContent;
}

View File

@ -1,10 +1,12 @@
package com.java2nb.novel.core.listener;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.java2nb.novel.core.crawl.ChapterBean;
import com.java2nb.novel.core.crawl.CrawlParser;
import com.java2nb.novel.core.crawl.RuleBean;
import com.java2nb.novel.entity.*;
import com.java2nb.novel.entity.Book;
import com.java2nb.novel.entity.BookIndex;
import com.java2nb.novel.entity.CrawlSingleTask;
import com.java2nb.novel.entity.CrawlSource;
import com.java2nb.novel.service.BookService;
import com.java2nb.novel.service.CrawlService;
import com.java2nb.novel.utils.Constants;
@ -33,6 +35,8 @@ public class StarterListener implements ServletContextListener {
private final CrawlService crawlService;
private final CrawlParser crawlParser;
@Value("${crawl.update.thread}")
private int updateThreadCount;
@ -56,20 +60,24 @@ public class StarterListener implements ServletContextListener {
CrawlSource source = crawlService.queryCrawlSource(needUpdateBook.getCrawlSourceId());
RuleBean ruleBean = new ObjectMapper().readValue(source.getCrawlRule(), RuleBean.class);
//解析小说基本信息
CrawlParser.parseBook(ruleBean, needUpdateBook.getCrawlBookId(),book -> {
crawlParser.parseBook(ruleBean, needUpdateBook.getCrawlBookId(), book -> {
//这里只做老书更新
book.setId(needUpdateBook.getId());
book.setWordCount(needUpdateBook.getWordCount());
if (needUpdateBook.getPicUrl() != null && needUpdateBook.getPicUrl().contains(Constants.LOCAL_PIC_PREFIX)) {
if (needUpdateBook.getPicUrl() != null && needUpdateBook.getPicUrl()
.contains(Constants.LOCAL_PIC_PREFIX)) {
//本地图片则不更新
book.setPicUrl(null);
}
//查询已存在的章节
Map<Integer, BookIndex> existBookIndexMap = bookService.queryExistBookIndexMap(needUpdateBook.getId());
Map<Integer, BookIndex> existBookIndexMap = bookService.queryExistBookIndexMap(
needUpdateBook.getId());
//解析章节目录
CrawlParser.parseBookIndexAndContent(needUpdateBook.getCrawlBookId(), book, ruleBean, existBookIndexMap,chapter -> {
bookService.updateBookAndIndexAndContent(book, chapter.getBookIndexList(), chapter.getBookContentList(), existBookIndexMap);
});
crawlParser.parseBookIndexAndContent(needUpdateBook.getCrawlBookId(), book,
ruleBean, existBookIndexMap, chapter -> {
bookService.updateBookAndIndexAndContent(book, chapter.getBookIndexList(),
chapter.getBookContentList(), existBookIndexMap);
});
});
} catch (Exception e) {
log.error(e.getMessage(), e);
@ -88,7 +96,6 @@ public class StarterListener implements ServletContextListener {
}
new Thread(() -> {
log.info("程序启动,开始执行单本采集任务线程。。。");
while (true) {
@ -103,7 +110,8 @@ public class StarterListener implements ServletContextListener {
CrawlSource source = crawlService.queryCrawlSource(task.getSourceId());
RuleBean ruleBean = new ObjectMapper().readValue(source.getCrawlRule(), RuleBean.class);
if (crawlService.parseBookAndSave(task.getCatId(), ruleBean, task.getSourceId(), task.getSourceBookId())) {
if (crawlService.parseBookAndSave(task.getCatId(), ruleBean, task.getSourceId(),
task.getSourceBookId())) {
//采集成功
crawlStatus = 1;
}

View File

@ -2,17 +2,11 @@ package com.java2nb.novel.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.PageHelper;
import io.github.xxyopen.model.page.PageBean;
import com.java2nb.novel.core.cache.CacheKey;
import com.java2nb.novel.core.cache.CacheService;
import com.java2nb.novel.core.crawl.CrawlParser;
import com.java2nb.novel.core.crawl.RuleBean;
import com.java2nb.novel.core.enums.ResponseStatus;
import io.github.xxyopen.model.page.builder.pagehelper.PageBuilder;
import io.github.xxyopen.util.IdWorker;
import io.github.xxyopen.util.ThreadUtil;
import io.github.xxyopen.web.exception.BusinessException;
import io.github.xxyopen.web.util.BeanUtil;
import com.java2nb.novel.entity.Book;
import com.java2nb.novel.entity.CrawlSingleTask;
import com.java2nb.novel.entity.CrawlSource;
@ -22,8 +16,15 @@ import com.java2nb.novel.mapper.CrawlSourceDynamicSqlSupport;
import com.java2nb.novel.mapper.CrawlSourceMapper;
import com.java2nb.novel.service.BookService;
import com.java2nb.novel.service.CrawlService;
import com.java2nb.novel.utils.CrawlHttpClient;
import com.java2nb.novel.vo.CrawlSingleTaskVO;
import com.java2nb.novel.vo.CrawlSourceVO;
import io.github.xxyopen.model.page.PageBean;
import io.github.xxyopen.model.page.builder.pagehelper.PageBuilder;
import io.github.xxyopen.util.IdWorker;
import io.github.xxyopen.util.ThreadUtil;
import io.github.xxyopen.web.exception.BusinessException;
import io.github.xxyopen.web.util.BeanUtil;
import io.github.xxyopen.web.util.SpringUtil;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
@ -38,7 +39,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.java2nb.novel.core.utils.HttpUtil.getByHttpClientWithChrome;
import static com.java2nb.novel.mapper.CrawlSourceDynamicSqlSupport.*;
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
import static org.mybatis.dynamic.sql.select.SelectDSL.select;
@ -51,6 +51,7 @@ import static org.mybatis.dynamic.sql.select.SelectDSL.select;
@Slf4j
public class CrawlServiceImpl implements CrawlService {
private final CrawlParser crawlParser;
private final CrawlSourceMapper crawlSourceMapper;
@ -62,6 +63,8 @@ public class CrawlServiceImpl implements CrawlService {
private final IdWorker idWorker = IdWorker.INSTANCE;
private final CrawlHttpClient crawlHttpClient;
@Override
public void addCrawlSource(CrawlSource source) {
@ -71,15 +74,16 @@ public class CrawlServiceImpl implements CrawlService {
crawlSourceMapper.insertSelective(source);
}
@Override
public void updateCrawlSource(CrawlSource source) {
if(source.getId()!=null){
Optional<CrawlSource> opt=crawlSourceMapper.selectByPrimaryKey(source.getId());
if(opt.isPresent()) {
CrawlSource crawlSource =opt.get();
if (source.getId() != null) {
Optional<CrawlSource> opt = crawlSourceMapper.selectByPrimaryKey(source.getId());
if (opt.isPresent()) {
CrawlSource crawlSource = opt.get();
if (crawlSource.getSourceStatus() == (byte) 1) {
//关闭
openOrCloseCrawl(crawlSource.getId(),(byte)0);
openOrCloseCrawl(crawlSource.getId(), (byte) 0);
}
Date currentDate = new Date();
crawlSource.setUpdateTime(currentDate);
@ -89,14 +93,15 @@ public class CrawlServiceImpl implements CrawlService {
}
}
}
@Override
public PageBean<CrawlSource> listCrawlByPage(int page, int pageSize) {
PageHelper.startPage(page, pageSize);
SelectStatementProvider render = select(id, sourceName, sourceStatus, createTime, updateTime)
.from(crawlSource)
.orderBy(updateTime)
.build()
.render(RenderingStrategies.MYBATIS3);
.from(crawlSource)
.orderBy(updateTime)
.build()
.render(RenderingStrategies.MYBATIS3);
List<CrawlSource> crawlSources = crawlSourceMapper.selectMany(render);
PageBean<CrawlSource> pageBean = PageBuilder.build(crawlSources);
pageBean.setList(BeanUtil.copyList(crawlSources, CrawlSourceVO.class));
@ -113,7 +118,8 @@ public class CrawlServiceImpl implements CrawlService {
if (sourceStatus == (byte) 0) {
//关闭,直接修改数据库状态,并直接修改数据库状态后获取该爬虫正在运行的线程集合全部停止
SpringUtil.getBean(CrawlService.class).updateCrawlSourceStatus(sourceId, sourceStatus);
Set<Long> runningCrawlThreadId = (Set<Long>) cacheService.getObject(CacheKey.RUNNING_CRAWL_THREAD_KEY_PREFIX + sourceId);
Set<Long> runningCrawlThreadId = (Set<Long>) cacheService.getObject(
CacheKey.RUNNING_CRAWL_THREAD_KEY_PREFIX + sourceId);
if (runningCrawlThreadId != null) {
for (Long ThreadId : runningCrawlThreadId) {
Thread thread = ThreadUtil.findThread(ThreadId);
@ -157,11 +163,12 @@ public class CrawlServiceImpl implements CrawlService {
@Override
public CrawlSource queryCrawlSource(Integer sourceId) {
SelectStatementProvider render = select(CrawlSourceDynamicSqlSupport.sourceStatus, CrawlSourceDynamicSqlSupport.crawlRule)
.from(crawlSource)
.where(id, isEqualTo(sourceId))
.build()
.render(RenderingStrategies.MYBATIS3);
SelectStatementProvider render = select(CrawlSourceDynamicSqlSupport.sourceStatus,
CrawlSourceDynamicSqlSupport.crawlRule)
.from(crawlSource)
.where(id, isEqualTo(sourceId))
.build()
.render(RenderingStrategies.MYBATIS3);
return crawlSourceMapper.selectMany(render).get(0);
}
@ -182,10 +189,10 @@ public class CrawlServiceImpl implements CrawlService {
public PageBean<CrawlSingleTask> listCrawlSingleTaskByPage(int page, int pageSize) {
PageHelper.startPage(page, pageSize);
SelectStatementProvider render = select(CrawlSingleTaskDynamicSqlSupport.crawlSingleTask.allColumns())
.from(CrawlSingleTaskDynamicSqlSupport.crawlSingleTask)
.orderBy(CrawlSingleTaskDynamicSqlSupport.createTime.descending())
.build()
.render(RenderingStrategies.MYBATIS3);
.from(CrawlSingleTaskDynamicSqlSupport.crawlSingleTask)
.orderBy(CrawlSingleTaskDynamicSqlSupport.createTime.descending())
.build()
.render(RenderingStrategies.MYBATIS3);
List<CrawlSingleTask> crawlSingleTasks = crawlSingleTaskMapper.selectMany(render);
PageBean<CrawlSingleTask> pageBean = PageBuilder.build(crawlSingleTasks);
pageBean.setList(BeanUtil.copyList(crawlSingleTasks, CrawlSingleTaskVO.class));
@ -200,7 +207,8 @@ public class CrawlServiceImpl implements CrawlService {
@Override
public CrawlSingleTask getCrawlSingleTask() {
List<CrawlSingleTask> list = crawlSingleTaskMapper.selectMany(select(CrawlSingleTaskDynamicSqlSupport.crawlSingleTask.allColumns())
List<CrawlSingleTask> list = crawlSingleTaskMapper.selectMany(
select(CrawlSingleTaskDynamicSqlSupport.crawlSingleTask.allColumns())
.from(CrawlSingleTaskDynamicSqlSupport.crawlSingleTask)
.where(CrawlSingleTaskDynamicSqlSupport.taskStatus, isEqualTo((byte) 2))
.orderBy(CrawlSingleTaskDynamicSqlSupport.createTime)
@ -226,12 +234,12 @@ public class CrawlServiceImpl implements CrawlService {
@Override
public CrawlSource getCrawlSource(Integer id) {
Optional<CrawlSource> opt=crawlSourceMapper.selectByPrimaryKey(id);
if(opt.isPresent()) {
CrawlSource crawlSource =opt.get();
return crawlSource;
}
return null;
Optional<CrawlSource> opt = crawlSourceMapper.selectByPrimaryKey(id);
if (opt.isPresent()) {
CrawlSource crawlSource = opt.get();
return crawlSource;
}
return null;
}
/**
@ -251,10 +259,10 @@ public class CrawlServiceImpl implements CrawlService {
if (StringUtils.isNotBlank(ruleBean.getCatIdRule().get("catId" + catId))) {
//拼接分类URL
String catBookListUrl = ruleBean.getBookListUrl()
.replace("{catId}", ruleBean.getCatIdRule().get("catId" + catId))
.replace("{page}", page + "");
.replace("{catId}", ruleBean.getCatIdRule().get("catId" + catId))
.replace("{page}", page + "");
String bookListHtml = getByHttpClientWithChrome(catBookListUrl);
String bookListHtml = crawlHttpClient.get(catBookListUrl);
if (bookListHtml != null) {
Pattern bookIdPatten = Pattern.compile(ruleBean.getBookIdPatten());
Matcher bookIdMatcher = bookIdPatten.matcher(bookListHtml);
@ -268,14 +276,12 @@ public class CrawlServiceImpl implements CrawlService {
return;
}
String bookId = bookIdMatcher.group(1);
parseBookAndSave(catId, ruleBean, sourceId, bookId);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
isFindBookId = bookIdMatcher.find();
}
@ -306,7 +312,7 @@ public class CrawlServiceImpl implements CrawlService {
final AtomicBoolean parseResult = new AtomicBoolean(false);
CrawlParser.parseBook(ruleBean, bookId, book -> {
crawlParser.parseBook(ruleBean, bookId, book -> {
if (book.getBookName() == null || book.getAuthorName() == null) {
return;
}
@ -330,9 +336,11 @@ public class CrawlServiceImpl implements CrawlService {
book.setCrawlLastTime(new Date());
book.setId(idWorker.nextId());
//解析章节目录
boolean parseIndexContentResult = CrawlParser.parseBookIndexAndContent(bookId, book, ruleBean, new HashMap<>(0), chapter -> {
bookService.saveBookAndIndexAndContent(book, chapter.getBookIndexList(), chapter.getBookContentList());
});
boolean parseIndexContentResult = crawlParser.parseBookIndexAndContent(bookId, book, ruleBean,
new HashMap<>(0), chapter -> {
bookService.saveBookAndIndexAndContent(book, chapter.getBookIndexList(),
chapter.getBookContentList());
});
parseResult.set(parseIndexContentResult);
} else {
@ -356,11 +364,12 @@ public class CrawlServiceImpl implements CrawlService {
@Override
public List<CrawlSource> queryCrawlSourceByStatus(Byte sourceStatus) {
SelectStatementProvider render = select(CrawlSourceDynamicSqlSupport.id, CrawlSourceDynamicSqlSupport.sourceStatus, CrawlSourceDynamicSqlSupport.crawlRule)
.from(crawlSource)
.where(CrawlSourceDynamicSqlSupport.sourceStatus, isEqualTo(sourceStatus))
.build()
.render(RenderingStrategies.MYBATIS3);
SelectStatementProvider render = select(CrawlSourceDynamicSqlSupport.id,
CrawlSourceDynamicSqlSupport.sourceStatus, CrawlSourceDynamicSqlSupport.crawlRule)
.from(crawlSource)
.where(CrawlSourceDynamicSqlSupport.sourceStatus, isEqualTo(sourceStatus))
.build()
.render(RenderingStrategies.MYBATIS3);
return crawlSourceMapper.selectMany(render);
}
}

View File

@ -7,7 +7,7 @@ public class Constants {
/**
* 本地图片保存前缀
* */
*/
public static final String LOCAL_PIC_PREFIX = "/localPic/";
/**
@ -23,5 +23,5 @@ public class Constants {
/**
* 爬取小说http请求失败重试次数
*/
public static final Integer HTTP_FAIL_RETRY_COUNT = 5;
public static final Integer HTTP_FAIL_RETRY_COUNT = 3;
}

View File

@ -0,0 +1,57 @@
package com.java2nb.novel.utils;
import com.java2nb.novel.core.utils.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Objects;
import java.util.Random;
/**
* @author Administrator
*/
@Slf4j
@Component
public class CrawlHttpClient {
@Value("${crawl.interval.min}")
private Integer intervalMin;
@Value("${crawl.interval.max}")
private Integer intervalMax;
private final Random random = new Random();
private static final ThreadLocal<Integer> RETRY_COUNT = new ThreadLocal<>();
public String get(String url) {
if (Objects.nonNull(intervalMin) && Objects.nonNull(intervalMax) && intervalMax > intervalMin) {
try {
Thread.sleep(random.nextInt(intervalMax - intervalMin + 1) + intervalMin);
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
}
}
String body = HttpUtil.getByHttpClientWithChrome(url);
if (Objects.isNull(body) || body.length() < Constants.INVALID_HTML_LENGTH) {
return processErrorHttpResult(url);
}
//成功获得html内容
return body;
}
private String processErrorHttpResult(String url) {
Integer count = RETRY_COUNT.get();
if (count == null) {
count = 0;
}
if (count < Constants.HTTP_FAIL_RETRY_COUNT) {
RETRY_COUNT.set(++count);
return get(url);
}
RETRY_COUNT.remove();
return null;
}
}

View File

@ -14,12 +14,18 @@ admin:
username: admin
password: admin
#爬虫自动更新的线程数
#建议小说数量不多或者正在运行新书入库爬虫的情况下设置为1即可
#随着小说数量的增多可以逐渐增加但建议不要超出CPU的线程数
crawl:
update:
#爬虫自动更新的线程数
#建议小说数量不多或者正在运行新书入库爬虫的情况下设置为1即可
#随着小说数量的增多可以逐渐增加但建议不要超出CPU的线程数
thread: 1
# 采集间隔时间单位毫秒
interval:
min: 300
max: 500

View File

@ -144,6 +144,9 @@
示例:<b>&lt;script&gt;</b>
<li><input type="text" id="contentEnd" class="s_input icon_key"
placeholder="小说内容结束截取字符串"></li>
示例:<b>&lt;div\s+id=&quot;content_tip&quot;&gt;\s*&lt;b&gt;([^/]+)&lt;/b&gt;\s*&lt;/div&gt;</b>
<li><textarea id="filterContent"
placeholder="过滤内容多个内容换行" rows="5" cols="52"></textarea></li>
<li><input type="button" onclick="addCrawlSource()" name="btnRegister" value="提交"
id="btnRegister" class="btn_red"></li>
@ -405,6 +408,9 @@
crawlRule.contentEnd = contentEnd;
var filterContent = $("#filterContent").val();
crawlRule.filterContent = filterContent;
$.ajax({
type: "POST",

View File

@ -145,6 +145,10 @@
示例:<b>&lt;script&gt;</b>
<li><input type="text" id="contentEnd" class="s_input icon_key"
placeholder="小说内容结束截取字符串"></li>
示例:<b>&lt;div\s+id=&quot;content_tip&quot;&gt;\s*&lt;b&gt;([^/]+)&lt;/b&gt;\s*&lt;/div&gt;</b>
<li><textarea id="filterContent"
placeholder="过滤内容多个内容换行" rows="5" cols="52"></textarea></li>
<li><input type="button" onclick="updateCrawlSource()" name="btnRegister" value="提交"
id="btnRegister" class="btn_red"></li>
@ -269,6 +273,7 @@
$("#bookContentUrl").val(crawlRule.bookContentUrl);
$("#contentStart").val(crawlRule.contentStart);
$("#contentEnd").val(crawlRule.contentEnd);
$("#filterContent").val(crawlRule.filterContent);
}
}
@ -488,6 +493,9 @@
crawlRule.contentEnd = contentEnd;
var filterContent = $("#filterContent").val();
crawlRule.filterContent = filterContent;
$.ajax({
type: "POST",

View File

@ -6,9 +6,8 @@
<meta name="description" content="">
<meta name="author" content="">
<title>爬虫管理系统登录</title>
<link href="/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link href="/css/signin.css" rel="stylesheet" crossorigin="anonymous"/>
<link href="/css/bootstrap.min.css" rel="stylesheet"/>
<link href="/css/signin.css" rel="stylesheet"/>
<style>
.btn-primary {
color: #fff;

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>novel</artifactId>
<groupId>com.java2nb</groupId>
<version>4.3.0-RC1</version>
<version>4.4.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -34,7 +34,7 @@ pic:
#模版配置
templates:
name: orange
name: green
#小说内容保存配置
content:

View File

@ -51,7 +51,7 @@ public class PayController extends BaseController {
UserDetails userDetails = getUserDetails(request);
if (userDetails == null) {
//未登录,跳转到登陆页面
httpResponse.sendRedirect("/user/login.html?originUrl=/pay/aliPay?payAmount=" + payAmount);
httpResponse.sendRedirect("/user/login.html?originUrl=/pay/index.html");
} else {
//创建充值订单
Long outTradeNo = orderService.createPayOrder((byte) 1, payAmount, userDetails.getId());
@ -121,7 +121,7 @@ public class PayController extends BaseController {
PrintWriter out = httpResponse.getWriter();
//获取支付宝POST过来反馈信息
//获取支付宝POST过来信息
Map<String, String> params = new HashMap<>();
Map<String, String[]> requestParams = request.getParameterMap();
for (String name : requestParams.keySet()) {
@ -134,18 +134,10 @@ public class PayController extends BaseController {
params.put(name, valueStr);
}
//调用SDK验证签名
//验证签名
boolean signVerified = AlipaySignature.rsaCheckV1(params, alipayConfig.getPublicKey(),
alipayConfig.getCharset(), alipayConfig.getSignType());
//——请在这里编写您的程序(以下代码仅作参考)——
/* 实际验证过程建议商户务必添加以下校验:
1、需要验证该通知数据中的out_trade_no是否为商户系统中创建的订单号
2、判断total_amount是否确实为该订单的实际金额即商户订单创建时的金额
3、校验通知中的seller_id或者seller_email) 是否为out_trade_no这笔单据的对应的操作方有的时候一个商户可能有多个seller_id/seller_email
4、验证app_id是否为该商户本身。
*/
if (signVerified) {
//验证成功
//商户订单号
@ -160,21 +152,18 @@ public class PayController extends BaseController {
String tradeStatus = new String(request.getParameter("trade_status").getBytes(StandardCharsets.ISO_8859_1),
StandardCharsets.UTF_8);
//更新订单状态
orderService.updatePayOrder(Long.parseLong(outTradeNo), tradeNo, tradeStatus);
if ("TRADE_SUCCESS".equals(tradeStatus)) {
//支付成功
orderService.updatePayOrder(Long.parseLong(outTradeNo), tradeNo, 1);
}
out.println("success");
} else {//验证失败
out.println("fail");
//调试用,写文本函数记录程序运行情况是否正常
//String sWord = AlipaySignature.getSignCheckContentV1(params);
//AlipayConfig.logResult(sWord);
}
}
}

View File

@ -3,7 +3,9 @@ package com.java2nb.novel.core.schedule;
import com.java2nb.novel.core.config.AuthorIncomeProperties;
import com.java2nb.novel.core.utils.DateUtil;
import com.java2nb.novel.entity.*;
import com.java2nb.novel.entity.Author;
import com.java2nb.novel.entity.AuthorIncome;
import com.java2nb.novel.entity.Book;
import com.java2nb.novel.service.AuthorService;
import com.java2nb.novel.service.BookService;
import lombok.RequiredArgsConstructor;
@ -64,24 +66,23 @@ public class MonthIncomeStaSchedule {
Long bookId = book.getId();
//3.月收入数据未统计入库,分作品统计数据入库
Long monthIncome = authorService.queryTotalAccount(userId, bookId, startTime, endTime);
BigDecimal monthIncomeShare = new BigDecimal(monthIncome)
.multiply(authorIncomeConfig.getShareProportion());
.multiply(authorIncomeConfig.getShareProportion());
long preTaxIncome = monthIncomeShare
.multiply(authorIncomeConfig.getExchangeProportion())
.multiply(new BigDecimal(100))
.longValue();
.multiply(authorIncomeConfig.getExchangeProportion())
.multiply(new BigDecimal(100))
.longValue();
totalPreTaxIncome += preTaxIncome;
long afterTaxIncome = monthIncomeShare
.multiply(authorIncomeConfig.getTaxRate())
.multiply(authorIncomeConfig.getExchangeProportion())
.multiply(new BigDecimal(100))
.longValue();
.multiply(authorIncomeConfig.getTaxRate())
.multiply(authorIncomeConfig.getExchangeProportion())
.multiply(new BigDecimal(100))
.longValue();
totalAfterTaxIncome += afterTaxIncome;
@ -102,7 +103,7 @@ public class MonthIncomeStaSchedule {
}
if (totalPreTaxIncome > 0 && !authorService.queryIsStatisticsMonth(0L, endTime)) {
if (totalPreTaxIncome > 0 && !authorService.queryIsStatisticsMonth(authorId, 0L, endTime)) {
AuthorIncome authorIncome = new AuthorIncome();
authorIncome.setAuthorId(authorId);

View File

@ -0,0 +1,15 @@
package com.java2nb.novel.mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author Administrator
*/
public interface FrontUserMapper extends UserMapper {
void addUserBalance(@Param("userId") Long userId, @Param("amount") Integer amount);
}

View File

@ -1,10 +1,10 @@
package com.java2nb.novel.service;
import io.github.xxyopen.model.page.PageBean;
import com.java2nb.novel.entity.Author;
import com.java2nb.novel.entity.AuthorIncome;
import com.java2nb.novel.entity.AuthorIncomeDetail;
import io.github.xxyopen.model.page.PageBean;
import java.util.Date;
import java.util.List;
@ -16,45 +16,51 @@ public interface AuthorService {
/**
* 校验笔名是否存在
*
* @param penName 校验的笔名
* @return true存在该笔名false: 不存在该笔名
* */
*/
Boolean checkPenName(String penName);
/**
* 作家注册
*
* @param userId 注册用户ID
*@param author 注册信息
* @param author 注册信息
* @return 返回错误信息
* */
*/
String register(Long userId, Author author);
/**
* 判断是否是作家
*
* @param userId 用户ID
* @return true是作家false: 不是作家
* */
*/
Boolean isAuthor(Long userId);
/**
* 查询作家信息
*
* @param userId 用户ID
* @return 作家对象
* */
*/
Author queryAuthor(Long userId);
/**
* 查询作家列表
* @return 作家列表
* @param limit 查询条数
*
* @param limit 查询条数
* @param maxAuthorCreateTime 最大申请时间
* @return 作家列表
*/
List<Author> queryAuthorList(int limit, Date maxAuthorCreateTime);
/**
* 查询收入日统计是否入库
*
* @param bookId 作品ID
* @param date 收入时间
* @param date 收入时间
* @return true:已入库false未入库
*/
boolean queryIsStatisticsDaily(Long bookId, Date date);
@ -62,67 +68,75 @@ public interface AuthorService {
/**
* 保存日收入统计(按作品)
*
* @param authorIncomeDetail 收入详情
* */
*/
void saveDailyIncomeSta(AuthorIncomeDetail authorIncomeDetail);
/**
* 查询月收入统计是否入库
* @param bookId 作品ID
*
* @param bookId 作品ID
* @param incomeDate 收入时间
* @return true:已入库false未入库
* */
*/
boolean queryIsStatisticsMonth(Long bookId, Date incomeDate);
boolean queryIsStatisticsMonth(Long authorId, Long bookId, Date incomeDate);
/**
* 查询时间段内总订阅额
*
* @param userId
* @param bookId 作品ID
* @param bookId 作品ID
* @param startTime 开始时间
* @param endTime 结束时间
* @param endTime 结束时间
* @return 订阅额(屋币)
* */
*/
Long queryTotalAccount(Long userId, Long bookId, Date startTime, Date endTime);
/**
* 保存月收入统计
*
* @param authorIncome 收入详情
* */
*/
void saveAuthorIncomeSta(AuthorIncome authorIncome);
/**
* 查询收入日统计是否入库
*
* @param authorId 作家ID
* @param bookId 作品ID
* @param date 收入时间
* @param bookId 作品ID
* @param date 收入时间
* @return true:已入库false未入库
*/
boolean queryIsStatisticsDaily(Long authorId, Long bookId, Date date);
/**
*作家日收入统计数据分页列表查询
* 作家日收入统计数据分页列表查询
*
* @param userId
* @param page 页码
* @param pageSize 分页大小
* @param bookId 小说ID
* @param page 页码
* @param pageSize 分页大小
* @param bookId 小说ID
* @param startTime 开始时间
* @param endTime 结束时间
* @param endTime 结束时间
* @return 日收入统计数据分页数据
*/
PageBean<AuthorIncomeDetail> listIncomeDailyByPage(int page, int pageSize, Long userId, Long bookId, Date startTime, Date endTime);
PageBean<AuthorIncomeDetail> listIncomeDailyByPage(int page, int pageSize, Long userId, Long bookId, Date startTime,
Date endTime);
/**
* 作家月收入统计数据分页列表查询
* @param page 页码
*
* @param page 页码
* @param pageSize 分页大小
* @param userId 用户ID
* @param bookId 小说ID
* @param userId 用户ID
* @param bookId 小说ID
* @return 分页数据
* */
*/
PageBean<AuthorIncome> listIncomeMonthByPage(int page, int pageSize, Long userId, Long bookId);
}

View File

@ -1,7 +1,6 @@
package com.java2nb.novel.service;
/**
* @author 11797
*/
@ -12,18 +11,19 @@ public interface OrderService {
* 创建充值订单
*
* @param payChannel 支付渠道
* @param payAmount 支付金额
* @param userId 用户ID
* @param payAmount 支付金额
* @param userId 用户ID
* @return 商户订单号
* */
*/
Long createPayOrder(Byte payChannel, Integer payAmount, Long userId);
/**
* 更新订单状态
*
* @param outTradeNo 商户订单号
* @param tradeNo 支付宝/微信 订单号
* @param tradeStatus 支付状态
* */
void updatePayOrder(Long outTradeNo, String tradeNo, String tradeStatus);
* @param tradeNo 支付宝/微信 订单号
* @param payStatus 支付状态
*/
void updatePayOrder(Long outTradeNo, String tradeNo, int payStatus);
}

View File

@ -1,23 +1,15 @@
package com.java2nb.novel.service.impl;
import com.github.pagehelper.PageHelper;
import io.github.xxyopen.model.page.PageBean;
import com.java2nb.novel.core.cache.CacheKey;
import com.java2nb.novel.core.cache.CacheService;
import com.java2nb.novel.core.enums.ResponseStatus;
import io.github.xxyopen.model.page.builder.pagehelper.PageBuilder;
import io.github.xxyopen.web.exception.BusinessException;
import com.java2nb.novel.entity.Author;
import com.java2nb.novel.entity.AuthorIncome;
import com.java2nb.novel.entity.AuthorIncomeDetail;
import com.java2nb.novel.entity.FriendLink;
import com.java2nb.novel.mapper.*;
import com.java2nb.novel.service.AuthorService;
import com.java2nb.novel.service.FriendLinkService;
import io.github.xxyopen.model.page.PageBean;
import io.github.xxyopen.model.page.builder.pagehelper.PageBuilder;
import lombok.RequiredArgsConstructor;
import org.mybatis.dynamic.sql.render.RenderingStrategies;
import org.mybatis.dynamic.sql.select.CountDSLCompleter;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -25,10 +17,6 @@ import java.util.Date;
import java.util.List;
import static com.java2nb.novel.mapper.AuthorCodeDynamicSqlSupport.authorCode;
import static com.java2nb.novel.mapper.BookDynamicSqlSupport.book;
import static com.java2nb.novel.mapper.BookDynamicSqlSupport.id;
import static com.java2nb.novel.mapper.BookDynamicSqlSupport.updateTime;
import static com.java2nb.novel.mapper.FriendLinkDynamicSqlSupport.*;
import static org.mybatis.dynamic.sql.SqlBuilder.*;
import static org.mybatis.dynamic.sql.select.SelectDSL.select;
@ -52,7 +40,7 @@ public class AuthorServiceImpl implements AuthorService {
@Override
public Boolean checkPenName(String penName) {
return authorMapper.count(c ->
c.where(AuthorDynamicSqlSupport.penName, isEqualTo(penName))) > 0;
c.where(AuthorDynamicSqlSupport.penName, isEqualTo(penName))) > 0;
}
@Transactional(rollbackFor = Exception.class)
@ -61,21 +49,21 @@ public class AuthorServiceImpl implements AuthorService {
Date currentDate = new Date();
//判断邀请码是否有效
if (authorCodeMapper.count(c ->
c.where(AuthorCodeDynamicSqlSupport.inviteCode, isEqualTo(author.getInviteCode()))
.and(AuthorCodeDynamicSqlSupport.isUse, isEqualTo((byte) 0))
.and(AuthorCodeDynamicSqlSupport.validityTime, isGreaterThan(currentDate))) > 0) {
//邀请码有效
c.where(AuthorCodeDynamicSqlSupport.inviteCode, isEqualTo(author.getInviteCode()))
.and(AuthorCodeDynamicSqlSupport.isUse, isEqualTo((byte) 0))
.and(AuthorCodeDynamicSqlSupport.validityTime, isGreaterThan(currentDate))) > 0) {
//邀请码有效
//保存作家信息
author.setUserId(userId);
author.setCreateTime(currentDate);
authorMapper.insertSelective(author);
//设置邀请码状态为已使用
authorCodeMapper.update(update(authorCode)
.set(AuthorCodeDynamicSqlSupport.isUse)
.equalTo((byte) 1)
.where(AuthorCodeDynamicSqlSupport.inviteCode,isEqualTo(author.getInviteCode()))
.build()
.render(RenderingStrategies.MYBATIS3));
.set(AuthorCodeDynamicSqlSupport.isUse)
.equalTo((byte) 1)
.where(AuthorCodeDynamicSqlSupport.inviteCode, isEqualTo(author.getInviteCode()))
.build()
.render(RenderingStrategies.MYBATIS3));
return "";
} else {
//邀请码无效
@ -87,15 +75,15 @@ public class AuthorServiceImpl implements AuthorService {
@Override
public Boolean isAuthor(Long userId) {
return authorMapper.count(c ->
c.where(AuthorDynamicSqlSupport.userId, isEqualTo(userId))) > 0;
c.where(AuthorDynamicSqlSupport.userId, isEqualTo(userId))) > 0;
}
@Override
public Author queryAuthor(Long userId) {
return authorMapper.selectMany(
select(AuthorDynamicSqlSupport.id,AuthorDynamicSqlSupport.penName,AuthorDynamicSqlSupport.status)
.from(AuthorDynamicSqlSupport.author)
.where(AuthorDynamicSqlSupport.userId,isEqualTo(userId))
select(AuthorDynamicSqlSupport.id, AuthorDynamicSqlSupport.penName, AuthorDynamicSqlSupport.status)
.from(AuthorDynamicSqlSupport.author)
.where(AuthorDynamicSqlSupport.userId, isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3)).get(0);
}
@ -103,12 +91,12 @@ public class AuthorServiceImpl implements AuthorService {
@Override
public List<Author> queryAuthorList(int needAuthorNumber, Date maxAuthorCreateTime) {
return authorMapper.selectMany(select(AuthorDynamicSqlSupport.id, AuthorDynamicSqlSupport.userId)
.from(AuthorDynamicSqlSupport.author)
.where(AuthorDynamicSqlSupport.createTime, isLessThan(maxAuthorCreateTime))
.orderBy(AuthorDynamicSqlSupport.createTime.descending())
.limit(needAuthorNumber)
.build()
.render(RenderingStrategies.MYBATIS3));
.from(AuthorDynamicSqlSupport.author)
.where(AuthorDynamicSqlSupport.createTime, isLessThan(maxAuthorCreateTime))
.orderBy(AuthorDynamicSqlSupport.createTime.descending())
.limit(needAuthorNumber)
.build()
.render(RenderingStrategies.MYBATIS3));
}
@ -116,11 +104,11 @@ public class AuthorServiceImpl implements AuthorService {
public boolean queryIsStatisticsDaily(Long bookId, Date date) {
return authorIncomeDetailMapper.selectMany(select(AuthorIncomeDetailDynamicSqlSupport.id)
.from(AuthorIncomeDetailDynamicSqlSupport.authorIncomeDetail)
.where(AuthorIncomeDetailDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isEqualTo(date))
.build()
.render(RenderingStrategies.MYBATIS3)).size() > 0;
.from(AuthorIncomeDetailDynamicSqlSupport.authorIncomeDetail)
.where(AuthorIncomeDetailDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isEqualTo(date))
.build()
.render(RenderingStrategies.MYBATIS3)).size() > 0;
}
@ -133,24 +121,35 @@ public class AuthorServiceImpl implements AuthorService {
@Override
public boolean queryIsStatisticsMonth(Long bookId, Date incomeDate) {
return authorIncomeMapper.selectMany(select(AuthorIncomeDynamicSqlSupport.id)
.from(AuthorIncomeDynamicSqlSupport.authorIncome)
.where(AuthorIncomeDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDynamicSqlSupport.incomeMonth, isEqualTo(incomeDate))
.build()
.render(RenderingStrategies.MYBATIS3)).size() > 0;
.from(AuthorIncomeDynamicSqlSupport.authorIncome)
.where(AuthorIncomeDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDynamicSqlSupport.incomeMonth, isEqualTo(incomeDate))
.build()
.render(RenderingStrategies.MYBATIS3)).size() > 0;
}
@Override
public boolean queryIsStatisticsMonth(Long authorId, Long bookId, Date incomeDate) {
return authorIncomeMapper.selectMany(select(AuthorIncomeDynamicSqlSupport.id)
.from(AuthorIncomeDynamicSqlSupport.authorIncome)
.where(AuthorIncomeDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDynamicSqlSupport.authorId, isEqualTo(authorId))
.and(AuthorIncomeDynamicSqlSupport.incomeMonth, isEqualTo(incomeDate))
.build()
.render(RenderingStrategies.MYBATIS3)).size() > 0;
}
@Override
public Long queryTotalAccount(Long userId, Long bookId, Date startTime, Date endTime) {
return authorIncomeDetailMapper.selectStatistic(select(sum(AuthorIncomeDetailDynamicSqlSupport.incomeAccount))
.from(AuthorIncomeDetailDynamicSqlSupport.authorIncomeDetail)
.where(AuthorIncomeDetailDynamicSqlSupport.userId, isEqualTo(userId))
.and(AuthorIncomeDetailDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isGreaterThanOrEqualTo(startTime))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
.from(AuthorIncomeDetailDynamicSqlSupport.authorIncomeDetail)
.where(AuthorIncomeDetailDynamicSqlSupport.userId, isEqualTo(userId))
.and(AuthorIncomeDetailDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isGreaterThanOrEqualTo(startTime))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
}
@ -162,29 +161,30 @@ public class AuthorServiceImpl implements AuthorService {
@Override
public boolean queryIsStatisticsDaily(Long authorId, Long bookId, Date date) {
return authorIncomeDetailMapper.selectMany(select(AuthorIncomeDetailDynamicSqlSupport.id)
.from(AuthorIncomeDetailDynamicSqlSupport.authorIncomeDetail)
.where(AuthorIncomeDetailDynamicSqlSupport.authorId, isEqualTo(authorId))
.and(AuthorIncomeDetailDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isEqualTo(date))
.build()
.render(RenderingStrategies.MYBATIS3)).size() > 0;
.from(AuthorIncomeDetailDynamicSqlSupport.authorIncomeDetail)
.where(AuthorIncomeDetailDynamicSqlSupport.authorId, isEqualTo(authorId))
.and(AuthorIncomeDetailDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isEqualTo(date))
.build()
.render(RenderingStrategies.MYBATIS3)).size() > 0;
}
@Override
public PageBean<AuthorIncomeDetail> listIncomeDailyByPage(int page, int pageSize, Long userId, Long bookId, Date startTime, Date endTime) {
public PageBean<AuthorIncomeDetail> listIncomeDailyByPage(int page, int pageSize, Long userId, Long bookId,
Date startTime, Date endTime) {
PageHelper.startPage(page, pageSize);
return PageBuilder.build(authorIncomeDetailMapper.selectMany(
select(AuthorIncomeDetailDynamicSqlSupport.incomeDate, AuthorIncomeDetailDynamicSqlSupport.incomeAccount
, AuthorIncomeDetailDynamicSqlSupport.incomeCount, AuthorIncomeDetailDynamicSqlSupport.incomeNumber)
.from(AuthorIncomeDetailDynamicSqlSupport.authorIncomeDetail)
.where(AuthorIncomeDetailDynamicSqlSupport.userId, isEqualTo(userId))
.and(AuthorIncomeDetailDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isGreaterThanOrEqualTo(startTime))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isLessThanOrEqualTo(endTime))
.orderBy(AuthorIncomeDetailDynamicSqlSupport.incomeDate.descending())
.build()
.render(RenderingStrategies.MYBATIS3)));
select(AuthorIncomeDetailDynamicSqlSupport.incomeDate, AuthorIncomeDetailDynamicSqlSupport.incomeAccount
, AuthorIncomeDetailDynamicSqlSupport.incomeCount, AuthorIncomeDetailDynamicSqlSupport.incomeNumber)
.from(AuthorIncomeDetailDynamicSqlSupport.authorIncomeDetail)
.where(AuthorIncomeDetailDynamicSqlSupport.userId, isEqualTo(userId))
.and(AuthorIncomeDetailDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isGreaterThanOrEqualTo(startTime))
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isLessThanOrEqualTo(endTime))
.orderBy(AuthorIncomeDetailDynamicSqlSupport.incomeDate.descending())
.build()
.render(RenderingStrategies.MYBATIS3)));
}
@ -192,15 +192,15 @@ public class AuthorServiceImpl implements AuthorService {
public PageBean<AuthorIncome> listIncomeMonthByPage(int page, int pageSize, Long userId, Long bookId) {
PageHelper.startPage(page, pageSize);
return PageBuilder.build(authorIncomeMapper.selectMany(select(AuthorIncomeDynamicSqlSupport.incomeMonth
, AuthorIncomeDynamicSqlSupport.preTaxIncome
, AuthorIncomeDynamicSqlSupport.afterTaxIncome
, AuthorIncomeDynamicSqlSupport.payStatus
, AuthorIncomeDynamicSqlSupport.confirmStatus)
.from(AuthorIncomeDynamicSqlSupport.authorIncome)
.where(AuthorIncomeDynamicSqlSupport.userId, isEqualTo(userId))
.and(AuthorIncomeDynamicSqlSupport.bookId, isEqualTo(bookId))
.orderBy(AuthorIncomeDynamicSqlSupport.incomeMonth.descending())
.build()
.render(RenderingStrategies.MYBATIS3)));
, AuthorIncomeDynamicSqlSupport.preTaxIncome
, AuthorIncomeDynamicSqlSupport.afterTaxIncome
, AuthorIncomeDynamicSqlSupport.payStatus
, AuthorIncomeDynamicSqlSupport.confirmStatus)
.from(AuthorIncomeDynamicSqlSupport.authorIncome)
.where(AuthorIncomeDynamicSqlSupport.userId, isEqualTo(userId))
.and(AuthorIncomeDynamicSqlSupport.bookId, isEqualTo(bookId))
.orderBy(AuthorIncomeDynamicSqlSupport.incomeMonth.descending())
.build()
.render(RenderingStrategies.MYBATIS3)));
}
}

View File

@ -9,6 +9,7 @@ import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.mybatis.dynamic.sql.render.RenderingStrategies;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -17,6 +18,7 @@ import java.util.Date;
import java.util.Random;
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
import static org.mybatis.dynamic.sql.SqlBuilder.update;
import static org.mybatis.dynamic.sql.select.SelectDSL.select;
/**
@ -35,7 +37,8 @@ public class OrderServiceImpl implements OrderService {
@Override
public Long createPayOrder(Byte payChannel, Integer payAmount, Long userId) {
Date currentDate = new Date();
Long outTradeNo = Long.parseLong(new SimpleDateFormat("yyyyMMddHHmmssSSS").format(currentDate)+new Random().nextInt(10));
Long outTradeNo = Long.parseLong(
new SimpleDateFormat("yyyyMMddHHmmssSSS").format(currentDate) + new Random().nextInt(10));
OrderPay orderPay = new OrderPay();
orderPay.setOutTradeNo(outTradeNo);
orderPay.setPayChannel(payChannel);
@ -49,37 +52,39 @@ public class OrderServiceImpl implements OrderService {
@Transactional(rollbackFor = Exception.class)
@Override
public void updatePayOrder(Long outTradeNo, String tradeNo, String tradeStatus) {
SelectStatementProvider selectStatement = select(OrderPayDynamicSqlSupport.id,OrderPayDynamicSqlSupport.payStatus,OrderPayDynamicSqlSupport.totalAmount,OrderPayDynamicSqlSupport.userId)
.from(OrderPayDynamicSqlSupport.orderPay)
.where(OrderPayDynamicSqlSupport.outTradeNo, isEqualTo(outTradeNo))
.build()
.render(RenderingStrategies.MYBATIS3);
public void updatePayOrder(Long outTradeNo, String tradeNo, int payStatus) {
SelectStatementProvider selectStatement = select(OrderPayDynamicSqlSupport.id,
OrderPayDynamicSqlSupport.payStatus, OrderPayDynamicSqlSupport.totalAmount,
OrderPayDynamicSqlSupport.userId)
.from(OrderPayDynamicSqlSupport.orderPay)
.where(OrderPayDynamicSqlSupport.outTradeNo, isEqualTo(outTradeNo))
.build()
.render(RenderingStrategies.MYBATIS3);
OrderPay orderPay = orderPayMapper.selectMany(selectStatement).get(0);
OrderPay orderPay = orderPayMapper.selectOne(selectStatement).orElse(null);
if(orderPay.getPayStatus()!=1) {
//此订单还未处理
if (tradeStatus.equals("TRADE_SUCCESS") || tradeStatus.equals("TRADE_FINISHED")) {
if (orderPay.getPayStatus().intValue() == 2) {
//待支付订单处理
if (payStatus == 1) {
//支付成功
//1.更新订单状态为成功
orderPay.setPayStatus((byte) 1);
orderPay.setUpdateTime(new Date());
orderPayMapper.updateByPrimaryKeySelective(orderPay);
//2.增加用户余额
userService.addAmount(orderPay.getUserId(),orderPay.getTotalAmount()*100);
UpdateStatementProvider updateStatement = update(OrderPayDynamicSqlSupport.orderPay)
.set(OrderPayDynamicSqlSupport.tradeNo).equalTo(tradeNo)
.set(OrderPayDynamicSqlSupport.payStatus).equalTo((byte) 1)
.set(OrderPayDynamicSqlSupport.updateTime).equalTo(new Date())
.where(OrderPayDynamicSqlSupport.id, isEqualTo(orderPay.getId()))
.and(OrderPayDynamicSqlSupport.payStatus, isEqualTo((byte) 2))
.build()
.render(RenderingStrategies.MYBATIS3);
int updateRow = orderPayMapper.update(updateStatement);
if (updateRow > 0) {
//更新成功
//2.增加用户余额
userService.addAmount(orderPay.getUserId(), orderPay.getTotalAmount() * 100);
}
}
}
}
}

View File

@ -1,20 +1,20 @@
package com.java2nb.novel.service.impl;
import com.github.pagehelper.PageHelper;
import io.github.xxyopen.model.page.PageBean;
import com.java2nb.novel.core.bean.UserDetails;
import com.java2nb.novel.entity.*;
import com.java2nb.novel.entity.User;
import com.java2nb.novel.service.UserService;
import com.java2nb.novel.core.enums.ResponseStatus;
import com.java2nb.novel.entity.User;
import com.java2nb.novel.entity.*;
import com.java2nb.novel.mapper.*;
import com.java2nb.novel.service.UserService;
import com.java2nb.novel.vo.BookReadHistoryVO;
import com.java2nb.novel.vo.BookShelfVO;
import com.java2nb.novel.vo.UserFeedbackVO;
import io.github.xxyopen.model.page.PageBean;
import io.github.xxyopen.model.page.builder.pagehelper.PageBuilder;
import io.github.xxyopen.util.IdWorker;
import io.github.xxyopen.util.MD5Util;
import io.github.xxyopen.web.exception.BusinessException;
import com.java2nb.novel.mapper.*;
import com.java2nb.novel.vo.BookReadHistoryVO;
import com.java2nb.novel.vo.BookShelfVO;
import com.java2nb.novel.vo.UserFeedbackVO;
import io.github.xxyopen.web.util.BeanUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -46,7 +46,7 @@ import static org.mybatis.dynamic.sql.select.SelectDSL.select;
@RequiredArgsConstructor
public class UserServiceImpl implements UserService {
private final UserMapper userMapper;
private final FrontUserMapper userMapper;
private final FrontUserBookshelfMapper userBookshelfMapper;
@ -63,17 +63,17 @@ public class UserServiceImpl implements UserService {
public UserDetails register(User user) {
//查询用户名是否已注册
SelectStatementProvider selectStatement = select(count(id))
.from(UserDynamicSqlSupport.user)
.where(username, isEqualTo(user.getUsername()))
.build()
.render(RenderingStrategies.MYBATIS3);
.from(UserDynamicSqlSupport.user)
.where(username, isEqualTo(user.getUsername()))
.build()
.render(RenderingStrategies.MYBATIS3);
long count = userMapper.count(selectStatement);
if (count > 0) {
//用户名已注册
throw new BusinessException(ResponseStatus.USERNAME_EXIST);
}
User entity = new User();
BeanUtils.copyProperties(user,entity);
BeanUtils.copyProperties(user, entity);
//数据库生成注册记录
Long id = idWorker.nextId();
entity.setId(id);
@ -94,12 +94,12 @@ public class UserServiceImpl implements UserService {
@Override
public UserDetails login(User user) {
//根据用户名密码查询记录
SelectStatementProvider selectStatement = select(id, username,nickName)
.from(UserDynamicSqlSupport.user)
.where(username, isEqualTo(user.getUsername()))
.and(password, isEqualTo(MD5Util.MD5Encode(user.getPassword(), Charsets.UTF_8.name())))
.build()
.render(RenderingStrategies.MYBATIS3);
SelectStatementProvider selectStatement = select(id, username, nickName)
.from(UserDynamicSqlSupport.user)
.where(username, isEqualTo(user.getUsername()))
.and(password, isEqualTo(MD5Util.MD5Encode(user.getPassword(), Charsets.UTF_8.name())))
.build()
.render(RenderingStrategies.MYBATIS3);
List<User> users = userMapper.selectMany(selectStatement);
if (users.size() == 0) {
throw new BusinessException(ResponseStatus.USERNAME_PASS_ERROR);
@ -116,11 +116,11 @@ public class UserServiceImpl implements UserService {
@Override
public Boolean queryIsInShelf(Long userId, Long bookId) {
SelectStatementProvider selectStatement = select(count(UserBookshelfDynamicSqlSupport.id))
.from(userBookshelf)
.where(UserBookshelfDynamicSqlSupport.userId, isEqualTo(userId))
.and(UserBookshelfDynamicSqlSupport.bookId, isEqualTo(bookId))
.build()
.render(RenderingStrategies.MYBATIS3);
.from(userBookshelf)
.where(UserBookshelfDynamicSqlSupport.userId, isEqualTo(userId))
.and(UserBookshelfDynamicSqlSupport.bookId, isEqualTo(bookId))
.build()
.render(RenderingStrategies.MYBATIS3);
return userBookshelfMapper.count(selectStatement) > 0;
}
@ -141,10 +141,10 @@ public class UserServiceImpl implements UserService {
@Override
public void removeFromBookShelf(Long userId, Long bookId) {
DeleteStatementProvider deleteStatement = deleteFrom(userBookshelf)
.where(UserBookshelfDynamicSqlSupport.userId, isEqualTo(userId))
.and(UserBookshelfDynamicSqlSupport.bookId, isEqualTo(bookId))
.build()
.render(RenderingStrategies.MYBATIS3);
.where(UserBookshelfDynamicSqlSupport.userId, isEqualTo(userId))
.and(UserBookshelfDynamicSqlSupport.bookId, isEqualTo(bookId))
.build()
.render(RenderingStrategies.MYBATIS3);
userBookshelfMapper.delete(deleteStatement);
}
@ -162,10 +162,10 @@ public class UserServiceImpl implements UserService {
Date currentDate = new Date();
//删除该书以前的历史记录
DeleteStatementProvider deleteStatement = deleteFrom(userReadHistory)
.where(UserReadHistoryDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(UserReadHistoryDynamicSqlSupport.userId, isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3);
.where(UserReadHistoryDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(UserReadHistoryDynamicSqlSupport.userId, isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3);
userReadHistoryMapper.delete(deleteStatement);
//插入该书新的历史记录
@ -177,17 +177,16 @@ public class UserServiceImpl implements UserService {
userReadHistory.setUpdateTime(currentDate);
userReadHistoryMapper.insertSelective(userReadHistory);
//更新书架的阅读历史
UpdateStatementProvider updateStatement = update(userBookshelf)
.set(UserBookshelfDynamicSqlSupport.preContentId)
.equalTo(preContentId)
.set(UserBookshelfDynamicSqlSupport.updateTime)
.equalTo(currentDate)
.where(UserBookshelfDynamicSqlSupport.userId, isEqualTo(userId))
.and(UserBookshelfDynamicSqlSupport.bookId, isEqualTo(bookId))
.build()
.render(RenderingStrategies.MYBATIS3);
.set(UserBookshelfDynamicSqlSupport.preContentId)
.equalTo(preContentId)
.set(UserBookshelfDynamicSqlSupport.updateTime)
.equalTo(currentDate)
.where(UserBookshelfDynamicSqlSupport.userId, isEqualTo(userId))
.and(UserBookshelfDynamicSqlSupport.bookId, isEqualTo(bookId))
.build()
.render(RenderingStrategies.MYBATIS3);
userBookshelfMapper.update(updateStatement);
@ -206,25 +205,26 @@ public class UserServiceImpl implements UserService {
@Override
public PageBean<UserFeedback> listUserFeedBackByPage(Long userId, int page, int pageSize) {
PageHelper.startPage(page, pageSize);
SelectStatementProvider selectStatement = select(UserFeedbackDynamicSqlSupport.content, UserFeedbackDynamicSqlSupport.createTime)
.from(userFeedback)
.where(UserFeedbackDynamicSqlSupport.userId, isEqualTo(userId))
.orderBy(UserFeedbackDynamicSqlSupport.id.descending())
.build()
.render(RenderingStrategies.MYBATIS3);
SelectStatementProvider selectStatement = select(UserFeedbackDynamicSqlSupport.content,
UserFeedbackDynamicSqlSupport.createTime)
.from(userFeedback)
.where(UserFeedbackDynamicSqlSupport.userId, isEqualTo(userId))
.orderBy(UserFeedbackDynamicSqlSupport.id.descending())
.build()
.render(RenderingStrategies.MYBATIS3);
List<UserFeedback> userFeedbacks = userFeedbackMapper.selectMany(selectStatement);
PageBean<UserFeedback> pageBean = PageBuilder.build(userFeedbacks);
pageBean.setList(BeanUtil.copyList(userFeedbacks,UserFeedbackVO.class));
pageBean.setList(BeanUtil.copyList(userFeedbacks, UserFeedbackVO.class));
return pageBean;
}
@Override
public User userInfo(Long userId) {
SelectStatementProvider selectStatement = select(username, nickName, userPhoto,userSex,accountBalance)
.from(user)
.where(id, isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3);
SelectStatementProvider selectStatement = select(username, nickName, userPhoto, userSex, accountBalance)
.from(user)
.where(id, isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3);
return userMapper.selectMany(selectStatement).get(0);
}
@ -245,39 +245,35 @@ public class UserServiceImpl implements UserService {
@Override
public void updatePassword(Long userId, String oldPassword, String newPassword) {
SelectStatementProvider selectStatement = select(password)
.from(user)
.where(id,isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3);
if(!userMapper.selectMany(selectStatement).get(0).getPassword().equals(MD5Util.MD5Encode(oldPassword, Charsets.UTF_8.name()))){
.from(user)
.where(id, isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3);
if (!userMapper.selectMany(selectStatement).get(0).getPassword()
.equals(MD5Util.MD5Encode(oldPassword, Charsets.UTF_8.name()))) {
throw new BusinessException(ResponseStatus.OLD_PASSWORD_ERROR);
}
UpdateStatementProvider updateStatement = update(user)
.set(password)
.equalTo(MD5Util.MD5Encode(newPassword, Charsets.UTF_8.name()))
.where(id,isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3);
.set(password)
.equalTo(MD5Util.MD5Encode(newPassword, Charsets.UTF_8.name()))
.where(id, isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3);
userMapper.update(updateStatement);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void addAmount(Long userId, int amount) {
User user = this.userInfo(userId);
user.setId(userId);
user.setAccountBalance(user.getAccountBalance()+amount);
userMapper.updateByPrimaryKeySelective(user);
userMapper.addUserBalance(userId, amount);
}
@Override
public boolean queryIsBuyBookIndex(Long userId, Long bookIndexId) {
return userBuyRecordMapper.count(c ->
c.where(UserBuyRecordDynamicSqlSupport.userId, isEqualTo(userId))
.and(UserBuyRecordDynamicSqlSupport.bookIndexId,isEqualTo(bookIndexId))) > 0;
c.where(UserBuyRecordDynamicSqlSupport.userId, isEqualTo(userId))
.and(UserBuyRecordDynamicSqlSupport.bookIndexId, isEqualTo(bookIndexId))) > 0;
}
@Transactional(rollbackFor = Exception.class)
@ -285,7 +281,7 @@ public class UserServiceImpl implements UserService {
public void buyBookIndex(Long userId, UserBuyRecord buyRecord) {
//查询用户余额
long balance = userInfo(userId).getAccountBalance();
if(balance<buyRecord.getBuyAmount()){
if (balance < buyRecord.getBuyAmount()) {
//余额不足
throw new BusinessException(ResponseStatus.USER_NO_BALANCE);
}
@ -296,60 +292,56 @@ public class UserServiceImpl implements UserService {
//减少用户余额
userMapper.update(update(user)
.set(UserDynamicSqlSupport.accountBalance)
.equalTo(balance-buyRecord.getBuyAmount())
.where(id,isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3));
.set(UserDynamicSqlSupport.accountBalance)
.equalTo(balance - buyRecord.getBuyAmount())
.where(id, isEqualTo(userId))
.build()
.render(RenderingStrategies.MYBATIS3));
}
@Override
public int queryBuyMember(Long bookId, Date startTime, Date endTime) {
return userMapper.selectStatistic(select(countDistinct(UserBuyRecordDynamicSqlSupport.userId))
.from(UserBuyRecordDynamicSqlSupport.userBuyRecord)
.where(UserBuyRecordDynamicSqlSupport.bookId,isEqualTo(bookId))
.and(UserBuyRecordDynamicSqlSupport.createTime,isGreaterThanOrEqualTo(startTime))
.and(UserBuyRecordDynamicSqlSupport.createTime,isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
.from(UserBuyRecordDynamicSqlSupport.userBuyRecord)
.where(UserBuyRecordDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(UserBuyRecordDynamicSqlSupport.createTime, isGreaterThanOrEqualTo(startTime))
.and(UserBuyRecordDynamicSqlSupport.createTime, isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
}
@Override
public int queryBuyCount(Long bookId, Date startTime, Date endTime) {
return userMapper.selectStatistic(select(count(UserBuyRecordDynamicSqlSupport.id))
.from(UserBuyRecordDynamicSqlSupport.userBuyRecord)
.where(UserBuyRecordDynamicSqlSupport.bookId,isEqualTo(bookId))
.and(UserBuyRecordDynamicSqlSupport.createTime,isGreaterThanOrEqualTo(startTime))
.and(UserBuyRecordDynamicSqlSupport.createTime,isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
.from(UserBuyRecordDynamicSqlSupport.userBuyRecord)
.where(UserBuyRecordDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(UserBuyRecordDynamicSqlSupport.createTime, isGreaterThanOrEqualTo(startTime))
.and(UserBuyRecordDynamicSqlSupport.createTime, isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
}
@Override
public int queryBuyAccount(Long bookId, Date startTime, Date endTime) {
return userMapper.selectStatistic(select(sum(UserBuyRecordDynamicSqlSupport.buyAmount))
.from(UserBuyRecordDynamicSqlSupport.userBuyRecord)
.where(UserBuyRecordDynamicSqlSupport.bookId,isEqualTo(bookId))
.and(UserBuyRecordDynamicSqlSupport.createTime,isGreaterThanOrEqualTo(startTime))
.and(UserBuyRecordDynamicSqlSupport.createTime,isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
.from(UserBuyRecordDynamicSqlSupport.userBuyRecord)
.where(UserBuyRecordDynamicSqlSupport.bookId, isEqualTo(bookId))
.and(UserBuyRecordDynamicSqlSupport.createTime, isGreaterThanOrEqualTo(startTime))
.and(UserBuyRecordDynamicSqlSupport.createTime, isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
}
@Override
public int queryBuyTotalMember(List<Long> bookIds, Date startTime, Date endTime) {
return userMapper.selectStatistic(select(countDistinct(UserBuyRecordDynamicSqlSupport.userId))
.from(UserBuyRecordDynamicSqlSupport.userBuyRecord)
.where(UserBuyRecordDynamicSqlSupport.bookId,isIn(bookIds))
.and(UserBuyRecordDynamicSqlSupport.createTime,isGreaterThanOrEqualTo(startTime))
.and(UserBuyRecordDynamicSqlSupport.createTime,isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
.from(UserBuyRecordDynamicSqlSupport.userBuyRecord)
.where(UserBuyRecordDynamicSqlSupport.bookId, isIn(bookIds))
.and(UserBuyRecordDynamicSqlSupport.createTime, isGreaterThanOrEqualTo(startTime))
.and(UserBuyRecordDynamicSqlSupport.createTime, isLessThanOrEqualTo(endTime))
.build()
.render(RenderingStrategies.MYBATIS3));
}
}

View File

@ -34,35 +34,41 @@
</select>
<update id="addVisitCount" >
update book set visit_count = visit_count + ${visitCount}
<update id="addVisitCount">
update book
set visit_count = visit_count + ${visitCount}
where id = #{bookId}
</update>
<select id="listRecBookByCatId" parameterType="int" resultType="com.java2nb.novel.entity.Book">
select id,pic_url,book_name,book_desc
select id, pic_url, book_name, book_desc
from book
where cat_id = #{catId}
and word_count > 0
order by RAND() LIMIT 4
</select>
<update id="addCommentCount" parameterType="long">
update book set comment_count = comment_count+1
where id = #{bookId}
update book
set comment_count = comment_count + 1
where id = #{bookId}
</update>
<select id="queryNetworkPicBooks" resultType="com.java2nb.novel.entity.Book">
select
id,pic_url from book
select id,
pic_url
from book
where pic_url like 'http%'
and pic_url not like concat('%',#{localPicPrefix},'%')
limit #{limit}
and pic_url not like concat('%', #{localPicPrefix}, '%')
limit #{limit}
</select>
<select id="selectIdsByScoreAndRandom" parameterType="int" resultType="com.java2nb.novel.entity.Book">
select id,book_name,author_name,pic_url,book_desc,score from book ORDER BY score,RAND() LIMIT #{limit};
</select>
select id, book_name, author_name, pic_url, book_desc, score
from book
ORDER BY score, RAND() LIMIT #{limit};
</select>
</mapper>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.java2nb.novel.mapper.FrontUserMapper">
<update id="addUserBalance" >
update user set account_balance = account_balance + ${amount}
where id = #{userId}
</update>
</mapper>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -27,15 +27,14 @@
if (layerStatus == 1) {
$("#cFavs").html("<a class=\"ico_shelf\" href=\"javascript:void(0);\"><b>已收藏</b></a>");
jQuery.cookie("u-faorites", "1");
}
else {
} else {
$("#cFavs").html("<a class=\"btn_ora_white btn_addsj\" href=\"javascript:void(0);\">已在书架</a>");
}
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -91,7 +90,7 @@
}
},
SaveComment: function (cmtBId, cmtCId, cmtDetail) {
if(!isLogin){
if (!isLogin) {
layer.alert('请先登陆');
return;
}
@ -121,7 +120,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -187,7 +186,7 @@
localStorage.setItem("fonts", fonts);
$(".readBox").css("font-size", fonts + "px");
$("#cFonts").html(fonts);
$("#ChapterBody").attr("class","article-content font"+fonts);
$("#ChapterBody").attr("class", "article-content font" + fonts);
BookDetail.reShowCover();
},
SetBackUpColor: function (colorNum) {

View File

@ -1,10 +1,11 @@
var needLoginPath = ['/user/favorites.html','/user/comment.html','/user/feedback.html',
'/user/feedback_list.html','/user/read_history.html','/user/set_name.html',
'/user/set_password.html','/user/set_sex.html','/user/setup.html','/user/userinfo.html',
var needLoginPath = ['/user/favorites.html', '/user/comment.html', '/user/feedback.html',
'/user/feedback_list.html', '/user/read_history.html', '/user/set_name.html',
'/user/set_password.html', '/user/set_sex.html', '/user/setup.html', '/user/userinfo.html',
"/pay/index.html," +
"/author/register.html","/author/index.html"];
"/author/register.html", "/author/index.html"];
var isLogin = false;
var url = window.location.search;
//key(需要检索的键)
function getSearchString(key) {
var str = url;
@ -14,26 +15,28 @@ function getSearchString(key) {
for (var i = 0; i < arr.length; i++) {
var tmp_arr = arr[i].split("=");
if(tmp_arr[0] == key){
if (tmp_arr[0] == key) {
return decodeURIComponent(tmp_arr[1]);
}
}
return undefined;
}
var keyword = getSearchString("k");
if(keyword != undefined) {
if (keyword != undefined) {
$("#searchKey").val(keyword);
$("#workDirection").remove();
$("#idGirl").remove();
}
function searchByK(k){
if(!k){
window.location.href='/book/bookclass.html?k='+encodeURIComponent(document.getElementById("searchKey").value)
}else{
window.location.href='/book/bookclass.html?k='+encodeURIComponent(k)
function searchByK(k) {
if (!k) {
window.location.href = '/book/bookclass.html?k=' + encodeURIComponent(document.getElementById("searchKey").value)
} else {
window.location.href = '/book/bookclass.html?k=' + encodeURIComponent(k)
}
}
$("#searchKey").keypress(function (even) {
if (even.which == 13) {
even.stopPropagation();
@ -50,37 +53,37 @@ Array.prototype.indexOf = function (val) {
var token = $.cookie('Authorization');
if(!token){
if(needLoginPath.indexOf(window.location.pathname) != -1){
location.href = '/user/login.html?originUrl='+decodeURIComponent(location.href);
if (!token) {
if (needLoginPath.indexOf(window.location.pathname) != -1) {
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}
$(".user_link").html("<i class=\"line mr20\">|</i><a href=\"/user/login.html\" class=\"mr15\">登录</a><a href=\"/user/register.html\" >注册</a>");
}else{
} else {
$.ajax({
type: "POST",
url: "/user/refreshToken",
data: {},
dataType: "json",
success: function(data){
if(data.code == 200){
success: function (data) {
if (data.code == 200) {
$(".user_link").html("<i class=\"line mr20\">|</i>" +
"<a href=\"/user/userinfo.html\" class=\"mr15\">"+data.data.nickName+"</a>" +
"<a href=\"/user/userinfo.html\" class=\"mr15\">" + data.data.nickName + "</a>" +
"<a href=\"javascript:logout()\" >退出</a>");
;
if("/user/login.html" == window.location.pathname){
if ("/user/login.html" == window.location.pathname) {
var orginUrl = getSearchString("originUrl");
window.location.href = orginUrl == undefined || orginUrl.isBlank() ? "/" : orginUrl;
return;
}
isLogin = true;
if(localStorage.getItem("autoLogin") == 1){
$.cookie('Authorization', data.data.token, { expires: 7 ,path: '/' });
}else {
$.cookie('Authorization', data.data.token,{ path: '/' });
if (localStorage.getItem("autoLogin") == 1) {
$.cookie('Authorization', data.data.token, {expires: 7, path: '/'});
} else {
$.cookie('Authorization', data.data.token, {path: '/'});
}
}else{
if(needLoginPath.indexOf(window.location.pathname) != -1){
} else {
if (needLoginPath.indexOf(window.location.pathname) != -1) {
location.href = '/user/login.html';
}
$(".user_link").html("<i class=\"line mr20\">|</i><a href=\"/user/login.html\" class=\"mr15\">登录</a><a href=\"/user/register.html\" >注册</a>");
@ -94,7 +97,6 @@ if(!token){
}
String.prototype.isPhone = function () {
var strTemp = /^1[3|4|5|6|7|8|9][0-9]{9}$/;
if (strTemp.test(this)) {
@ -104,7 +106,7 @@ String.prototype.isPhone = function () {
};
String.prototype.isBlank = function () {
if(this == null || $.trim(this) == ""){
if (this == null || $.trim(this) == "") {
return true;
}
return false;
@ -118,11 +120,8 @@ String.prototype.isNickName = function () {
};
function logout() {
$.cookie('Authorization', null,{ path: '/' });
$.cookie('Authorization', null, {path: '/'});
location.reload();
}
@ -133,9 +132,9 @@ function isImg(str) {
//校验图片上传
function checkPicUpload(file){
function checkPicUpload(file) {
if(!isImg(file.value.substr(file.value.lastIndexOf(".")))){
if (!isImg(file.value.substr(file.value.lastIndexOf(".")))) {
layer.alert('只能上传图片格式的文件');
return false;
}
@ -144,13 +143,13 @@ function checkPicUpload(file){
if (isIE && !file.files) {
var filePath = file.value;
var fileSystem = new ActiveXObject("Scripting.FileSystemfileect");
var file = fileSystem.GetFile (filePath);
var file = fileSystem.GetFile(filePath);
fileSize = file.Size;
}else {
} else {
fileSize = file.files[0].size;
}
fileSize=Math.round(fileSize/1024*100)/100; //单位为KB
if(fileSize>=1024){
fileSize = Math.round(fileSize / 1024 * 100) / 100; //单位为KB
if (fileSize >= 1024) {
layer.alert('上传的图片大小不能超过1M');
return false;
}

View File

@ -106,7 +106,7 @@ Array.prototype.remove = function (val) {
var token = $.cookie('Authorization');
if (!token) {
if (needLoginPath.indexOf(window.location.pathname) != -1) {
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}
// $(".user_link").html("<a href=\"/user/login.html\">登录</a><a href=\"/user/register.html\">注册</a>");

View File

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
@ -7,14 +7,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>作家管理系统-小说精品屋</title>
<link rel="stylesheet" href="/css/base.css?v=1"/>
<link rel="stylesheet" href="/css/user.css" />
<link rel="stylesheet" href="/css/user.css"/>
</head>
</head>
<body class="">
<div class="header">
<div class="mainNav" id="mainNav">
<div class="box_center cf" style="text-align: center;height: 44px;line-height: 48px;color: #fff;font-size: 16px;">
<div class="box_center cf"
style="text-align: center;height: 44px;line-height: 48px;color: #fff;font-size: 16px;">
小说精品屋作家管理
@ -37,7 +38,9 @@
<div class="my_r">
<div class="my_bookshelf">
<div class="title cf">
<h2 class="fl ml10"><a href="/author/author_income_detail.html">订阅明细</a></h2><i class="fl ml20 mr20 font16">|</i><h2 class="fl"><a href="/author/author_income.html" class="red">稿费汇总</a></h2>
<h2 class="fl ml10"><a href="/author/author_income_detail.html">订阅明细</a></h2><i
class="fl ml20 mr20 font16">|</i>
<h2 class="fl"><a href="/author/author_income.html" class="red">稿费汇总</a></h2>
</div>
<div id="divData" class="updateTable">
@ -62,7 +65,6 @@
<tbody id="bookList">
</tbody>
</table>
<div class="pageBox cf" id="shellPage">
@ -120,24 +122,24 @@
$.ajax({
type: "get",
url: "/author/listIncomeMonthByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
var bookList = data.data.list;
if (bookList.length > 0) {
var bookListHtml = "";
for(var i=0;i<bookList.length;i++){
for (var i = 0; i < bookList.length; i++) {
var book = bookList[i];
bookListHtml+=(" <tr class=\"book_list\" >\n" +
bookListHtml += (" <tr class=\"book_list\" >\n" +
" <td class=\"goread\">\n" +
" "+book.incomeMonth+"</td>\n" +
" " + book.incomeMonth + "</td>\n" +
" <td class=\"goread\" >"
+book.preTaxIncome/100+"</td>\n" +
+ book.preTaxIncome / 100 + "</td>\n" +
" <td class=\"goread\">\n" +
" "+book.afterTaxIncome/100+"\n" +
" " + book.afterTaxIncome / 100 + "\n" +
" </td>\n" +
" <td class=\"goread\">"+(book.payStatus == 1 ? '已支付' : '待支付')+
" <td class=\"goread\">" + (book.payStatus == 1 ? '已支付' : '待支付') +
" </td>\n" +
" </tr>");
@ -176,9 +178,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}
@ -191,12 +193,12 @@
}
function updateBookStatus(bookId,status) {
function updateBookStatus(bookId, status) {
$.ajax({
type: "POST",
url: "/author/updateBookStatus",
data: {'bookId':bookId,'status':status==0?1:0},
data: {'bookId': bookId, 'status': status == 0 ? 1 : 0},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -206,9 +208,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}
@ -219,9 +221,6 @@
})
}
</script>
</html>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
@ -7,14 +7,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>作家管理系统-小说精品屋</title>
<link rel="stylesheet" href="/css/base.css?v=1"/>
<link rel="stylesheet" href="/css/user.css" />
<link rel="stylesheet" href="/css/user.css"/>
</head>
</head>
<body class="">
<div class="header">
<div class="mainNav" id="mainNav">
<div class="box_center cf" style="text-align: center;height: 44px;line-height: 48px;color: #fff;font-size: 16px;">
<div class="box_center cf"
style="text-align: center;height: 44px;line-height: 48px;color: #fff;font-size: 16px;">
小说精品屋作家管理
@ -37,7 +38,9 @@
<div class="my_r">
<div class="my_bookshelf">
<div class="title cf">
<h2 class="fl ml10"><a href="/author/author_income_detail.html" class="red">订阅明细</a></h2><i class="fl ml20 mr20 font16">|</i><h2 class="fl"><a href="/author/author_income.html">稿费汇总</a></h2>
<h2 class="fl ml10"><a href="/author/author_income_detail.html" class="red">订阅明细</a></h2><i
class="fl ml20 mr20 font16">|</i>
<h2 class="fl"><a href="/author/author_income.html">稿费汇总</a></h2>
</div>
<div id="divData" class="updateTable">
@ -61,7 +64,6 @@
<tbody id="bookList">
</tbody>
</table>
<div class="pageBox cf" id="shellPage">
@ -117,9 +119,9 @@
function search(curr, limit) {
var data = {'curr':curr,'limit':limit};
var data = {'curr': curr, 'limit': limit};
if(bookId){
if (bookId) {
data.bookId = bookId;
}
@ -133,17 +135,17 @@
var bookList = data.data.list;
if (bookList.length > 0) {
var bookListHtml = "";
for(var i=0;i<bookList.length;i++){
for (var i = 0; i < bookList.length; i++) {
var book = bookList[i];
bookListHtml+=(" <tr class=\"book_list\" >\n" +
bookListHtml += (" <tr class=\"book_list\" >\n" +
" <td class=\"goread\">\n" +
" "+book.incomeDate+"</td>\n" +
" " + book.incomeDate + "</td>\n" +
" <td class=\"goread\" >"
+book.incomeAccount+"</td>\n" +
+ book.incomeAccount + "</td>\n" +
" <td class=\"goread\">\n" +
" "+book.incomeCount+"\n" +
" " + book.incomeCount + "\n" +
" </td>\n" +
" <td class=\"goread\">"+book.incomeNumber+
" <td class=\"goread\">" + book.incomeNumber +
" </td>\n" +
" </tr>");
@ -182,9 +184,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}
@ -197,12 +199,12 @@
}
function updateBookStatus(bookId,status) {
function updateBookStatus(bookId, status) {
$.ajax({
type: "POST",
url: "/author/updateBookStatus",
data: {'bookId':bookId,'status':status==0?1:0},
data: {'bookId': bookId, 'status': status == 0 ? 1 : 0},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -212,9 +214,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}
@ -225,9 +227,6 @@
})
}
</script>
</html>

View File

@ -231,7 +231,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -261,7 +261,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -213,7 +213,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -300,7 +300,7 @@
layer.close(index);
$.ajax({
type: "delete",
url: "/author/deleteIndex/"+indexId,
url: "/author/deleteIndex/" + indexId,
data: {},
dataType: "json",
success: function (data) {
@ -311,7 +311,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -380,7 +380,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -2,10 +2,10 @@
<div class="box_center cf">
<div class="copyright">
<ul>
<li class="menu"><a href="/?to=mobile">手机站</a><i class="line">|</i><a href="/">网站首页</a><i
<li class="menu"><!--<a href="/?to=mobile">手机站</a><i class="line">|</i>--><a href="/">网站首页</a><i
class="line">|</i><a href="/user/feedback.html">反馈留言</a><i class="line">|</i><a
href="/author/index.html">作家专区</a><i class="line">|</i><a
href="/mobile/fiction_house.apk">客户端</a></li>
href="/author/index.html">作家专区</a><!--<i class="line">|</i><a
href="/mobile/fiction_house.apk">客户端</a>--></li>
<li th:text="'Copyright (C) '+${application.website.domain}+' All rights reserved&nbsp;&nbsp;'+${application.website.name}+'版权所有'"></li>
</ul>

View File

@ -161,11 +161,6 @@
text-align: center;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
@ -210,6 +205,26 @@
字体:<a id="fontbig" class="sizebg" onclick="nr_setbg('big')">大</a> <a id="fontmiddle" class="button sizebgon"
onclick="nr_setbg('middle')">中</a> <a
id="fontsmall" class="sizebg" onclick="nr_setbg('small')">小</a>
<a href="javascript:speakChapter()" style="margin-left: 10px">
<svg t="1707099868768" class="icon" viewBox="0 0 800 800" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="1783" id="mx_n_1707099868769" width="22" height="22">
<path d="M393.707231 292.571429L343.13933 487.619048l46.955908 234.779541-97.523809-45.149912-66.82187-108.359788-21.671958-86.687831 66.82187-113.777778z"
fill="#3eaf7c" p-id="1784"></path>
<path d="M451.499118 509.291005a104.747795 61.40388 90 1 0 122.80776 0 104.747795 61.40388 90 1 0-122.80776 0Z"
fill="#3eaf7c" p-id="1785"></path>
<path d="M426.215168 781.996473c-3.611993 0-7.223986-1.805996-10.835979-3.611993l-117.389771-86.687831c-36.119929-23.477954-65.015873-57.791887-83.075838-99.329806-10.835979-25.283951-16.253968-52.373898-16.253968-81.269841s5.417989-55.985891 16.253968-81.269842c16.253968-41.537919 45.149912-74.045855 83.075838-97.523809l110.165785-77.657848c9.029982-5.417989 19.865961-3.611993 25.28395 3.611993 5.417989 9.029982 3.611993 19.865961-3.611993 25.28395L319.661376 361.199295c-32.507937 19.865961-55.985891 48.761905-70.433863 81.269841-9.029982 21.671958-14.447972 45.149912-14.447972 68.627866 0 23.477954 3.611993 45.149912 12.641976 66.821869 14.447972 34.313933 37.925926 63.209877 68.627866 83.075838l117.38977 86.687831c7.223986 5.417989 9.029982 18.059965 3.611993 25.28395 0 5.417989-5.417989 9.029982-10.835978 9.029983z"
fill="#3eaf7c" p-id="1786"></path>
<path d="M523.738977 830.758377c-108.359788 0-193.241623-140.867725-193.241623-317.855379S415.379189 193.241623 523.738977 193.241623c25.283951 0 50.567901 7.223986 74.045855 23.477954 9.029982 5.417989 10.835979 16.253968 5.41799 25.28395s-16.253968 10.835979-25.283951 5.41799c-18.059965-10.835979-34.313933-18.059965-54.179894-18.059965-84.881834 0-157.121693 130.031746-157.121693 281.73545S438.857143 794.638448 523.738977 794.638448s157.121693-130.031746 157.121693-281.73545c0-74.045855-16.253968-146.285714-46.955908-198.659612-5.417989-9.029982-1.805996-19.865961 7.223986-25.28395 9.029982-5.417989 19.865961-1.805996 25.28395 7.223986 32.507937 59.597884 50.567901 135.449735 50.567902 216.719576C718.786596 689.890653 633.904762 830.758377 523.738977 830.758377z"
fill="#3eaf7c" p-id="1787"></path>
<path d="M523.738977 646.546737c-48.761905 0-86.687831-59.597884-86.687831-133.643739S474.977072 379.259259 523.738977 379.259259s86.687831 59.597884 86.687831 133.643739-37.925926 133.643739-86.687831 133.643739z m0-232.973545c-23.477954 0-50.567901 39.731922-50.567901 97.52381s27.089947 97.52381 50.567901 97.523809 50.567901-39.731922 50.567901-97.523809-27.089947-97.52381-50.567901-97.52381z"
fill="#3eaf7c" p-id="1788"></path>
<path d="M523.738977 413.573192h-1.805996l-92.105821-10.835979c-9.029982-1.805996-16.253968-10.835979-16.253968-19.865961 1.805996-9.029982 10.835979-16.253968 19.865961-16.253968l92.105821 10.835979c9.029982 1.805996 16.253968 10.835979 16.253968 19.865961 0 9.029982-9.029982 16.253968-18.059965 16.253968zM372.035273 662.800705c-9.029982 0-16.253968-7.223986-18.059964-16.253968-1.805996-9.029982 5.417989-18.059965 16.253968-19.865961l153.5097-16.253968c9.029982-1.805996 18.059965 5.417989 19.865961 16.253968 1.805996 9.029982-5.417989 18.059965-16.253968 19.865961l-153.5097 16.253968h-1.805997z"
fill="#3eaf7c" p-id="1789"></path>
<path d="M763.936508 364.811287c-5.417989 0-9.029982-1.805996-12.641975-5.417989-7.223986-7.223986-7.223986-18.059965 0-25.283951l25.28395-25.28395c7.223986-7.223986 18.059965-7.223986 25.283951 0s7.223986 18.059965 0 25.28395L776.578483 359.393298c-3.611993 3.611993-9.029982 5.417989-12.641975 5.417989zM771.160494 720.592593c-5.417989 0-9.029982-1.805996-12.641975-5.41799l-25.283951-25.28395c-7.223986-7.223986-7.223986-18.059965 0-25.283951s18.059965-7.223986 25.283951 0l25.28395 25.283951c7.223986 7.223986 7.223986 18.059965 0 25.28395-3.611993 3.611993-7.223986 5.417989-12.641975 5.41799zM819.922399 529.156966h-54.179895c-10.835979 0-18.059965-7.223986-18.059964-18.059964s7.223986-18.059965 18.059964-18.059965h54.179895c10.835979 0 18.059965 7.223986 18.059964 18.059965s-9.029982 18.059965-18.059964 18.059964z"
fill="#3eaf7c" p-id="1790"></path>
</svg>
</a>
</p>
<div class="indexDiv" style="height: 42px;line-height: 42px;text-align:center;background: #f2f2f2">
@ -300,8 +315,6 @@
}
})
$("#content").css("min-height", ($(window).height() - 60) + "px");
})();
@ -352,7 +365,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
@ -389,6 +402,79 @@
}
console.log(speechSynthesis.getVoices());
$(window).on('beforeunload', function () {
if (speechSynthesis.speaking) {
speechSynthesis.cancel()
}
});
function speakChapter() {
console.log('speechSynthesis.paused', speechSynthesis.paused)
console.log('speechSynthesis.pending', speechSynthesis.pending)
console.log('speechSynthesis.speaking', speechSynthesis.speaking)
if (speechSynthesis.speaking && !speechSynthesis.paused) {
speechSynthesis.pause();
return;
}
if (speechSynthesis.speaking && speechSynthesis.paused) {
speechSynthesis.resume();
}
speak({
'text': $('#chaptercontent').text(),
'speechRate': 0.5,
'pitch': 1,
'lang': 'zh-CN'
}, function () {
console.log('语音播放结束');
}, function () {
console.log('语音开始播放');
});
}
/**
* @description 文字转语音方法
* @public
* @param { text, rate, lang, volume, pitch } object
* @param text 要合成的文字内容,字符串
* @param speechRate 读取文字的语速 0.1~10 正常1
* @param lang 读取文字时的语言
* @param volume 读取时声音的音量 0~1 正常1
* @param voice 读取文字的语音服务
* @param pitch 读取时声音的音高 0~2 正常1
* @returns SpeechSynthesisUtterance
*/
function speak({text, speechRate, lang, volume, pitch, voice}, endEvent, startEvent) {
if (!window.SpeechSynthesisUtterance) {
console.warn('当前浏览器不支持文字转语音服务')
return;
}
if (!text) {
return;
}
const speechUtterance = new SpeechSynthesisUtterance();
speechUtterance.text = text;
speechUtterance.rate = speechRate || 1;
speechUtterance.lang = lang || 'zh-CN';
speechUtterance.volume = volume || 1;
speechUtterance.pitch = pitch || 1;
speechUtterance.voice = voice || null;
speechUtterance.onend = function () {
endEvent && endEvent();
};
speechUtterance.onstart = function () {
startEvent && startEvent();
};
speechSynthesis.speak(speechUtterance);
return speechUtterance;
}
</script>

View File

@ -274,7 +274,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -289,8 +289,6 @@
}
$("#content").css("min-height", ($(window).height() - 60) + "px");
function downloadFile() {
var fileUrl = '/book/download?bookId=' + $("#bookIdHidden").val() + '&bookName=' + $("#bookNamedHidden").val();
window.location.href = fileUrl;

View File

@ -36,41 +36,43 @@
</div>
</head>
<body>
<div id="content">
<input type="hidden" id="bookIdHidden" th:value="${book.id}"/>
<div style="height: 50px;line-height: 50px;text-align: center" class="layui-header header header-doc layui-bg-cyan">
<input type="hidden" id="bookIdHidden" th:value="${book.id}"/>
<div style="height: 50px;line-height: 50px;text-align: center"
class="layui-header header header-doc layui-bg-cyan">
<div style="float: left;margin-left: 10px">
<a href="javascript:history.go(-1)">
<i style="font-size: 20px;color: #fff;" class="layui-icon">&#xe65c;</i></a>
<div style="float: left;margin-left: 10px">
<a href="javascript:history.go(-1)">
<i style="font-size: 20px;color: #fff;" class="layui-icon">&#xe65c;</i></a>
</div>
<a style="color: #ffffff;" th:href="'/book/'+ ${book.id} + '.html'"><b class="layui-icon"
th:utext="${book.bookName}"></b></a>
<div style="float: right;margin-right: 10px">
<a href="/"><i style="font-size: 20px;color: #fff;" class="layui-icon">&#xe68e;</i></a>
</div>
</div>
<a style="color: #ffffff;" th:href="'/book/'+ ${book.id} + '.html'"><b class="layui-icon" th:utext="${book.bookName}"></b></a>
<div style="float: right;margin-right: 10px">
<a href="/"><i style="font-size: 20px;color: #fff;" class="layui-icon">&#xe68e;</i></a>
</div>
</div>
<p style="height: 30px;line-height: 30px;padding: 10px">
<p style="height: 30px;line-height: 30px;padding: 10px">
<a href="#buttom" style="color: red">&nbsp;&nbsp;↓直达页面底部</a>
</p>
<div class="layui-colla-content layui-show indexP layui-row">
<p class="line-limit-length layui-col-xs12 layui-col-sm4 layui-col-md3 layui-col-lg2" style="padding-left:10px;height: 50px;line-height: 50px;" th:each="index : ${bookIndexList}">
<a style="color:#333;" th:href="'/book/'+${index.bookId}+'/'+${index.id}+'.html'" th:utext="${index.indexName}">
</a>
<a href="#buttom" style="color: red">&nbsp;&nbsp;↓直达页面底部</a>
</p>
<div class="layui-colla-content layui-show indexP layui-row">
<p class="line-limit-length layui-col-xs12 layui-col-sm4 layui-col-md3 layui-col-lg2"
style="padding-left:10px;height: 50px;line-height: 50px;" th:each="index : ${bookIndexList}">
<a style="color:#333;" th:href="'/book/'+${index.bookId}+'/'+${index.id}+'.html'"
th:utext="${index.indexName}">
</div>
</a>
</p>
</div>
</div>
<div th:replace="mobile/common/footer :: footer">
</div>
@ -80,13 +82,14 @@
<div th:replace="mobile/common/js :: js">
</div>
<script>
$("#content").css("min-height",($(window).height()-60)+"px");
$.get("/book/addVisit",{"bookId":$("#bookIdHidden").val()},function(){});
function toMyCollect(){
$.get("/book/addVisit", {"bookId": $("#bookIdHidden").val()}, function () {
});
function toMyCollect() {
var token = localStorage.getItem("token");
if(token) {
if (token) {
window.location.href = "/book/search?token=" + token;
}else{
} else {
window.location.href = "/user/login.html";
}
}

View File

@ -62,10 +62,6 @@
height: 180px;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
<body>

View File

@ -1,6 +1,11 @@
<div th:fragment="css">
<link rel="stylesheet" href="/mobile/layui/css/layui.css">
<style type="text/css">
body {
min-height: 100vh;
position: relative;
}
.app {
display: none;
}
@ -22,9 +27,12 @@
}
#footer {
padding-top: 6px;
height: 60px;
line-height: 54px;
position: absolute;
bottom: 0px;
left: 0;
right: 0;
height: 50px;
line-height: 48px;
text-align: center;
}
</style>

View File

@ -1,15 +1,19 @@
<div th:fragment="footer" id="footer"
class="layui-footer footer footer-demo layui-bg-cyan">
<!--<a href="/mobile/book/searchSoftBook.html" style="font-size: 14px;color: #fff;">轻小说</a>
<a href="/mobile/book/searchSoftBook.html?catId=9" style="font-size: 14px;color: #fff;margin-left: 8px">漫画</a>-->
<a href="/?to=pc" style="font-size: 14px;color: #fff;margin-left: 8px">电脑站</a>
<a href="/user/read_history.html" style="font-size: 14px;color: #fff;margin-left: 8px">阅读记录</a>
<a href="/user/favorites.html" style="font-size: 14px;color: #fff;margin-left: 8px">书架</a>
<a href="/mobile/fiction_house.apk" style="font-size: 14px;color: #fff;margin-left: 8px">客户端</a>
<!--<a href="https://www.zinglizingli.xyz/me/index.html" style="font-size: 14px;color: #fff;margin-left: 8px">开发者</a>-->
<div th:fragment="footer">
<div style="height: 50px"></div>
<div id="footer"
class="layui-footer footer footer-demo layui-bg-cyan">
<!--<a href="/mobile/book/searchSoftBook.html" style="font-size: 14px;color: #fff;">轻小说</a>
<a href="/mobile/book/searchSoftBook.html?catId=9" style="font-size: 14px;color: #fff;margin-left: 8px">漫画</a>-->
<!--<a href="/?to=pc" style="font-size: 14px;color: #fff;margin-left: 8px">电脑站</a>-->
<a href="/" style="font-size: 16px;color: #fff;">首页</a>
<a href="/user/read_history.html" style="font-size: 16px;color: #fff;margin-left: 18px">阅读记录</a>
<a href="/user/favorites.html" style="font-size: 16px;color: #fff;margin-left: 18px">书架</a>
<!--<a href="/mobile/fiction_house.apk" style="font-size: 14px;color: #fff;margin-left: 8px">客户端</a>-->
<!--<a href="https://www.zinglizingli.xyz/me/index.html" style="font-size: 14px;color: #fff;margin-left: 8px">开发者</a>-->
<div style="float: right"><a href="#top"><i class="layui-icon"
style="margin-right:15px;font-size: 30px;color:#fff ">&#xe604;</i></a>
<div style="margin-top:-3px;float: right"><a href="#top"><i class="layui-icon"
style="margin-right:15px;font-size: 25px;color:#fff ">&#xe604;</i></a>
</div>
</div>
</div>

View File

@ -208,7 +208,7 @@
if (data.code == 200) {
var updateRankBooks = data.data;
var updateRankBookHtml = "";
for (var i = 0; i < 10; i++) {
for (var i = 0; i < updateRankBooks.length; i++) {
var updateRankBook = updateRankBooks[i];
if (updateRankBook.bookDesc) {

View File

@ -79,11 +79,6 @@
padding-bottom: 20px;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
<body>
@ -119,7 +114,7 @@
style="color: #3eaf7c" id="accountBalance">10</em> 屋币<!--<em class="red">+0</em>代金券-->
</div>
</div>
<div id="payAmount" class="pay_way layui-row layui-col-space15" style="text-align: center;padding-top: 20px;">
<div id="payAmount" class="pay_way layui-row" style="text-align: center;padding-top: 20px;">
<h5>选择充值金额</h5>
<li vals="10" class="layui-col-xs4 layui-col-sm3 layui-col-md2">
<div class="layui-panel">
@ -170,7 +165,6 @@
<div th:replace="mobile/common/js :: js"></div>
<script>
$("#body").css("min-height", ($(window).height() - 110) + "px")
//查询用户信息
$.ajax({
@ -190,7 +184,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -62,10 +62,6 @@
height: 180px;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
<body>
@ -113,7 +109,6 @@
<div th:replace="mobile/common/js :: js"></div>
<script>
$("#body").css("min-height", ($(window).height() - 110) + "px")
search(1, 20);

View File

@ -63,7 +63,6 @@
<div th:replace="mobile/common/js :: js">
</div>
<script type="text/javascript">
$("#form1").css("min-height", ($(window).height() - 140) + "px")
if (localStorage.getItem("autoLogin") == 1) {
$("#autoLogin").prop("checked", 'true');
layui.form.render('checkbox', 'loginForm');

View File

@ -62,10 +62,6 @@
height: 180px;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
<body>
@ -113,7 +109,6 @@
<div th:replace="mobile/common/js :: js"></div>
<script>
$("#body").css("min-height", ($(window).height() - 110) + "px")
search(1, 20);

View File

@ -69,7 +69,6 @@
<div th:replace="mobile/common/js :: js">
</div>
<script type="text/javascript">
$("#form1").css("min-height", ($(window).height() - 140) + "px")
$("#chkd").click();
$("#btnRegister").click(function () {

View File

@ -213,7 +213,6 @@
<script>
$("#body").css("min-height", ($(window).height() - 60) + "px")
//查询用户信息
$.ajax({
@ -244,7 +243,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -1,6 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'充值_'+${application.website.name}"></title>
@ -20,39 +19,51 @@
<div class="payBox cf">
<div class="payHead cf">
<div class="fl">
充值账号:<span class="user_name" id="my_name"></span>余额:<em class="red" id="accountBalance">0</em>屋币<!--<em class="red">+0</em>代金券-->
充值账号:<span class="user_name" id="my_name"></span>余额:<em class="red" id="accountBalance">0</em>屋币
<!--<em class="red">+0</em>代金券-->
</div>
</div>
<div class="payCon">
<h5>选择充值方式</h5>
<ul class="pay_way cf" id="ulPayType">
<li class="on" valp="1"><img class="pay_pic" src="../images/pay_zfb.png" alt="支付宝支付" /></li>
<li valp="2"><img class="pay_pic" src="../images/pay_wx.png" alt="微信支付" /></li>
<li class="on" valp="1"><img class="pay_pic" src="../images/pay_zfb.png" alt="支付宝支付"/></li>
<li valp="2"><img class="pay_pic" src="../images/pay_wx.png" alt="微信支付"/></li>
</ul>
<h5>选择充值金额</h5>
<ul class="pay_way cf" id="ulZFWX">
<li vals="10"><strong>10元</strong><span class="pay_mn">1000屋币</span></li>
<li vals="30"><strong>30元</strong><span class="pay_mn">3000屋币</span></li>
<li vals="50"><strong>50元</strong><span class="pay_mn">5000屋币<!--<em class="red">+ 送500代金券</em>--></span></li>
<li vals="100"><strong>100元</strong><span class="pay_mn">10000屋币<!--<em class="red">+ 送1200代金券</em>--></span></li>
<li vals="200"><strong>200元</strong><span class="pay_mn">20000屋币<!--<em class="red">+ 送3000代金券</em>--></span></li>
<li vals="500"><strong>500元</strong><span class="pay_mn">50000屋币<!--<em class="red">+ 送10000代金券</em>--></span></li>
<li vals="50"><strong>50元</strong><span class="pay_mn">5000屋币
<!--<em class="red">+ 送500代金券</em>--></span></li>
<li vals="100"><strong>100元</strong><span class="pay_mn">10000屋币
<!--<em class="red">+ 送1200代金券</em>--></span></li>
<li vals="200"><strong>200元</strong><span class="pay_mn">20000屋币
<!--<em class="red">+ 送3000代金券</em>--></span></li>
<li vals="500"><strong>500元</strong><span class="pay_mn">50000屋币
<!--<em class="red">+ 送10000代金券</em>--></span></li>
</ul>
<ul class="pay_way cf" style="display:none;" id="ulPayPal">
<li vals="20"><strong>20美元</strong><span class="pay_mn">10000屋币</span></li>
<li vals="50" class="on"><strong>50美元</strong><span class="pay_mn">25000屋币<em class="red"></em></span></li>
<li vals="100"><strong>100美元</strong><span class="pay_mn">50000屋币<em class="red"></em></span></li>
<li vals="50" class="on"><strong>50美元</strong><span class="pay_mn">25000屋币<em class="red"></em></span>
</li>
<li vals="100"><strong>100美元</strong><span class="pay_mn">50000屋币<em class="red"></em></span>
</li>
</ul>
<ul class="pay_Checkout" id="ulZFWXXJ">
<li>当前汇率1元=100屋币</li>
<li>总计金额:<em class="red" id="showTotal">¥50元</em> 获得 <em class="red" id="showRemark">5000屋币<!--+500代金券--></em></li>
<li style="display:none"><a class="btn_red" href="pay_success.html" onclick="javascript:UserPay.sendPay();">立即支付</a></li>
<li>总计金额:<em class="red" id="showTotal">¥50元</em> 获得 <em class="red" id="showRemark">5000屋币
<!--+500代金券--></em></li>
<li style="display:none"><a class="btn_red" href="pay_success.html"
onclick="javascript:UserPay.sendPay();">立即支付</a></li>
</ul>
<ul class="pay_Checkout" style="display:none;" id="ulPayPalXJ">
<li>当前汇率1美元=500屋币</li>
<li>总计金额:<em class="red" id="showPayPalTotal">50美元</em> 获得 <em class="red" id="showPayPalRemark">25000屋币</em></li>
<li style="display:none"><a class="btn_red" href="javascript:void(0);" onclick="javascript:UserPay.sendPay();">立即支付</a></li>
<li>总计金额:<em class="red" id="showPayPalTotal">50美元</em> 获得 <em class="red"
id="showPayPalRemark">25000屋币</em>
</li>
<li style="display:none"><a class="btn_red" href="javascript:void(0);"
onclick="javascript:UserPay.sendPay();">立即支付</a></li>
</ul>
</div>
<div class="payFoot">
@ -68,7 +79,7 @@
</div>
</div>
<input type="hidden" id="pValue" name="payAmount" />
<input type="hidden" id="pValue" name="payAmount"/>
</form>
@ -80,7 +91,6 @@
<script type="text/javascript">
//查询用户信息
$.ajax({
type: "get",
@ -89,9 +99,9 @@
dataType: "json",
success: function (data) {
if (data.code == 200) {
if(data.data.nickName){
if (data.data.nickName) {
$("#my_name").html(data.data.nickName);
}else{
} else {
$("#my_name").html(data.data.username);
}
@ -99,7 +109,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -115,9 +125,9 @@
var payType = $("#ulPayType").find("li.on").attr("valp");
if(payType == 2){
if (payType == 2) {
layer.alert("微信支付暂未开通敬请期待");
return ;
return;
}
$("#pValue").val($(this).attr("vals"));
@ -125,9 +135,6 @@
$("#payform").submit();
});
</script>

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'我的书评_'+${application.website.name}"></title>
@ -54,24 +55,24 @@
$.ajax({
type: "get",
url: "/user/listCommentByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
var commentList = data.data.list;
if (commentList.length > 0) {
$("#bookCommentTotal").html("("+data.data.total+")");
$("#bookCommentTotal").html("(" + data.data.total + ")");
var commentListHtml = "";
for (var i = 0; i < commentList.length; i++) {
var comment = commentList[i];
commentListHtml += ("<div class=\"comment_list cf\">" +
"<div class=\"user_heads fl\" vals=\"389\">" +
"<img src=\""+(comment.createUserPhoto ? comment.createUserPhoto : '/images/man.png')+"\" class=\"user_head\" alt=\"\">" +
"<img src=\"" + (comment.createUserPhoto ? comment.createUserPhoto : '/images/man.png') + "\" class=\"user_head\" alt=\"\">" +
"<span class=\"user_level1\" style=\"display: none;\">见习</span></div>" +
"<ul class=\"pl_bar fr\">\t\t\t<li class=\"name\">"+(comment.createUserName.substr(0, 4) + "****" + comment.createUserName.substr(comment.createUserName.length - 3, 3))+"</li><li class=\"dec\">" +
comment.commentContent+
"<ul class=\"pl_bar fr\">\t\t\t<li class=\"name\">" + (comment.createUserName.substr(0, 4) + "****" + comment.createUserName.substr(comment.createUserName.length - 3, 3)) + "</li><li class=\"dec\">" +
comment.commentContent +
"</li><li class=\"other cf\">" +
"<span class=\"time fl\">"+comment.createTime+"</span>" +
"<span class=\"time fl\">" + comment.createTime + "</span>" +
"<span class=\"fr\"><a href=\"javascript:void(0);\" onclick=\"javascript:BookDetail.AddAgreeTotal(77,this);\" class=\"zan\" style=\"display: none;\">赞<i class=\"num\">(0)</i></a>" +
"</span></li>\t\t</ul>\t</div>");
}
@ -109,9 +110,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}

View File

@ -1,11 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head th:replace="common/header :: common_head(~{::title},~{::meta},~{::link},~{})">
<title th:text="'我的书架_'+${application.website.name}"></title>
<meta name="keywords" th:content="'我的书架,个人中心,'+${application.website.name}+'小说,'+${application.website.name}" />
<meta name="description" th:content="${application.website.name}+'小说每日更新小说连载,小说排行榜,提供言情小说,都市小说,玄幻小说,穿越小说,青春小说,总裁豪门小说,网络小说,免费小说,全本小说,首发小说,最新章节免费小说阅读,精彩尽在'+${application.website.name}+'小说!'" />
<link rel="stylesheet" href="/css/user.css" />
<meta name="keywords" th:content="'我的书架,个人中心,'+${application.website.name}+'小说,'+${application.website.name}"/>
<meta name="description"
th:content="${application.website.name}+'小说每日更新小说连载,小说排行榜,提供言情小说,都市小说,玄幻小说,穿越小说,青春小说,总裁豪门小说,网络小说,免费小说,全本小说,首发小说,最新章节免费小说阅读,精彩尽在'+${application.website.name}+'小说!'"/>
<link rel="stylesheet" href="/css/user.css"/>
</head>
</head>
<body class="">
@ -29,7 +31,9 @@
<div class="my_r">
<div class="my_bookshelf">
<div class="title cf">
<h2 class="fl"><a href="javascript:void(0);" class="red">我的书架</a></h2><i class="fl ml20 mr20 font16">|</i><h2 class="fl"><a href="/user/read_history.html" >最近阅读</a></h2>
<h2 class="fl"><a href="javascript:void(0);" class="red">我的书架</a></h2><i
class="fl ml20 mr20 font16">|</i>
<h2 class="fl"><a href="/user/read_history.html">最近阅读</a></h2>
</div>
<div id="divData" class="updateTable">
@ -56,7 +60,6 @@
<tbody id="bookShelfList">
</tbody>
</table>
<div class="pageBox cf" id="shellPage">
@ -82,31 +85,31 @@
$.ajax({
type: "get",
url: "/user/listBookShelfByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
var bookShelfList = data.data.list;
if (bookShelfList.length > 0) {
var bookShelfListHtml = "";
for(var i=0;i<bookShelfList.length;i++){
for (var i = 0; i < bookShelfList.length; i++) {
var book = bookShelfList[i];
bookShelfListHtml+=(" <tr class=\"book_list\" vals=\"291\">\n" +
bookShelfListHtml += (" <tr class=\"book_list\" vals=\"291\">\n" +
" <td class=\"style bookclass\">\n" +
" <a href=\"/book/bookclass.html?c="+book.catId+"\" >["+book.catName+"]</a>\n" +
" <a href=\"/book/bookclass.html?c=" + book.catId + "\" >[" + book.catName + "]</a>\n" +
" </td>\n" +
" <td class=\"name\">\n" +
" <a href=\"/book/"+book.bookId+".html\">\n" +
" "+book.bookName+"</a>\n" +
" <a href=\"/book/" + book.bookId + ".html\">\n" +
" " + book.bookName + "</a>\n" +
" </td>\n" +
" <td class=\"chapter\" valsc=\"291|2037554|1\">\n" +
"<a href='/book/"+book.bookId+"/"+book.lastIndexId+".html'>"+book.lastIndexName+"</a>"+
"<a href='/book/" + book.bookId + "/" + book.lastIndexId + ".html'>" + book.lastIndexName + "</a>" +
" </td>\n" +
" <td class=\"time\">\n" +
" "+book.lastIndexUpdateTime+"\n" +
" " + book.lastIndexUpdateTime + "\n" +
" </td>\n" +
" <td class=\"goread\">\n" +
"<a href='/book/"+book.bookId+"/"+book.preContentId+".html'>继续阅读</a>"+
"<a href='/book/" + book.bookId + "/" + book.preContentId + ".html'>继续阅读</a>" +
" </td>\n" +
" </tr>");
}
@ -144,9 +147,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}

View File

@ -74,7 +74,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -1,6 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'我的反馈_'+${application.website.name}"></title>
@ -34,8 +33,6 @@
<dd id="feedbackList">
</dd>
</dl>
<div class="cf">
@ -61,7 +58,7 @@
$.ajax({
type: "get",
url: "/user/listUserFeedBackByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -71,8 +68,8 @@
for (var i = 0; i < feedbackList.length; i++) {
var feedback = feedbackList[i];
feedbackListHtml += (" <div class=\"comment_list clear\" ><ul>\n" +
" <li class=\"li_1\"><span class=\"user_name fl\"></span><span class=\"time fl\">"+feedback.createTime+"</span></li>\n" +
" <li class=\"li_2\">"+feedback.content+"</li>\n" +
" <li class=\"li_1\"><span class=\"user_name fl\"></span><span class=\"time fl\">" + feedback.createTime + "</span></li>\n" +
" <li class=\"li_2\">" + feedback.content + "</li>\n" +
" </ul></div>");
}
$("#feedbackList").html(feedbackListHtml);
@ -109,9 +106,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'最近阅读_'+${application.website.name}"></title>
@ -13,7 +14,9 @@
<div class="viewhistoryBox">
<div class="my_bookshelf">
<div class="title cf">
<h2 class="fl ml10"><a href="javascript:void(0);" class="red">最近阅读</a></h2><i class="fl ml20 mr20 font16">|</i><h2 class="fl"><a href="/user/favorites.html">我的书架</a></h2>
<h2 class="fl ml10"><a href="javascript:void(0);" class="red">最近阅读</a></h2><i
class="fl ml20 mr20 font16">|</i>
<h2 class="fl"><a href="/user/favorites.html">我的书架</a></h2>
</div>
<div id="divData" class="updateTable">
<table cellpadding="0" cellspacing="0">
@ -69,31 +72,31 @@
$.ajax({
type: "get",
url: "/user/listReadHistoryByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
var bookHistoryList = data.data.list;
if (bookHistoryList.length > 0) {
var bookHistoryListHtml = "";
for(var i=0;i<bookHistoryList.length;i++){
for (var i = 0; i < bookHistoryList.length; i++) {
var book = bookHistoryList[i];
bookHistoryListHtml+=(" <tr class=\"book_list\" vals=\"291\">\n" +
bookHistoryListHtml += (" <tr class=\"book_list\" vals=\"291\">\n" +
" <td class=\"style bookclass\">\n" +
" <a href=\"/book/bookclass.html?c="+book.catId+"\" >["+book.catName+"]</a>\n" +
" <a href=\"/book/bookclass.html?c=" + book.catId + "\" >[" + book.catName + "]</a>\n" +
" </td>\n" +
" <td class=\"name\">\n" +
" <a href=\"/book/"+book.bookId+".html\">\n" +
" "+book.bookName+"</a>\n" +
" <a href=\"/book/" + book.bookId + ".html\">\n" +
" " + book.bookName + "</a>\n" +
" </td>\n" +
" <td class=\"chapter\" valsc=\"291|2037554|1\">\n" +
"<a href='/book/"+book.bookId+"/"+book.lastIndexId+".html'>"+book.lastIndexName+"</a>"+
"<a href='/book/" + book.bookId + "/" + book.lastIndexId + ".html'>" + book.lastIndexName + "</a>" +
" </td>\n" +
" <td class=\"time\">\n" +
" "+book.lastIndexUpdateTime+"\n" +
" " + book.lastIndexUpdateTime + "\n" +
" </td>\n" +
" <td class=\"goread\">\n" +
"<a href='/book/"+book.bookId+"/"+book.preContentId+".html'>继续阅读</a>"+
"<a href='/book/" + book.bookId + "/" + book.preContentId + ".html'>继续阅读</a>" +
" </td>\n" +
" </tr>");
}
@ -131,9 +134,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}

View File

@ -61,7 +61,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -96,7 +96,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
$("#LabErr").html(data.msg);

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'修改密码_'+${application.website.name}"></title>
@ -24,13 +25,18 @@
<div class="my_r">
<div class="my_info cf">
<div class="my_info_txt">
<ul class="mytab_list">
<li><i class="tit">我的密码</i><input name="oldPass" type="password" id="txtOldPass" class="s_input" placeholder="请输入原密码" /></li>
<li><i class="tit">&nbsp;</i><input name="txtNewPass1" type="password" id="txtNewPass1" class="s_input" placeholder="请输入密码" /></li>
<li><i class="tit">&nbsp;</i><input name="txtNewPass2" type="password" id="txtNewPass2" class="s_input" placeholder="请确认新密码" /></li>
<li><i class="tit">&nbsp;</i><input type="submit" name="btnExchangePassword" value="修改" id="btnExchangePassword" onclick="updatePassword()" class="s_btn btn_red" /></li>
<li><i class="tit">&nbsp;</i><span id="LabErr"></span></li>
</ul>
<ul class="mytab_list">
<li><i class="tit">我的密码</i><input name="oldPass" type="password" id="txtOldPass" class="s_input"
placeholder="请输入密码"/></li>
<li><i class="tit">&nbsp;</i><input name="txtNewPass1" type="password" id="txtNewPass1"
class="s_input" placeholder="请输入新密码"/></li>
<li><i class="tit">&nbsp;</i><input name="txtNewPass2" type="password" id="txtNewPass2"
class="s_input" placeholder="请确认新密码"/></li>
<li><i class="tit">&nbsp;</i><input type="submit" name="btnExchangePassword" value="修改"
id="btnExchangePassword" onclick="updatePassword()"
class="s_btn btn_red"/></li>
<li><i class="tit">&nbsp;</i><span id="LabErr"></span></li>
</ul>
</div>
</div>
</div>
@ -57,14 +63,14 @@
$("#LabErr").html("确认密码不能为空");
return;
}
if(newPassword1 !== newPassword2){
if (newPassword1 !== newPassword2) {
$("#LabErr").html("两次输入的新密码不匹配");
return;
}
$.ajax({
type: "POST",
url: "/user/updatePassword",
data: {'oldPassword':oldPassword,'newPassword1':newPassword1,'newPassword2':newPassword2},
data: {'oldPassword': oldPassword, 'newPassword1': newPassword1, 'newPassword2': newPassword2},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -72,7 +78,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
$("#LabErr").html(data.msg);

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'修改性别_'+${application.website.name}"></title>
@ -24,14 +25,16 @@
<div class="my_r">
<div class="my_info cf">
<div class="my_info_txt">
<ul class="mytab_list">
<li><i class="tit">我的性别</i>
<label><input type="radio" name="sex" value="0" />&nbsp;男生</label>
<label><input class="ml20" type="radio" name="sex" value="1" checked />&nbsp;女生</label>
</li>
<li class="mt20"><i class="tit">&nbsp;</i><input type="button" onclick="updateSex()" name="btn" value="修改" id="btn" class="s_btn btn_red" /></li>
<li><i class="tit">&nbsp;</i><span id="LabErr"></span></li>
</ul>
<ul class="mytab_list">
<li><i class="tit">我的性别</i>
<label><input type="radio" name="sex" value="0"/>&nbsp;男生</label>
<label><input class="ml20" type="radio" name="sex" value="1" checked/>&nbsp;女生</label>
</li>
<li class="mt20"><i class="tit">&nbsp;</i><input type="button" onclick="updateSex()" name="btn"
value="修改" id="btn" class="s_btn btn_red"/>
</li>
<li><i class="tit">&nbsp;</i><span id="LabErr"></span></li>
</ul>
</div>
</div>
</div>
@ -50,15 +53,14 @@
dataType: "json",
success: function (data) {
if (data.code == 200) {
if(data.data.userSex === '0'){
$("input[name=sex]").eq(0).attr("checked",true);
if (data.data.userSex === '0') {
$("input[name=sex]").eq(0).attr("checked", true);
}
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -69,11 +71,12 @@
layer.alert('网络异常');
}
})
function updateSex() {
$.ajax({
type: "POST",
url: "/user/updateUserInfo",
data: {'userSex':$("input[name=sex]:checked").val()},
data: {'userSex': $("input[name=sex]:checked").val()},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -81,7 +84,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'账号设置_'+${application.website.name}"></title>
@ -25,10 +26,12 @@
<div class="my_info cf">
<div class="my_info_txt">
<ul class="mytab_list">
<li ><i class="tit">我的头像</i>
<a style="position: relative" >
<img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png" />
<input class="opacity" onchange="picChange()" type="file" id="file0" name="file" title="点击上传图片" style="z-index: 100;cursor: pointer;left: 0px; top: -25px; width: 60px; height: 80px; opacity: 0; position: absolute; "/>
<li><i class="tit">我的头像</i>
<a style="position: relative">
<img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png"/>
<input class="opacity" onchange="picChange()" type="file" id="file0" name="file"
title="点击上传图片"
style="z-index: 100;cursor: pointer;left: 0px; top: -25px; width: 60px; height: 80px; opacity: 0; position: absolute; "/>
</a>
@ -59,27 +62,26 @@
dataType: "json",
success: function (data) {
if (data.code == 200) {
if(data.data.userPhoto){
$("#imgLogo").attr("src",data.data.userPhoto);
if (data.data.userPhoto) {
$("#imgLogo").attr("src", data.data.userPhoto);
}
if(data.data.nickName){
$("#my_name").html(data.data.nickName+"<em class=\"ml10\">[修改]</em>");
}else{
$("#my_name").html(data.data.username+"<em class=\"ml10\">[修改]</em>");
if (data.data.nickName) {
$("#my_name").html(data.data.nickName + "<em class=\"ml10\">[修改]</em>");
} else {
$("#my_name").html(data.data.username + "<em class=\"ml10\">[修改]</em>");
}
if(data.data.userSex === '0'){
if (data.data.userSex === '0') {
$("#my_sex").html("男<em class=\"ml10\">[修改]</em>");
}else if(data.data.userSex === '1'){
} else if (data.data.userSex === '1') {
$("#my_sex").html("女<em class=\"ml10\">[修改]</em>");
}else{
} else {
$("#my_sex").html("请选择");
}
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -96,7 +98,7 @@
var file = $("#file0").val(); //文件名称
if (file != "") {
if(checkPicUpload($("#file0")[0])) {
if (checkPicUpload($("#file0")[0])) {
$.ajaxFileUpload({
url: "/file/picUpload", //用于文件上传的服务器端请求地址
@ -118,7 +120,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -143,7 +145,6 @@
}
}
</script>
</body>

View File

@ -1,6 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'个人中心_'+${application.website.name}"></title>
@ -25,12 +24,14 @@
</div>
<div class="my_r">
<div class="my_info cf">
<img id="imgLogo" class="user_big_head" src="/images/man.png" />
<img id="imgLogo" class="user_big_head" src="/images/man.png"/>
<div class="my_info_txt">
<p class="my_name" id="my_name">
</p>
</p>
<ul class="my_list">
<li class="my_gold"><i>账户余额:</i><em class="red" id="accountBalance">0</em>屋币<!--<em class="red">+</em><em class="red">0</em>代金券--><a href="/pay/index.html" class="btn_link">立即充值</a></li>
<li class="my_gold"><i>账户余额:</i><em class="red" id="accountBalance">0</em>屋币
<!--<em class="red">+</em><em class="red">0</em>代金券--><a href="/pay/index.html"
class="btn_link">立即充值</a></li>
<li class="my_baonian"></li>
</ul>
@ -87,12 +88,12 @@
dataType: "json",
success: function (data) {
if (data.code == 200) {
if(data.data.userPhoto){
$("#imgLogo").attr("src",data.data.userPhoto);
if (data.data.userPhoto) {
$("#imgLogo").attr("src", data.data.userPhoto);
}
if(data.data.nickName){
if (data.data.nickName) {
$("#my_name").html(data.data.nickName);
}else{
} else {
$("#my_name").html(data.data.username);
}
@ -100,7 +101,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -115,7 +116,7 @@
$.ajax({
type: "get",
url: "/user/listBookShelfByPage",
data: {'limit':2},
data: {'limit': 2},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -126,7 +127,7 @@
var book = bookShelfList[i];
bookShelfListHtml += (" <tr class=\"book_list\" vals=\"291\">\n" +
" <td class=\"style bookclass\">\n" +
" <a href=\"/book/bookclass.html?c="+book.catId+"\" >[" + book.catName + "]</a>\n" +
" <a href=\"/book/bookclass.html?c=" + book.catId + "\" >[" + book.catName + "]</a>\n" +
" </td>\n" +
" <td class=\"name\">\n" +
" <a href=\"/book/" + book.bookId + ".html\">\n" +

View File

@ -5,7 +5,7 @@
<groupId>com.java2nb</groupId>
<artifactId>novel</artifactId>
<version>4.3.0-RC1</version>
<version>4.4.0</version>
<modules>
<module>novel-common</module>
<module>novel-front</module>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
@ -7,14 +7,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>作家管理系统-小说精品屋</title>
<link rel="stylesheet" href="/css/base.css?v=1"/>
<link rel="stylesheet" href="/css/user.css" />
<link rel="stylesheet" href="/css/user.css"/>
</head>
</head>
<body class="">
<div class="header">
<div class="mainNav" id="mainNav">
<div class="box_center cf" style="text-align: center;height: 44px;line-height: 48px;color: #fff;font-size: 16px;">
<div class="box_center cf"
style="text-align: center;height: 44px;line-height: 48px;color: #fff;font-size: 16px;">
小说精品屋作家管理
@ -37,7 +38,9 @@
<div class="my_r">
<div class="my_bookshelf">
<div class="title cf">
<h2 class="fl ml10"><a href="/author/author_income_detail.html">订阅明细</a></h2><i class="fl ml20 mr20 font16">|</i><h2 class="fl"><a href="/author/author_income.html" class="red">稿费汇总</a></h2>
<h2 class="fl ml10"><a href="/author/author_income_detail.html">订阅明细</a></h2><i
class="fl ml20 mr20 font16">|</i>
<h2 class="fl"><a href="/author/author_income.html" class="red">稿费汇总</a></h2>
</div>
<div id="divData" class="updateTable">
@ -62,7 +65,6 @@
<tbody id="bookList">
</tbody>
</table>
<div class="pageBox cf" id="shellPage">
@ -120,24 +122,24 @@
$.ajax({
type: "get",
url: "/author/listIncomeMonthByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
var bookList = data.data.list;
if (bookList.length > 0) {
var bookListHtml = "";
for(var i=0;i<bookList.length;i++){
for (var i = 0; i < bookList.length; i++) {
var book = bookList[i];
bookListHtml+=(" <tr class=\"book_list\" >\n" +
bookListHtml += (" <tr class=\"book_list\" >\n" +
" <td class=\"goread\">\n" +
" "+book.incomeMonth+"</td>\n" +
" " + book.incomeMonth + "</td>\n" +
" <td class=\"goread\" >"
+book.preTaxIncome/100+"</td>\n" +
+ book.preTaxIncome / 100 + "</td>\n" +
" <td class=\"goread\">\n" +
" "+book.afterTaxIncome/100+"\n" +
" " + book.afterTaxIncome / 100 + "\n" +
" </td>\n" +
" <td class=\"goread\">"+(book.payStatus == 1 ? '已支付' : '待支付')+
" <td class=\"goread\">" + (book.payStatus == 1 ? '已支付' : '待支付') +
" </td>\n" +
" </tr>");
@ -176,9 +178,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}
@ -191,12 +193,12 @@
}
function updateBookStatus(bookId,status) {
function updateBookStatus(bookId, status) {
$.ajax({
type: "POST",
url: "/author/updateBookStatus",
data: {'bookId':bookId,'status':status==0?1:0},
data: {'bookId': bookId, 'status': status == 0 ? 1 : 0},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -206,9 +208,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}
@ -219,9 +221,6 @@
})
}
</script>
</html>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
@ -7,14 +7,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>作家管理系统-小说精品屋</title>
<link rel="stylesheet" href="/css/base.css?v=1"/>
<link rel="stylesheet" href="/css/user.css" />
<link rel="stylesheet" href="/css/user.css"/>
</head>
</head>
<body class="">
<div class="header">
<div class="mainNav" id="mainNav">
<div class="box_center cf" style="text-align: center;height: 44px;line-height: 48px;color: #fff;font-size: 16px;">
<div class="box_center cf"
style="text-align: center;height: 44px;line-height: 48px;color: #fff;font-size: 16px;">
小说精品屋作家管理
@ -37,7 +38,9 @@
<div class="my_r">
<div class="my_bookshelf">
<div class="title cf">
<h2 class="fl ml10"><a href="/author/author_income_detail.html" class="red">订阅明细</a></h2><i class="fl ml20 mr20 font16">|</i><h2 class="fl"><a href="/author/author_income.html">稿费汇总</a></h2>
<h2 class="fl ml10"><a href="/author/author_income_detail.html" class="red">订阅明细</a></h2><i
class="fl ml20 mr20 font16">|</i>
<h2 class="fl"><a href="/author/author_income.html">稿费汇总</a></h2>
</div>
<div id="divData" class="updateTable">
@ -61,7 +64,6 @@
<tbody id="bookList">
</tbody>
</table>
<div class="pageBox cf" id="shellPage">
@ -117,9 +119,9 @@
function search(curr, limit) {
var data = {'curr':curr,'limit':limit};
var data = {'curr': curr, 'limit': limit};
if(bookId){
if (bookId) {
data.bookId = bookId;
}
@ -133,17 +135,17 @@
var bookList = data.data.list;
if (bookList.length > 0) {
var bookListHtml = "";
for(var i=0;i<bookList.length;i++){
for (var i = 0; i < bookList.length; i++) {
var book = bookList[i];
bookListHtml+=(" <tr class=\"book_list\" >\n" +
bookListHtml += (" <tr class=\"book_list\" >\n" +
" <td class=\"goread\">\n" +
" "+book.incomeDate+"</td>\n" +
" " + book.incomeDate + "</td>\n" +
" <td class=\"goread\" >"
+book.incomeAccount+"</td>\n" +
+ book.incomeAccount + "</td>\n" +
" <td class=\"goread\">\n" +
" "+book.incomeCount+"\n" +
" " + book.incomeCount + "\n" +
" </td>\n" +
" <td class=\"goread\">"+book.incomeNumber+
" <td class=\"goread\">" + book.incomeNumber +
" </td>\n" +
" </tr>");
@ -182,9 +184,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}
@ -197,12 +199,12 @@
}
function updateBookStatus(bookId,status) {
function updateBookStatus(bookId, status) {
$.ajax({
type: "POST",
url: "/author/updateBookStatus",
data: {'bookId':bookId,'status':status==0?1:0},
data: {'bookId': bookId, 'status': status == 0 ? 1 : 0},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -212,9 +214,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}
@ -225,9 +227,6 @@
})
}
</script>
</html>

View File

@ -231,7 +231,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -261,7 +261,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -213,7 +213,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -300,7 +300,7 @@
layer.close(index);
$.ajax({
type: "delete",
url: "/author/deleteIndex/"+indexId,
url: "/author/deleteIndex/" + indexId,
data: {},
dataType: "json",
success: function (data) {
@ -311,7 +311,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -380,7 +380,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -2,10 +2,10 @@
<div class="box_center cf">
<div class="copyright">
<ul>
<li class="menu"><a href="/?to=mobile">手机站</a><i class="line">|</i><a href="/">网站首页</a><i
<li class="menu"><!--<a href="/?to=mobile">手机站</a><i class="line">|</i>--><a href="/">网站首页</a><i
class="line">|</i><a href="/user/feedback.html">反馈留言</a><i class="line">|</i><a
href="/author/index.html">作家专区</a><i class="line">|</i><a
href="/mobile/fiction_house.apk">客户端</a></li>
href="/author/index.html">作家专区</a><!--<i class="line">|</i><a
href="/mobile/fiction_house.apk">客户端</a>--></li>
<li th:text="'Copyright (C) '+${application.website.domain}+' All rights reserved&nbsp;&nbsp;'+${application.website.name}+'版权所有'"></li>
</ul>

View File

@ -161,11 +161,6 @@
text-align: center;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
@ -210,6 +205,26 @@
字体:<a id="fontbig" class="sizebg" onclick="nr_setbg('big')">大</a> <a id="fontmiddle" class="button sizebgon"
onclick="nr_setbg('middle')">中</a> <a
id="fontsmall" class="sizebg" onclick="nr_setbg('small')">小</a>
<a href="javascript:speakChapter()" style="margin-left: 10px">
<svg t="1707099868768" class="icon" viewBox="0 0 800 800" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="1783" id="mx_n_1707099868769" width="22" height="22">
<path d="M393.707231 292.571429L343.13933 487.619048l46.955908 234.779541-97.523809-45.149912-66.82187-108.359788-21.671958-86.687831 66.82187-113.777778z"
fill="#3eaf7c" p-id="1784"></path>
<path d="M451.499118 509.291005a104.747795 61.40388 90 1 0 122.80776 0 104.747795 61.40388 90 1 0-122.80776 0Z"
fill="#3eaf7c" p-id="1785"></path>
<path d="M426.215168 781.996473c-3.611993 0-7.223986-1.805996-10.835979-3.611993l-117.389771-86.687831c-36.119929-23.477954-65.015873-57.791887-83.075838-99.329806-10.835979-25.283951-16.253968-52.373898-16.253968-81.269841s5.417989-55.985891 16.253968-81.269842c16.253968-41.537919 45.149912-74.045855 83.075838-97.523809l110.165785-77.657848c9.029982-5.417989 19.865961-3.611993 25.28395 3.611993 5.417989 9.029982 3.611993 19.865961-3.611993 25.28395L319.661376 361.199295c-32.507937 19.865961-55.985891 48.761905-70.433863 81.269841-9.029982 21.671958-14.447972 45.149912-14.447972 68.627866 0 23.477954 3.611993 45.149912 12.641976 66.821869 14.447972 34.313933 37.925926 63.209877 68.627866 83.075838l117.38977 86.687831c7.223986 5.417989 9.029982 18.059965 3.611993 25.28395 0 5.417989-5.417989 9.029982-10.835978 9.029983z"
fill="#3eaf7c" p-id="1786"></path>
<path d="M523.738977 830.758377c-108.359788 0-193.241623-140.867725-193.241623-317.855379S415.379189 193.241623 523.738977 193.241623c25.283951 0 50.567901 7.223986 74.045855 23.477954 9.029982 5.417989 10.835979 16.253968 5.41799 25.28395s-16.253968 10.835979-25.283951 5.41799c-18.059965-10.835979-34.313933-18.059965-54.179894-18.059965-84.881834 0-157.121693 130.031746-157.121693 281.73545S438.857143 794.638448 523.738977 794.638448s157.121693-130.031746 157.121693-281.73545c0-74.045855-16.253968-146.285714-46.955908-198.659612-5.417989-9.029982-1.805996-19.865961 7.223986-25.28395 9.029982-5.417989 19.865961-1.805996 25.28395 7.223986 32.507937 59.597884 50.567901 135.449735 50.567902 216.719576C718.786596 689.890653 633.904762 830.758377 523.738977 830.758377z"
fill="#3eaf7c" p-id="1787"></path>
<path d="M523.738977 646.546737c-48.761905 0-86.687831-59.597884-86.687831-133.643739S474.977072 379.259259 523.738977 379.259259s86.687831 59.597884 86.687831 133.643739-37.925926 133.643739-86.687831 133.643739z m0-232.973545c-23.477954 0-50.567901 39.731922-50.567901 97.52381s27.089947 97.52381 50.567901 97.523809 50.567901-39.731922 50.567901-97.523809-27.089947-97.52381-50.567901-97.52381z"
fill="#3eaf7c" p-id="1788"></path>
<path d="M523.738977 413.573192h-1.805996l-92.105821-10.835979c-9.029982-1.805996-16.253968-10.835979-16.253968-19.865961 1.805996-9.029982 10.835979-16.253968 19.865961-16.253968l92.105821 10.835979c9.029982 1.805996 16.253968 10.835979 16.253968 19.865961 0 9.029982-9.029982 16.253968-18.059965 16.253968zM372.035273 662.800705c-9.029982 0-16.253968-7.223986-18.059964-16.253968-1.805996-9.029982 5.417989-18.059965 16.253968-19.865961l153.5097-16.253968c9.029982-1.805996 18.059965 5.417989 19.865961 16.253968 1.805996 9.029982-5.417989 18.059965-16.253968 19.865961l-153.5097 16.253968h-1.805997z"
fill="#3eaf7c" p-id="1789"></path>
<path d="M763.936508 364.811287c-5.417989 0-9.029982-1.805996-12.641975-5.417989-7.223986-7.223986-7.223986-18.059965 0-25.283951l25.28395-25.28395c7.223986-7.223986 18.059965-7.223986 25.283951 0s7.223986 18.059965 0 25.28395L776.578483 359.393298c-3.611993 3.611993-9.029982 5.417989-12.641975 5.417989zM771.160494 720.592593c-5.417989 0-9.029982-1.805996-12.641975-5.41799l-25.283951-25.28395c-7.223986-7.223986-7.223986-18.059965 0-25.283951s18.059965-7.223986 25.283951 0l25.28395 25.283951c7.223986 7.223986 7.223986 18.059965 0 25.28395-3.611993 3.611993-7.223986 5.417989-12.641975 5.41799zM819.922399 529.156966h-54.179895c-10.835979 0-18.059965-7.223986-18.059964-18.059964s7.223986-18.059965 18.059964-18.059965h54.179895c10.835979 0 18.059965 7.223986 18.059964 18.059965s-9.029982 18.059965-18.059964 18.059964z"
fill="#3eaf7c" p-id="1790"></path>
</svg>
</a>
</p>
<div class="indexDiv" style="height: 42px;line-height: 42px;text-align:center;background: #f2f2f2">
@ -241,7 +256,7 @@
</div>
<div id="chaptercontent" class="Readarea ReadAjax_content screen_container"
style="color: rgb(0, 0, 0); font-size: 20px;" th:if="${!needBuy}">
<p style="width:100%;text-alight:center; overflow: auto;-webkit-overflow-scrolling:touch;">&nbsp;&nbsp;&nbsp;&nbsp;
<p style="width:100%;text-alight:center; overflow: auto;-webkit-overflow-scrolling:touch;">
<span
th:utext="${bookContent.content}"></span></p>
</div>
@ -300,8 +315,6 @@
}
})
$("#content").css("min-height", ($(window).height() - 60) + "px");
})();
@ -352,7 +365,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
@ -389,6 +402,79 @@
}
console.log(speechSynthesis.getVoices());
$(window).on('beforeunload', function () {
if (speechSynthesis.speaking) {
speechSynthesis.cancel()
}
});
function speakChapter() {
console.log('speechSynthesis.paused', speechSynthesis.paused)
console.log('speechSynthesis.pending', speechSynthesis.pending)
console.log('speechSynthesis.speaking', speechSynthesis.speaking)
if (speechSynthesis.speaking && !speechSynthesis.paused) {
speechSynthesis.pause();
return;
}
if (speechSynthesis.speaking && speechSynthesis.paused) {
speechSynthesis.resume();
}
speak({
'text': $('#chaptercontent').text(),
'speechRate': 0.5,
'pitch': 1,
'lang': 'zh-CN'
}, function () {
console.log('语音播放结束');
}, function () {
console.log('语音开始播放');
});
}
/**
* @description 文字转语音方法
* @public
* @param { text, rate, lang, volume, pitch } object
* @param text 要合成的文字内容,字符串
* @param speechRate 读取文字的语速 0.1~10 正常1
* @param lang 读取文字时的语言
* @param volume 读取时声音的音量 0~1 正常1
* @param voice 读取文字的语音服务
* @param pitch 读取时声音的音高 0~2 正常1
* @returns SpeechSynthesisUtterance
*/
function speak({text, speechRate, lang, volume, pitch, voice}, endEvent, startEvent) {
if (!window.SpeechSynthesisUtterance) {
console.warn('当前浏览器不支持文字转语音服务')
return;
}
if (!text) {
return;
}
const speechUtterance = new SpeechSynthesisUtterance();
speechUtterance.text = text;
speechUtterance.rate = speechRate || 1;
speechUtterance.lang = lang || 'zh-CN';
speechUtterance.volume = volume || 1;
speechUtterance.pitch = pitch || 1;
speechUtterance.voice = voice || null;
speechUtterance.onend = function () {
endEvent && endEvent();
};
speechUtterance.onstart = function () {
startEvent && startEvent();
};
speechSynthesis.speak(speechUtterance);
return speechUtterance;
}
</script>

View File

@ -274,7 +274,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -289,8 +289,6 @@
}
$("#content").css("min-height", ($(window).height() - 60) + "px");
function downloadFile() {
var fileUrl = '/book/download?bookId=' + $("#bookIdHidden").val() + '&bookName=' + $("#bookNamedHidden").val();
window.location.href = fileUrl;

View File

@ -36,41 +36,43 @@
</div>
</head>
<body>
<div id="content">
<input type="hidden" id="bookIdHidden" th:value="${book.id}"/>
<div style="height: 50px;line-height: 50px;text-align: center" class="layui-header header header-doc layui-bg-cyan">
<input type="hidden" id="bookIdHidden" th:value="${book.id}"/>
<div style="height: 50px;line-height: 50px;text-align: center"
class="layui-header header header-doc layui-bg-cyan">
<div style="float: left;margin-left: 10px">
<a href="javascript:history.go(-1)">
<i style="font-size: 20px;color: #fff;" class="layui-icon">&#xe65c;</i></a>
<div style="float: left;margin-left: 10px">
<a href="javascript:history.go(-1)">
<i style="font-size: 20px;color: #fff;" class="layui-icon">&#xe65c;</i></a>
</div>
<a style="color: #ffffff;" th:href="'/book/'+ ${book.id} + '.html'"><b class="layui-icon"
th:utext="${book.bookName}"></b></a>
<div style="float: right;margin-right: 10px">
<a href="/"><i style="font-size: 20px;color: #fff;" class="layui-icon">&#xe68e;</i></a>
</div>
</div>
<a style="color: #ffffff;" th:href="'/book/'+ ${book.id} + '.html'"><b class="layui-icon" th:utext="${book.bookName}"></b></a>
<div style="float: right;margin-right: 10px">
<a href="/"><i style="font-size: 20px;color: #fff;" class="layui-icon">&#xe68e;</i></a>
</div>
</div>
<p style="height: 30px;line-height: 30px;padding: 10px">
<p style="height: 30px;line-height: 30px;padding: 10px">
<a href="#buttom" style="color: red">&nbsp;&nbsp;↓直达页面底部</a>
</p>
<div class="layui-colla-content layui-show indexP layui-row">
<p class="line-limit-length layui-col-xs12 layui-col-sm4 layui-col-md3 layui-col-lg2" style="padding-left:10px;height: 50px;line-height: 50px;" th:each="index : ${bookIndexList}">
<a style="color:#333;" th:href="'/book/'+${index.bookId}+'/'+${index.id}+'.html'" th:utext="${index.indexName}">
</a>
<a href="#buttom" style="color: red">&nbsp;&nbsp;↓直达页面底部</a>
</p>
<div class="layui-colla-content layui-show indexP layui-row">
<p class="line-limit-length layui-col-xs12 layui-col-sm4 layui-col-md3 layui-col-lg2"
style="padding-left:10px;height: 50px;line-height: 50px;" th:each="index : ${bookIndexList}">
<a style="color:#333;" th:href="'/book/'+${index.bookId}+'/'+${index.id}+'.html'"
th:utext="${index.indexName}">
</div>
</a>
</p>
</div>
</div>
<div th:replace="mobile/common/footer :: footer">
</div>
@ -80,13 +82,14 @@
<div th:replace="mobile/common/js :: js">
</div>
<script>
$("#content").css("min-height",($(window).height()-60)+"px");
$.get("/book/addVisit",{"bookId":$("#bookIdHidden").val()},function(){});
function toMyCollect(){
$.get("/book/addVisit", {"bookId": $("#bookIdHidden").val()}, function () {
});
function toMyCollect() {
var token = localStorage.getItem("token");
if(token) {
if (token) {
window.location.href = "/book/search?token=" + token;
}else{
} else {
window.location.href = "/user/login.html";
}
}

View File

@ -62,10 +62,6 @@
height: 180px;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
<body>

View File

@ -1,6 +1,11 @@
<div th:fragment="css">
<link rel="stylesheet" href="/mobile/layui/css/layui.css">
<style type="text/css">
body {
min-height: 100vh;
position: relative;
}
.app {
display: none;
}
@ -22,9 +27,12 @@
}
#footer {
padding-top: 6px;
height: 60px;
line-height: 54px;
position: absolute;
bottom: 0px;
left: 0;
right: 0;
height: 50px;
line-height: 48px;
text-align: center;
}
</style>

View File

@ -1,15 +1,19 @@
<div th:fragment="footer" id="footer"
class="layui-footer footer footer-demo layui-bg-cyan">
<!--<a href="/mobile/book/searchSoftBook.html" style="font-size: 14px;color: #fff;">轻小说</a>
<a href="/mobile/book/searchSoftBook.html?catId=9" style="font-size: 14px;color: #fff;margin-left: 8px">漫画</a>-->
<a href="/?to=pc" style="font-size: 14px;color: #fff;margin-left: 8px">电脑站</a>
<a href="/user/read_history.html" style="font-size: 14px;color: #fff;margin-left: 8px">阅读记录</a>
<a href="/user/favorites.html" style="font-size: 14px;color: #fff;margin-left: 8px">书架</a>
<a href="/mobile/fiction_house.apk" style="font-size: 14px;color: #fff;margin-left: 8px">客户端</a>
<!--<a href="https://www.zinglizingli.xyz/me/index.html" style="font-size: 14px;color: #fff;margin-left: 8px">开发者</a>-->
<div th:fragment="footer">
<div style="height: 50px"></div>
<div id="footer"
class="layui-footer footer footer-demo layui-bg-cyan">
<!--<a href="/mobile/book/searchSoftBook.html" style="font-size: 14px;color: #fff;">轻小说</a>
<a href="/mobile/book/searchSoftBook.html?catId=9" style="font-size: 14px;color: #fff;margin-left: 8px">漫画</a>-->
<!--<a href="/?to=pc" style="font-size: 14px;color: #fff;margin-left: 8px">电脑站</a>-->
<a href="/" style="font-size: 16px;color: #fff;">首页</a>
<a href="/user/read_history.html" style="font-size: 16px;color: #fff;margin-left: 18px">阅读记录</a>
<a href="/user/favorites.html" style="font-size: 16px;color: #fff;margin-left: 18px">书架</a>
<!--<a href="/mobile/fiction_house.apk" style="font-size: 14px;color: #fff;margin-left: 8px">客户端</a>-->
<!--<a href="https://www.zinglizingli.xyz/me/index.html" style="font-size: 14px;color: #fff;margin-left: 8px">开发者</a>-->
<div style="float: right"><a href="#top"><i class="layui-icon"
style="margin-right:15px;font-size: 30px;color:#fff ">&#xe604;</i></a>
<div style="margin-top:-3px;float: right"><a href="#top"><i class="layui-icon"
style="margin-right:15px;font-size: 25px;color:#fff ">&#xe604;</i></a>
</div>
</div>
</div>

View File

@ -1,3 +1,3 @@
<script th:fragment="js" src="/mobile/js/jquery-1.9.1.js"></script>
<script th:fragment="js" src="/mobile/layui/layui.all.js"></script>
<script th:fragment="js" src="/mobile/js/common.js"></script>
<script th:fragment="js" src="/mobile/js/common.js?v2"></script>

View File

@ -41,18 +41,16 @@
}
.user_link {
position: relative;
display: inline-block;
vertical-align: middle;
line-height: 50px;
padding: 0 5px;
color: #fff;
line-height: 40px;
float: right;
color: #3eaf7c;
padding: 11px 12px 0;
}
.user_link a {
color: #fff;
color: #3eaf7c;
}
</style>
@ -64,92 +62,39 @@
<!-- 你的HTML代码 -->
<a name="top"></a>
<ul class="layui-nav app" lay-filter="" style="display:none;padding:0 10px;text-align: center">
<li class="layui-nav-item"><a>分类</a>
<dl class="layui-nav-child">
<dd><a href="/book/book_ranking.html?catId=1&sort=last_index_update_time">玄幻小说</a></dd>
<dd><a href="/book/book_ranking.html?catId=2&sort=last_index_update_time">修真小说</a></dd>
<dd><a href="/book/book_ranking.html?catId=3&sort=last_index_update_time">都市小说</a></dd>
<dd><a href="/book/book_ranking.html?catId=4&sort=last_index_update_time">历史小说</a></dd>
<dd><a href="/book/book_ranking.html?catId=6&sort=last_index_update_time">网游小说</a></dd>
<dd><a href="/book/book_ranking.html?catId=5&sort=last_index_update_time">科幻小说</a></dd>
<dd><a href="/book/book_ranking.html?catId=7&sort=last_index_update_time">女频小说</a></dd>
</dl>
</li>
<li class="layui-nav-item"><a>全本</a>
<dl class="layui-nav-child">
<dd><a href="/book/book_ranking.html?bookStatus=1">全部小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=1">玄幻小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=2">修真小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=3">都市小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=4">历史小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=6">网游小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=5">科幻小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=7">女频小说</a></dd>
</dl>
</li>
<li class="layui-nav-item"><a>排行</a>
<dl class="layui-nav-child">
<dd><a href="/book/book_ranking.html?sortBy=visit_count">全部小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=1">玄幻小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=2">修真小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=3">都市小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=4">历史小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=6">网游小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=5">科幻小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=7">女频小说</a></dd>
</dl>
</li>
<li class="user_link"></li>
<div style="height: 40px;">
<div style="line-height: 50px;width: 120px;float:left;padding-left: 10px"><img style="width: 150px;"
th:src="${application.website.logo}">
</div>
<div class="user_link">
<a style="padding-right: 3px" href="/user/favorites.html">
<svg t="1693622464904" class="icon" viewBox="0 0 1097 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="3653" width="23px" height="23px">
<path d="M998.58390632 852.14701166H126.84569332A41.51236 41.51236 0 0 0 85.33333332 893.65937166v62.26854a41.51236 41.51236 0 0 0 41.51236 41.51236h871.738213a41.51236 41.51236 0 0 0 41.51236-41.51236v-62.26854a41.51236 41.51236 0 0 0-41.51236-41.51236z m-29.293426 83.014048h-813.172704a8.537246 8.537246 0 0 1-8.537246-8.537246v-3.681687a8.537246 8.537246 0 0 1 8.537246-8.537247h813.172704a8.537246 8.537246 0 0 1 8.537246 8.537247v3.681687a8.537246 8.537246 0 0 1-8.537246 8.537246zM126.84569332 810.63465166h124.537079a41.51236 41.51236 0 0 0 41.51236-41.51236V229.47228566a41.51236 41.51236 0 0 0-41.51236-41.51236H126.84569332A41.51236 41.51236 0 0 0 85.33333332 229.47228566v539.650006a41.51236 41.51236 0 0 0 41.51236 41.51236zM156.72605532 246.49342066h64.883071a12.805869 12.805869 0 0 1 12.805869 12.805869v479.995998a12.805869 12.805869 0 0 1-12.805869 12.80587H156.72605532a12.805869 12.805869 0 0 1-12.80587-12.80587V259.29928966a12.805869 12.805869 0 0 1 12.80587-12.805869z m239.939305 564.141231h124.53708a41.51236 41.51236 0 0 0 41.51236-41.51236V278.62548066l291.653674 510.335237 0.266789 0.480221a41.619075 41.619075 0 0 0 56.826045 15.527116l107.932136-62.962191A42.600859 42.600859 0 0 0 1034.18422332 684.02729066L727.73976932 147.49337866l-0.266789-0.48022a41.619075 41.619075 0 0 0-56.826045-15.527116l-107.932135 62.962191V84.17902666A41.51236 41.51236 0 0 0 521.20244032 42.66666666h-124.53708a41.51236 41.51236 0 0 0-41.51236 41.51236v684.943265a41.51236 41.51236 0 0 0 41.51236 41.51236z m296.295802-597.938055a3.735045 3.735045 0 0 1 5.122348 1.376631l259.841761 454.608363a12.805869 12.805869 0 0 1-4.663471 17.415982l-56.271124 32.825712a12.805869 12.805869 0 0 1-17.544041-4.663471L624.11894332 267.59109066a12.805869 12.805869 0 0 1 4.663471-17.415983zM426.49236432 101.20016166h64.883072a12.805869 12.805869 0 0 1 12.805869 12.805869v625.289257a12.805869 12.805869 0 0 1-12.805869 12.80587h-64.883072a12.805869 12.805869 0 0 1-12.805869-12.80587V114.00603066a12.805869 12.805869 0 0 1 12.805869-12.805869z m0 0"
p-id="3654" fill="#3eaf7c"></path>
</svg>
</a>
<a href="/user/userinfo.html">
<svg t="1698639187751" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="4190" width="23" height="23">
<path d="M704 329.152C704 209.365333 622.848 128 512 128s-192 81.365333-192 201.152C320 454.762667 407.146667 554.666667 512 554.666667s192-99.904 192-225.514667z m42.666667 0C746.666667 476.714667 642.176 597.333333 512 597.333333s-234.666667-120.618667-234.666667-268.181333C277.333333 181.546667 381.824 85.333333 512 85.333333s234.666667 96.213333 234.666667 243.818667zM512.106667 640c408.96 0 404.864 256.512 404.864 256.512 3.093333 23.274667-13.482667 42.154667-37.098667 42.154667H144.32c-23.573333 0-41.088-19.136-37.077333-42.154667 0 0-4.096-256.512 404.864-256.512zM149.909333 896l0.064 3.861333-0.704 3.968c0.682667-3.882667-2.837333-7.829333-4.949333-7.829333H879.872c-2.154667 0-5.504 3.818667-5.205333 6.144l-0.426667-3.157333 0.064-3.157334c0-0.853333-0.128-3.349333-0.533333-7.125333a161.813333 161.813333 0 0 0-4.266667-23.082667 192.96 192.96 0 0 0-35.242667-71.104C780.330667 725.461333 678.634667 682.666667 512.106667 682.666667c-166.549333 0-268.224 42.794667-322.176 111.850666a192.96 192.96 0 0 0-35.242667 71.104c-2.176 8.426667-3.541333 16.192-4.266667 23.082667a81.045333 81.045333 0 0 0-0.512 7.296z"
fill="#3eaf7c" p-id="4191"></path>
</svg>
</a>
</ul>
<ul class="layui-nav pc" lay-filter="" style="padding:0 36px;text-align: center">
<li class="layui-nav-item"><a href="/book/book_ranking.html?catId=1&sort=last_index_update_time">玄幻小说</a></li>
<li class="layui-nav-item"><a href="/book/book_ranking.html?catId=2&sort=last_index_update_time">修真小说</a></li>
<li class="layui-nav-item"><a href="/book/book_ranking.html?catId=3&sort=last_index_update_time">都市小说</a></li>
<li class="layui-nav-item"><a href="/book/book_ranking.html?catId=4&sort=last_index_update_time">历史小说</a></li>
<li class="layui-nav-item"><a href="/book/book_ranking.html?catId=6&sort=last_index_update_time">网游小说</a></li>
<li class="layui-nav-item"><a href="/book/book_ranking.html?catId=5&sort=last_index_update_time">科幻小说</a></li>
<li class="layui-nav-item"><a href="/book/book_ranking.html?catId=7&sort=last_index_update_time">女频小说</a></li>
<li class="layui-nav-item"><a>完本小说</a>
<dl class="layui-nav-child"> <!-- 二级菜单 -->
<dd><a href="/book/book_ranking.html?bookStatus=1">全部小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=1">玄幻小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=2">修真小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=3">都市小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=4">历史小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=6">网游小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=5">科幻小说</a></dd>
<dd><a href="/book/book_ranking.html?bookStatus=1&catId=7">女频小说</a></dd>
</dl>
</li>
<li class="layui-nav-item"><a>小说排行</a>
<dl class="layui-nav-child"> <!-- 二级菜单 -->
<dd><a href="/book/book_ranking.html?sortBy=visit_count">全部小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=1">玄幻小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=2">修真小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=3">都市小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=4">历史小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=6">网游小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=5">科幻小说</a></dd>
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=7">女频小说</a></dd>
</dl>
</li>
<li class="user_link"></li>
</div>
</div>
</ul>
<div class="layui-container">
<div class="layui-container" style="padding-left: 2%">
<div class="layui-row">
<div class="layui-col-xs10 layui-col-sm10 layui-col-md11 layui-col-lg11" style="padding-top:1%">
<div class="layui-col-xs10 layui-col-sm10 layui-col-md11 layui-col-lg11">
<input id="title" type="text" name="title" required lay-verify="required" placeholder="请输入书名·作者"
autocomplete="off"
class="layui-input">
</div>
<div class="layui-col-xs1" style="padding: 1%">
<div class="layui-col-xs1" style="padding: 0 1% 1%">
<button onclick="searchBooks()" class="layui-btn" lay-submit lay-filter="formDemo">搜索</button>
</div>
</div>
@ -263,7 +208,7 @@
if (data.code == 200) {
var updateRankBooks = data.data;
var updateRankBookHtml = "";
for (var i = 0; i < 10; i++) {
for (var i = 0; i < updateRankBooks.length; i++) {
var updateRankBook = updateRankBooks[i];
if (updateRankBook.bookDesc) {

View File

@ -5,7 +5,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title th:text="${application.website.name}+'列表'"></title>
<title th:text="${application.website.name}+'充值'"></title>
<meta name="keywords"
th:content="${application.website.name}+',精品小说,弹幕网站,弹幕,弹幕小说网站,免费小说,小说阅读,小说排行,轻小说,txt小说下载,电子书下载,动漫轻小说,日本轻小说'">
@ -79,11 +79,6 @@
padding-bottom: 20px;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
<body>
@ -119,7 +114,7 @@
style="color: #3eaf7c" id="accountBalance">10</em> 屋币<!--<em class="red">+0</em>代金券-->
</div>
</div>
<div id="payAmount" class="pay_way layui-row layui-col-space15" style="text-align: center;padding-top: 20px;">
<div id="payAmount" class="pay_way layui-row" style="text-align: center;padding-top: 20px;">
<h5>选择充值金额</h5>
<li vals="10" class="layui-col-xs4 layui-col-sm3 layui-col-md2">
<div class="layui-panel">
@ -170,7 +165,6 @@
<div th:replace="mobile/common/js :: js"></div>
<script>
$("#body").css("min-height", ($(window).height() - 110) + "px")
//查询用户信息
$.ajax({
@ -190,7 +184,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -62,10 +62,6 @@
height: 180px;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
<body>
@ -113,7 +109,6 @@
<div th:replace="mobile/common/js :: js"></div>
<script>
$("#body").css("min-height", ($(window).height() - 110) + "px")
search(1, 20);

View File

@ -25,19 +25,20 @@
</a>
</div>
</div>
<form lay-filter="loginForm" id="form1" style="height: 500px;padding-top:30px;padding-right: 20px" class="layui-form" action="">
<form lay-filter="loginForm" id="form1" style="height: 500px;padding-top:30px;padding-right: 20px" class="layui-form"
action="">
<input type="hidden" id="bookIdHidden" name="bookId" th:value="${bookId}"/>
<div class="layui-form-item">
<label class="layui-form-label">手机号码</label>
<div class="layui-input-inline">
<input name="txtUName" type="text" id="txtUName" placeholder="请输入手机号"
<input name="txtUName" type="text" id="txtUName" placeholder="请输入手机号"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input name="txtPassword" type="password" id="txtPassword" placeholder="请输入密码"
<input name="txtPassword" type="password" id="txtPassword" placeholder="请输入密码"
autocomplete="off" class="layui-input">
</div>
@ -49,8 +50,8 @@
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<input type="button" value="登录" id="btnLogin" class="layui-btn" />
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
<input type="button" value="登录" id="btnLogin" class="layui-btn"/>
<a class="layui-btn layui-btn-primary" href="/user/register.html">注册</a>
</div>
</div>
</form>
@ -62,25 +63,24 @@
<div th:replace="mobile/common/js :: js">
</div>
<script type="text/javascript">
$("#form1").css("min-height",($(window).height() - 140)+"px")
if(localStorage.getItem("autoLogin")==1){
$("#autoLogin").prop("checked",'true');
layui.form.render('checkbox','loginForm');
}else{
if (localStorage.getItem("autoLogin") == 1) {
$("#autoLogin").prop("checked", 'true');
layui.form.render('checkbox', 'loginForm');
} else {
$("#autoLogin").removeAttr("checked");
}
$("#btnLogin").click(function () {
var username = $("#txtUName").val();
if(username.isBlank()){
if (username.isBlank()) {
layer.alert("手机号不能为空");
return;
}
if(!username.isPhone()){
if (!username.isPhone()) {
layer.alert("手机号格式不正确");
return;
}
var password = $("#txtPassword").val();
if(password.isBlank()){
if (password.isBlank()) {
layer.alert("密码不能为空");
return;
}
@ -91,12 +91,12 @@
dataType: "json",
success: function (data) {
if (data.code == 200) {
if($("#autoLogin").is(':checked')){
$.cookie('Authorization', data.data.token, { expires: 7 ,path: '/' });
localStorage.setItem("autoLogin","1");
}else {
$.cookie('Authorization', data.data.token,{ path: '/' });
localStorage.setItem("autoLogin","0");
if ($("#autoLogin").is(':checked')) {
$.cookie('Authorization', data.data.token, {expires: 7, path: '/'});
localStorage.setItem("autoLogin", "1");
} else {
$.cookie('Authorization', data.data.token, {path: '/'});
localStorage.setItem("autoLogin", "0");
}
var orginUrl = getSearchString("originUrl");
window.location.href = orginUrl == undefined || orginUrl.isBlank() ? "/" : orginUrl;
@ -114,5 +114,4 @@
</script>
</html>

View File

@ -62,10 +62,6 @@
height: 180px;
}
#footer {
padding-top: 10px;
line-height: 43px;
}
</style>
</head>
<body>
@ -113,7 +109,6 @@
<div th:replace="mobile/common/js :: js"></div>
<script>
$("#body").css("min-height", ($(window).height() - 110) + "px")
search(1, 20);

View File

@ -25,20 +25,21 @@
</a>
</div>
</div>
<form lay-filter="loginForm" id="form1" style="height: 500px;padding-top:30px;padding-right: 20px" class="layui-form" action="">
<form lay-filter="loginForm" id="form1" style="height: 500px;padding-top:30px;padding-right: 20px" class="layui-form"
action="">
<input type="hidden" id="bookIdHidden" name="bookId" th:value="${bookId}"/>
<div class="layui-form-item">
<label class="layui-form-label">手机号码</label>
<div class="layui-input-inline">
<input name="txtUName" type="text" id="txtUName" placeholder="请输入手机号"
<input name="txtUName" type="text" id="txtUName" placeholder="请输入手机号"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input name="txtPassword" type="password" id="txtPassword" placeholder="请输入密码"
<input name="txtPassword" type="password" id="txtPassword" placeholder="请输入密码"
autocomplete="off" class="layui-input">
</div>
@ -46,7 +47,7 @@
<div class="layui-form-item ">
<label class="layui-form-label">验证码</label>
<div class="layui-input-inline">
<input name="txtUName" type="text" id="TxtChkCode" placeholder="请输入验证码"
<input name="txtUName" type="text" id="TxtChkCode" placeholder="请输入验证码"
autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline"><img
@ -55,8 +56,8 @@
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<input type="button" value="注册" id="btnRegister" class="layui-btn" />
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
<input type="button" value="注册" id="btnRegister" class="layui-btn"/>
<a class="layui-btn layui-btn-primary" href="/user/login.html">登录</a>
</div>
</div>
</form>
@ -68,9 +69,8 @@
<div th:replace="mobile/common/js :: js">
</div>
<script type="text/javascript">
$("#form1").css("min-height",($(window).height() - 140)+"px")
$("#chkd").click();
$("#btnRegister").click(function () {
var username = $("#txtUName").val();
if (username.isBlank()) {
@ -94,12 +94,12 @@
$.ajax({
type: "POST",
url: "/user/register",
data: {"username": username, "password": password,"velCode":velCode},
data: {"username": username, "password": password, "velCode": velCode},
dataType: "json",
success: function (data) {
if (data.code == 200) {
$.cookie('Authorization', data.data.token, {path: '/'});
window.location.href="/";
window.location.href = "/";
} else {
layer.alert(data.msg);
}
@ -111,6 +111,7 @@
})
})
//获取验证码
function getVerify(obj) {
obj.src = "/file/getVerify?" + Math.random();
@ -118,5 +119,4 @@
</script>
</html>

View File

@ -213,7 +213,6 @@
<script>
$("#body").css("min-height", ($(window).height() - 60) + "px")
//查询用户信息
$.ajax({
@ -244,7 +243,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -1,6 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'充值_'+${application.website.name}"></title>
@ -20,39 +19,51 @@
<div class="payBox cf">
<div class="payHead cf">
<div class="fl">
充值账号:<span class="user_name" id="my_name"></span>余额:<em class="red" id="accountBalance">0</em>屋币<!--<em class="red">+0</em>代金券-->
充值账号:<span class="user_name" id="my_name"></span>余额:<em class="red" id="accountBalance">0</em>屋币
<!--<em class="red">+0</em>代金券-->
</div>
</div>
<div class="payCon">
<h5>选择充值方式</h5>
<ul class="pay_way cf" id="ulPayType">
<li class="on" valp="1"><img class="pay_pic" src="../images/pay_zfb.png" alt="支付宝支付" /></li>
<li valp="2"><img class="pay_pic" src="../images/pay_wx.png" alt="微信支付" /></li>
<li class="on" valp="1"><img class="pay_pic" src="../images/pay_zfb.png" alt="支付宝支付"/></li>
<li valp="2"><img class="pay_pic" src="../images/pay_wx.png" alt="微信支付"/></li>
</ul>
<h5>选择充值金额</h5>
<ul class="pay_way cf" id="ulZFWX">
<li vals="10"><strong>10元</strong><span class="pay_mn">1000屋币</span></li>
<li vals="30"><strong>30元</strong><span class="pay_mn">3000屋币</span></li>
<li vals="50"><strong>50元</strong><span class="pay_mn">5000屋币<!--<em class="red">+ 送500代金券</em>--></span></li>
<li vals="100"><strong>100元</strong><span class="pay_mn">10000屋币<!--<em class="red">+ 送1200代金券</em>--></span></li>
<li vals="200"><strong>200元</strong><span class="pay_mn">20000屋币<!--<em class="red">+ 送3000代金券</em>--></span></li>
<li vals="500"><strong>500元</strong><span class="pay_mn">50000屋币<!--<em class="red">+ 送10000代金券</em>--></span></li>
<li vals="50"><strong>50元</strong><span class="pay_mn">5000屋币
<!--<em class="red">+ 送500代金券</em>--></span></li>
<li vals="100"><strong>100元</strong><span class="pay_mn">10000屋币
<!--<em class="red">+ 送1200代金券</em>--></span></li>
<li vals="200"><strong>200元</strong><span class="pay_mn">20000屋币
<!--<em class="red">+ 送3000代金券</em>--></span></li>
<li vals="500"><strong>500元</strong><span class="pay_mn">50000屋币
<!--<em class="red">+ 送10000代金券</em>--></span></li>
</ul>
<ul class="pay_way cf" style="display:none;" id="ulPayPal">
<li vals="20"><strong>20美元</strong><span class="pay_mn">10000屋币</span></li>
<li vals="50" class="on"><strong>50美元</strong><span class="pay_mn">25000屋币<em class="red"></em></span></li>
<li vals="100"><strong>100美元</strong><span class="pay_mn">50000屋币<em class="red"></em></span></li>
<li vals="50" class="on"><strong>50美元</strong><span class="pay_mn">25000屋币<em class="red"></em></span>
</li>
<li vals="100"><strong>100美元</strong><span class="pay_mn">50000屋币<em class="red"></em></span>
</li>
</ul>
<ul class="pay_Checkout" id="ulZFWXXJ">
<li>当前汇率1元=100屋币</li>
<li>总计金额:<em class="red" id="showTotal">¥50元</em> 获得 <em class="red" id="showRemark">5000屋币<!--+500代金券--></em></li>
<li style="display:none"><a class="btn_red" href="pay_success.html" onclick="javascript:UserPay.sendPay();">立即支付</a></li>
<li>总计金额:<em class="red" id="showTotal">¥50元</em> 获得 <em class="red" id="showRemark">5000屋币
<!--+500代金券--></em></li>
<li style="display:none"><a class="btn_red" href="pay_success.html"
onclick="javascript:UserPay.sendPay();">立即支付</a></li>
</ul>
<ul class="pay_Checkout" style="display:none;" id="ulPayPalXJ">
<li>当前汇率1美元=500屋币</li>
<li>总计金额:<em class="red" id="showPayPalTotal">50美元</em> 获得 <em class="red" id="showPayPalRemark">25000屋币</em></li>
<li style="display:none"><a class="btn_red" href="javascript:void(0);" onclick="javascript:UserPay.sendPay();">立即支付</a></li>
<li>总计金额:<em class="red" id="showPayPalTotal">50美元</em> 获得 <em class="red"
id="showPayPalRemark">25000屋币</em>
</li>
<li style="display:none"><a class="btn_red" href="javascript:void(0);"
onclick="javascript:UserPay.sendPay();">立即支付</a></li>
</ul>
</div>
<div class="payFoot">
@ -68,7 +79,7 @@
</div>
</div>
<input type="hidden" id="pValue" name="payAmount" />
<input type="hidden" id="pValue" name="payAmount"/>
</form>
@ -80,7 +91,6 @@
<script type="text/javascript">
//查询用户信息
$.ajax({
type: "get",
@ -89,9 +99,9 @@
dataType: "json",
success: function (data) {
if (data.code == 200) {
if(data.data.nickName){
if (data.data.nickName) {
$("#my_name").html(data.data.nickName);
}else{
} else {
$("#my_name").html(data.data.username);
}
@ -99,7 +109,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -115,9 +125,9 @@
var payType = $("#ulPayType").find("li.on").attr("valp");
if(payType == 2){
if (payType == 2) {
layer.alert("微信支付暂未开通敬请期待");
return ;
return;
}
$("#pValue").val($(this).attr("vals"));
@ -125,9 +135,6 @@
$("#payform").submit();
});
</script>

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'我的书评_'+${application.website.name}"></title>
@ -54,24 +55,24 @@
$.ajax({
type: "get",
url: "/user/listCommentByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
var commentList = data.data.list;
if (commentList.length > 0) {
$("#bookCommentTotal").html("("+data.data.total+")");
$("#bookCommentTotal").html("(" + data.data.total + ")");
var commentListHtml = "";
for (var i = 0; i < commentList.length; i++) {
var comment = commentList[i];
commentListHtml += ("<div class=\"comment_list cf\">" +
"<div class=\"user_heads fl\" vals=\"389\">" +
"<img src=\""+(comment.createUserPhoto ? comment.createUserPhoto : '/images/man.png')+"\" class=\"user_head\" alt=\"\">" +
"<img src=\"" + (comment.createUserPhoto ? comment.createUserPhoto : '/images/man.png') + "\" class=\"user_head\" alt=\"\">" +
"<span class=\"user_level1\" style=\"display: none;\">见习</span></div>" +
"<ul class=\"pl_bar fr\">\t\t\t<li class=\"name\">"+(comment.createUserName.substr(0, 4) + "****" + comment.createUserName.substr(comment.createUserName.length - 3, 3))+"</li><li class=\"dec\">" +
comment.commentContent+
"<ul class=\"pl_bar fr\">\t\t\t<li class=\"name\">" + (comment.createUserName.substr(0, 4) + "****" + comment.createUserName.substr(comment.createUserName.length - 3, 3)) + "</li><li class=\"dec\">" +
comment.commentContent +
"</li><li class=\"other cf\">" +
"<span class=\"time fl\">"+comment.createTime+"</span>" +
"<span class=\"time fl\">" + comment.createTime + "</span>" +
"<span class=\"fr\"><a href=\"javascript:void(0);\" onclick=\"javascript:BookDetail.AddAgreeTotal(77,this);\" class=\"zan\" style=\"display: none;\">赞<i class=\"num\">(0)</i></a>" +
"</span></li>\t\t</ul>\t</div>");
}
@ -109,9 +110,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}

View File

@ -1,11 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head th:replace="common/header :: common_head(~{::title},~{::meta},~{::link},~{})">
<title th:text="'我的书架_'+${application.website.name}"></title>
<meta name="keywords" th:content="'我的书架,个人中心,'+${application.website.name}+'小说,'+${application.website.name}" />
<meta name="description" th:content="${application.website.name}+'小说每日更新小说连载,小说排行榜,提供言情小说,都市小说,玄幻小说,穿越小说,青春小说,总裁豪门小说,网络小说,免费小说,全本小说,首发小说,最新章节免费小说阅读,精彩尽在'+${application.website.name}+'小说!'" />
<link rel="stylesheet" href="/css/user.css" />
<meta name="keywords" th:content="'我的书架,个人中心,'+${application.website.name}+'小说,'+${application.website.name}"/>
<meta name="description"
th:content="${application.website.name}+'小说每日更新小说连载,小说排行榜,提供言情小说,都市小说,玄幻小说,穿越小说,青春小说,总裁豪门小说,网络小说,免费小说,全本小说,首发小说,最新章节免费小说阅读,精彩尽在'+${application.website.name}+'小说!'"/>
<link rel="stylesheet" href="/css/user.css"/>
</head>
</head>
<body class="">
@ -29,7 +31,9 @@
<div class="my_r">
<div class="my_bookshelf">
<div class="title cf">
<h2 class="fl"><a href="javascript:void(0);" class="red">我的书架</a></h2><i class="fl ml20 mr20 font16">|</i><h2 class="fl"><a href="/user/read_history.html" >最近阅读</a></h2>
<h2 class="fl"><a href="javascript:void(0);" class="red">我的书架</a></h2><i
class="fl ml20 mr20 font16">|</i>
<h2 class="fl"><a href="/user/read_history.html">最近阅读</a></h2>
</div>
<div id="divData" class="updateTable">
@ -56,7 +60,6 @@
<tbody id="bookShelfList">
</tbody>
</table>
<div class="pageBox cf" id="shellPage">
@ -82,31 +85,31 @@
$.ajax({
type: "get",
url: "/user/listBookShelfByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
var bookShelfList = data.data.list;
if (bookShelfList.length > 0) {
var bookShelfListHtml = "";
for(var i=0;i<bookShelfList.length;i++){
for (var i = 0; i < bookShelfList.length; i++) {
var book = bookShelfList[i];
bookShelfListHtml+=(" <tr class=\"book_list\" vals=\"291\">\n" +
bookShelfListHtml += (" <tr class=\"book_list\" vals=\"291\">\n" +
" <td class=\"style bookclass\">\n" +
" <a href=\"/book/bookclass.html?c="+book.catId+"\" >["+book.catName+"]</a>\n" +
" <a href=\"/book/bookclass.html?c=" + book.catId + "\" >[" + book.catName + "]</a>\n" +
" </td>\n" +
" <td class=\"name\">\n" +
" <a href=\"/book/"+book.bookId+".html\">\n" +
" "+book.bookName+"</a>\n" +
" <a href=\"/book/" + book.bookId + ".html\">\n" +
" " + book.bookName + "</a>\n" +
" </td>\n" +
" <td class=\"chapter\" valsc=\"291|2037554|1\">\n" +
"<a href='/book/"+book.bookId+"/"+book.lastIndexId+".html'>"+book.lastIndexName+"</a>"+
"<a href='/book/" + book.bookId + "/" + book.lastIndexId + ".html'>" + book.lastIndexName + "</a>" +
" </td>\n" +
" <td class=\"time\">\n" +
" "+book.lastIndexUpdateTime+"\n" +
" " + book.lastIndexUpdateTime + "\n" +
" </td>\n" +
" <td class=\"goread\">\n" +
"<a href='/book/"+book.bookId+"/"+book.preContentId+".html'>继续阅读</a>"+
"<a href='/book/" + book.bookId + "/" + book.preContentId + ".html'>继续阅读</a>" +
" </td>\n" +
" </tr>");
}
@ -144,9 +147,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}

View File

@ -74,7 +74,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -1,6 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'我的反馈_'+${application.website.name}"></title>
@ -34,8 +33,6 @@
<dd id="feedbackList">
</dd>
</dl>
<div class="cf">
@ -61,7 +58,7 @@
$.ajax({
type: "get",
url: "/user/listUserFeedBackByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -71,8 +68,8 @@
for (var i = 0; i < feedbackList.length; i++) {
var feedback = feedbackList[i];
feedbackListHtml += (" <div class=\"comment_list clear\" ><ul>\n" +
" <li class=\"li_1\"><span class=\"user_name fl\"></span><span class=\"time fl\">"+feedback.createTime+"</span></li>\n" +
" <li class=\"li_2\">"+feedback.content+"</li>\n" +
" <li class=\"li_1\"><span class=\"user_name fl\"></span><span class=\"time fl\">" + feedback.createTime + "</span></li>\n" +
" <li class=\"li_2\">" + feedback.content + "</li>\n" +
" </ul></div>");
}
$("#feedbackList").html(feedbackListHtml);
@ -109,9 +106,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'最近阅读_'+${application.website.name}"></title>
@ -13,7 +14,9 @@
<div class="viewhistoryBox">
<div class="my_bookshelf">
<div class="title cf">
<h2 class="fl ml10"><a href="javascript:void(0);" class="red">最近阅读</a></h2><i class="fl ml20 mr20 font16">|</i><h2 class="fl"><a href="/user/favorites.html">我的书架</a></h2>
<h2 class="fl ml10"><a href="javascript:void(0);" class="red">最近阅读</a></h2><i
class="fl ml20 mr20 font16">|</i>
<h2 class="fl"><a href="/user/favorites.html">我的书架</a></h2>
</div>
<div id="divData" class="updateTable">
<table cellpadding="0" cellspacing="0">
@ -69,31 +72,31 @@
$.ajax({
type: "get",
url: "/user/listReadHistoryByPage",
data: {'curr':curr,'limit':limit},
data: {'curr': curr, 'limit': limit},
dataType: "json",
success: function (data) {
if (data.code == 200) {
var bookHistoryList = data.data.list;
if (bookHistoryList.length > 0) {
var bookHistoryListHtml = "";
for(var i=0;i<bookHistoryList.length;i++){
for (var i = 0; i < bookHistoryList.length; i++) {
var book = bookHistoryList[i];
bookHistoryListHtml+=(" <tr class=\"book_list\" vals=\"291\">\n" +
bookHistoryListHtml += (" <tr class=\"book_list\" vals=\"291\">\n" +
" <td class=\"style bookclass\">\n" +
" <a href=\"/book/bookclass.html?c="+book.catId+"\" >["+book.catName+"]</a>\n" +
" <a href=\"/book/bookclass.html?c=" + book.catId + "\" >[" + book.catName + "]</a>\n" +
" </td>\n" +
" <td class=\"name\">\n" +
" <a href=\"/book/"+book.bookId+".html\">\n" +
" "+book.bookName+"</a>\n" +
" <a href=\"/book/" + book.bookId + ".html\">\n" +
" " + book.bookName + "</a>\n" +
" </td>\n" +
" <td class=\"chapter\" valsc=\"291|2037554|1\">\n" +
"<a href='/book/"+book.bookId+"/"+book.lastIndexId+".html'>"+book.lastIndexName+"</a>"+
"<a href='/book/" + book.bookId + "/" + book.lastIndexId + ".html'>" + book.lastIndexName + "</a>" +
" </td>\n" +
" <td class=\"time\">\n" +
" "+book.lastIndexUpdateTime+"\n" +
" " + book.lastIndexUpdateTime + "\n" +
" </td>\n" +
" <td class=\"goread\">\n" +
"<a href='/book/"+book.bookId+"/"+book.preContentId+".html'>继续阅读</a>"+
"<a href='/book/" + book.bookId + "/" + book.preContentId + ".html'>继续阅读</a>" +
" </td>\n" +
" </tr>");
}
@ -131,9 +134,9 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
}else {
} else {
layer.alert(data.msg);
}

View File

@ -27,7 +27,7 @@
<div class="my_info_txt">
<ul class="mytab_list">
<li><i class="tit">我的昵称</i><input name="txtNiceName" type="text" value="15171695474"
maxlength="20" id="txtNiceName" class="s_input"
maxlength="11" id="txtNiceName" class="s_input"
placeholder=""/></li>
<li><i class="tit">&nbsp;</i>用户名只能包括汉字、英文字母、数字和下划线</li>
<li><i class="tit">&nbsp;</i><input type="button" onclick="updateName()" name="btn" value="修改"
@ -61,7 +61,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -96,7 +96,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
$("#LabErr").html(data.msg);

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'修改密码_'+${application.website.name}"></title>
@ -24,13 +25,18 @@
<div class="my_r">
<div class="my_info cf">
<div class="my_info_txt">
<ul class="mytab_list">
<li><i class="tit">我的密码</i><input name="oldPass" type="password" id="txtOldPass" class="s_input" placeholder="请输入原密码" /></li>
<li><i class="tit">&nbsp;</i><input name="txtNewPass1" type="password" id="txtNewPass1" class="s_input" placeholder="请输入密码" /></li>
<li><i class="tit">&nbsp;</i><input name="txtNewPass2" type="password" id="txtNewPass2" class="s_input" placeholder="请确认新密码" /></li>
<li><i class="tit">&nbsp;</i><input type="submit" name="btnExchangePassword" value="修改" id="btnExchangePassword" onclick="updatePassword()" class="s_btn btn_red" /></li>
<li><i class="tit">&nbsp;</i><span id="LabErr"></span></li>
</ul>
<ul class="mytab_list">
<li><i class="tit">我的密码</i><input name="oldPass" type="password" id="txtOldPass" class="s_input"
placeholder="请输入密码"/></li>
<li><i class="tit">&nbsp;</i><input name="txtNewPass1" type="password" id="txtNewPass1"
class="s_input" placeholder="请输入新密码"/></li>
<li><i class="tit">&nbsp;</i><input name="txtNewPass2" type="password" id="txtNewPass2"
class="s_input" placeholder="请确认新密码"/></li>
<li><i class="tit">&nbsp;</i><input type="submit" name="btnExchangePassword" value="修改"
id="btnExchangePassword" onclick="updatePassword()"
class="s_btn btn_red"/></li>
<li><i class="tit">&nbsp;</i><span id="LabErr"></span></li>
</ul>
</div>
</div>
</div>
@ -57,14 +63,14 @@
$("#LabErr").html("确认密码不能为空");
return;
}
if(newPassword1 !== newPassword2){
if (newPassword1 !== newPassword2) {
$("#LabErr").html("两次输入的新密码不匹配");
return;
}
$.ajax({
type: "POST",
url: "/user/updatePassword",
data: {'oldPassword':oldPassword,'newPassword1':newPassword1,'newPassword2':newPassword2},
data: {'oldPassword': oldPassword, 'newPassword1': newPassword1, 'newPassword2': newPassword2},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -72,7 +78,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
$("#LabErr").html(data.msg);

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'修改性别_'+${application.website.name}"></title>
@ -24,14 +25,16 @@
<div class="my_r">
<div class="my_info cf">
<div class="my_info_txt">
<ul class="mytab_list">
<li><i class="tit">我的性别</i>
<label><input type="radio" name="sex" value="0" />&nbsp;男生</label>
<label><input class="ml20" type="radio" name="sex" value="1" checked />&nbsp;女生</label>
</li>
<li class="mt20"><i class="tit">&nbsp;</i><input type="button" onclick="updateSex()" name="btn" value="修改" id="btn" class="s_btn btn_red" /></li>
<li><i class="tit">&nbsp;</i><span id="LabErr"></span></li>
</ul>
<ul class="mytab_list">
<li><i class="tit">我的性别</i>
<label><input type="radio" name="sex" value="0"/>&nbsp;男生</label>
<label><input class="ml20" type="radio" name="sex" value="1" checked/>&nbsp;女生</label>
</li>
<li class="mt20"><i class="tit">&nbsp;</i><input type="button" onclick="updateSex()" name="btn"
value="修改" id="btn" class="s_btn btn_red"/>
</li>
<li><i class="tit">&nbsp;</i><span id="LabErr"></span></li>
</ul>
</div>
</div>
</div>
@ -50,15 +53,14 @@
dataType: "json",
success: function (data) {
if (data.code == 200) {
if(data.data.userSex === '0'){
$("input[name=sex]").eq(0).attr("checked",true);
if (data.data.userSex === '0') {
$("input[name=sex]").eq(0).attr("checked", true);
}
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -69,11 +71,12 @@
layer.alert('网络异常');
}
})
function updateSex() {
$.ajax({
type: "POST",
url: "/user/updateUserInfo",
data: {'userSex':$("input[name=sex]:checked").val()},
data: {'userSex': $("input[name=sex]:checked").val()},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -81,7 +84,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);

View File

@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'账号设置_'+${application.website.name}"></title>
@ -25,10 +26,12 @@
<div class="my_info cf">
<div class="my_info_txt">
<ul class="mytab_list">
<li ><i class="tit">我的头像</i>
<a style="position: relative" >
<img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png" />
<input class="opacity" onchange="picChange()" type="file" id="file0" name="file" title="点击上传图片" style="z-index: 100;cursor: pointer;left: 0px; top: -25px; width: 60px; height: 80px; opacity: 0; position: absolute; "/>
<li><i class="tit">我的头像</i>
<a style="position: relative">
<img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png"/>
<input class="opacity" onchange="picChange()" type="file" id="file0" name="file"
title="点击上传图片"
style="z-index: 100;cursor: pointer;left: 0px; top: -25px; width: 60px; height: 80px; opacity: 0; position: absolute; "/>
</a>
@ -59,27 +62,26 @@
dataType: "json",
success: function (data) {
if (data.code == 200) {
if(data.data.userPhoto){
$("#imgLogo").attr("src",data.data.userPhoto);
if (data.data.userPhoto) {
$("#imgLogo").attr("src", data.data.userPhoto);
}
if(data.data.nickName){
$("#my_name").html(data.data.nickName+"<em class=\"ml10\">[修改]</em>");
}else{
$("#my_name").html(data.data.username+"<em class=\"ml10\">[修改]</em>");
if (data.data.nickName) {
$("#my_name").html(data.data.nickName + "<em class=\"ml10\">[修改]</em>");
} else {
$("#my_name").html(data.data.username + "<em class=\"ml10\">[修改]</em>");
}
if(data.data.userSex === '0'){
if (data.data.userSex === '0') {
$("#my_sex").html("男<em class=\"ml10\">[修改]</em>");
}else if(data.data.userSex === '1'){
} else if (data.data.userSex === '1') {
$("#my_sex").html("女<em class=\"ml10\">[修改]</em>");
}else{
} else {
$("#my_sex").html("请选择");
}
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -96,7 +98,7 @@
var file = $("#file0").val(); //文件名称
if (file != "") {
if(checkPicUpload($("#file0")[0])) {
if (checkPicUpload($("#file0")[0])) {
$.ajaxFileUpload({
url: "/file/picUpload", //用于文件上传的服务器端请求地址
@ -118,7 +120,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -143,7 +145,6 @@
}
}
</script>
</body>

View File

@ -1,6 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common_head(~{::title},~{},~{::link},~{})">
<title th:text="'个人中心_'+${application.website.name}"></title>
@ -25,12 +24,14 @@
</div>
<div class="my_r">
<div class="my_info cf">
<img id="imgLogo" class="user_big_head" src="/images/man.png" />
<img id="imgLogo" class="user_big_head" src="/images/man.png"/>
<div class="my_info_txt">
<p class="my_name" id="my_name">
</p>
</p>
<ul class="my_list">
<li class="my_gold"><i>账户余额:</i><em class="red" id="accountBalance">0</em>屋币<!--<em class="red">+</em><em class="red">0</em>代金券--><a href="/pay/index.html" class="btn_link">立即充值</a></li>
<li class="my_gold"><i>账户余额:</i><em class="red" id="accountBalance">0</em>屋币
<!--<em class="red">+</em><em class="red">0</em>代金券--><a href="/pay/index.html"
class="btn_link">立即充值</a></li>
<li class="my_baonian"></li>
</ul>
@ -87,12 +88,12 @@
dataType: "json",
success: function (data) {
if (data.code == 200) {
if(data.data.userPhoto){
$("#imgLogo").attr("src",data.data.userPhoto);
if (data.data.userPhoto) {
$("#imgLogo").attr("src", data.data.userPhoto);
}
if(data.data.nickName){
if (data.data.nickName) {
$("#my_name").html(data.data.nickName);
}else{
} else {
$("#my_name").html(data.data.username);
}
@ -100,7 +101,7 @@
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
@ -115,7 +116,7 @@
$.ajax({
type: "get",
url: "/user/listBookShelfByPage",
data: {'limit':2},
data: {'limit': 2},
dataType: "json",
success: function (data) {
if (data.code == 200) {
@ -126,7 +127,7 @@
var book = bookShelfList[i];
bookShelfListHtml += (" <tr class=\"book_list\" vals=\"291\">\n" +
" <td class=\"style bookclass\">\n" +
" <a href=\"/book/bookclass.html?c="+book.catId+"\" >[" + book.catName + "]</a>\n" +
" <a href=\"/book/bookclass.html?c=" + book.catId + "\" >[" + book.catName + "]</a>\n" +
" </td>\n" +
" <td class=\"name\">\n" +
" <a href=\"/book/" + book.bookId + ".html\">\n" +

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Some files were not shown because too many files have changed in this diff Show More