2 |
3 |
4 |
5 |
6 |
7 |
25 |
26 |
38 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: 'airbnb-base',
3 | plugins: [
4 | 'import'
5 | ],
6 | rules: {
7 | 'max-len': ['error', 1000, 2, {
8 | ignoreUrls: true,
9 | ignoreComments: false,
10 | ignoreRegExpLiterals: true,
11 | ignoreStrings: true,
12 | ignoreTemplateLiterals: true,
13 | }],
14 | 'comma-dangle': ['error', {
15 | arrays: 'always-multiline',
16 | objects: 'always-multiline',
17 | imports: 'always-multiline',
18 | exports: 'always-multiline',
19 | functions: 'never',
20 | }],
21 | 'prefer-destructuring': ['off'],
22 | },
23 | globals: {
24 | 'window': true,
25 | 'document': true,
26 | }
27 | };
28 |
--------------------------------------------------------------------------------
/h5/dist/css/pages/book/search.css:
--------------------------------------------------------------------------------
1 | body{padding-bottom:0}.search-list{text-align:center;width:100%;height:7rem;overflow:hidden;padding:.5rem .25rem;border-bottom:1px dashed #896461;display:block}.search-list>.search-img-box{display:table-cell;width:5.8rem;height:6rem;line-height:6rem;vertical-align:middle;float:left}.search-list>.search-img-box>img{max-width:100%;max-height:100%;vertical-align:middle}.search-list>.search-info-box{text-align:left;line-height:1rem;height:6rem;overflow:hidden}.search-list>.search-info-box>span{display:block}.search-list>.search-info-box>div.description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.search-list>.search-info-box>div.description>span{float:left}.no-more{text-align:center;line-height:2rem}
--------------------------------------------------------------------------------
/adminApi/routes/ip/startReptile.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | const { oauth, tool, db, log } = require("../../tool/require");
4 | let {ipReptileService} = require("../../service/");
5 | /*
6 | * ip列表
7 | * page 页数
8 | * limit 一页几条
9 | * */
10 | router.use('', oauth(2004), async function(req, res, next) {
11 |
12 | let startPage = tool.getParams(req, 'startPage') || 1;
13 | let endPage = tool.getParams(req, 'endPage') || 3;
14 |
15 | ipReptileService.startReptile(startPage, endPage).then((msg) => {
16 | res.send(tool.toJson(null, msg, 1000));
17 | }).catch((err) => {
18 | res.send(tool.toJson(null, err, 1002));
19 | });
20 | });
21 |
22 | module.exports = router;
23 |
--------------------------------------------------------------------------------
/iview-admin-dev/src/views/main-components/breadcrumb-nav.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ itemTitle(item) }}
8 |
9 |
10 |
11 |
28 |
29 |
--------------------------------------------------------------------------------
/adminApi/routes/reptile/restartCatalog.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | const {oauth, tool, db, log, fs, path} = require("../../tool/require");
4 | const {reptileService} = require("../../service/");
5 | /*
6 | * 再次爬取
7 | * 也就是爬取错误列表
8 | * */
9 | router.use('', oauth(4007), async function (req, res, next) {
10 | let errorId = parseInt(tool.getParams(req, 'errorId'));
11 | let tiType = tool.getParams(req, 'tiType') == 1 ? true:false; //当tiType为1时,是替代
12 | reptileService.restartCatalog(errorId,tiType).then((msg) => {
13 | res.send(tool.toJson(msg, null, 1000));
14 | }).catch((err) => {
15 | res.send(tool.toJson(null, err, 1002));
16 | });
17 | });
18 |
19 | module.exports = router;
20 |
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/swiper.js:
--------------------------------------------------------------------------------
1 | // Swiper Class
2 | import Swiper from './components/core/core-class';
3 |
4 | // Core Modules
5 | import Device from './modules/device/device';
6 | import Support from './modules/support/support';
7 | import Browser from './modules/browser/browser';
8 | import Resize from './modules/resize/resize';
9 | import Observer from './modules/observer/observer';
10 |
11 | //IMPORT_COMPONENTS
12 |
13 | const components = [
14 | Device,
15 | Support,
16 | Browser,
17 | Resize,
18 | Observer,
19 | //INSTALL_COMPONENTS
20 | ];
21 |
22 | if (typeof Swiper.use === 'undefined') {
23 | Swiper.use = Swiper.Class.use;
24 | Swiper.installModule = Swiper.Class.installModule;
25 | }
26 |
27 | Swiper.use(components);
28 |
29 | //EXPORT
30 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/swiper.js:
--------------------------------------------------------------------------------
1 | // Swiper Class
2 | import Swiper from './components/core/core-class';
3 |
4 | // Core Modules
5 | import Device from './modules/device/device';
6 | import Support from './modules/support/support';
7 | import Browser from './modules/browser/browser';
8 | import Resize from './modules/resize/resize';
9 | import Observer from './modules/observer/observer';
10 |
11 | //IMPORT_COMPONENTS
12 |
13 | const components = [
14 | Device,
15 | Support,
16 | Browser,
17 | Resize,
18 | Observer,
19 | //INSTALL_COMPONENTS
20 | ];
21 |
22 | if (typeof Swiper.use === 'undefined') {
23 | Swiper.use = Swiper.Class.use;
24 | Swiper.installModule = Swiper.Class.installModule;
25 | }
26 |
27 | Swiper.use(components);
28 |
29 | //EXPORT
30 |
--------------------------------------------------------------------------------
/h5/views/common/footer.pug:
--------------------------------------------------------------------------------
1 | mixin footer(myUrl)
2 | footer(class="footMenu clearfix")
3 | a(href="/book/" class=myUrl=="/book/index" ? "act" : "" style="width:50%;")
4 | div(class="footMenu-top")
5 | icon(class="iconfont icon-books")
6 | div(class="footMenu-bottom") 书架
7 | a(href="/home/" class=myUrl=="/home/index" ? "act" : "" style="width:50%;")
8 | div(class="footMenu-top")
9 | icon(class="iconfont icon-shouye")
10 | div(class="footMenu-bottom") 书城
11 | //-a(href="/users/" class=myUrl=="/users/index" ? "act" : "")
12 | //- div(class="footMenu-top")
13 | //- icon(class="iconfont icon-geren")
14 | //- div(class="footMenu-bottom") 个人
--------------------------------------------------------------------------------
/adminApi/routes/reptile/oneKeyRestartCatalog.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | const {oauth, tool, db, log, fs, path} = require("../../tool/require");
4 | const {reptileService} = require("../../service/");
5 | /*
6 | * 一键爬取错误列表
7 | * 也就是爬取错误列表
8 | * */
9 | router.use('', oauth(4008), async function (req, res, next) {
10 | let bookName = tool.getParams(req, 'bookName');
11 | let tiType = tool.getParams(req, 'tiType') == 1 ? true:false; //当tiType为1时,是替代
12 | reptileService.oneKeyRestartCatalog(bookName,tiType).then((msg) => {
13 | res.send(tool.toJson(msg, null, 1000));
14 | }).catch((err) => {
15 | res.send(tool.toJson(null, err, 1002));
16 | });
17 | });
18 |
19 | module.exports = router;
20 |
--------------------------------------------------------------------------------
/h5/dist-views/common/footer.pug:
--------------------------------------------------------------------------------
1 | mixin footer(myUrl)
2 | footer(class="footMenu clearfix")
3 | a(href="/book/" class=myUrl=="/book/index" ? "act" : "" style="width:50%;")
4 | div(class="footMenu-top")
5 | icon(class="iconfont icon-books")
6 | div(class="footMenu-bottom") 书架
7 | a(href="/home/" class=myUrl=="/home/index" ? "act" : "" style="width:50%;")
8 | div(class="footMenu-top")
9 | icon(class="iconfont icon-shouye")
10 | div(class="footMenu-bottom") 书城
11 | //-a(href="/users/" class=myUrl=="/users/index" ? "act" : "")
12 | //- div(class="footMenu-top")
13 | //- icon(class="iconfont icon-geren")
14 | //- div(class="footMenu-bottom") 个人
--------------------------------------------------------------------------------
/iview-admin-dev/src/views/access/access.less:
--------------------------------------------------------------------------------
1 | .access{
2 | &-user-con{
3 | height: 200px;
4 | }
5 | &-current-user-con{
6 | text-align: center;
7 | padding-top: 10px;
8 | img{
9 | display: block;
10 | width: 100px;
11 | height: 100px;
12 | border: 2px solid #dddde2;
13 | border-radius: 50%;
14 | margin: 0px auto 10px;
15 | }
16 | p{
17 | display: block;
18 | padding: 20px 0 0;
19 | b{
20 | margin: 0 10px;
21 | color: #2d8cf0;
22 | }
23 | }
24 | }
25 | &-change-access-con{
26 | &-row{
27 | height: 200px;
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/h5/lib/rev-path/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rev-path",
3 | "version": "2.0.0",
4 | "description": "Create a revved file path",
5 | "license": "MIT",
6 | "repository": "sindresorhus/rev-path",
7 | "author": {
8 | "name": "Sindre Sorhus",
9 | "email": "sindresorhus@gmail.com",
10 | "url": "sindresorhus.com"
11 | },
12 | "engines": {
13 | "node": ">=4"
14 | },
15 | "scripts": {
16 | "test": "xo && ava"
17 | },
18 | "files": [
19 | "index.js"
20 | ],
21 | "keywords": [
22 | "rev",
23 | "revving",
24 | "web",
25 | "file",
26 | "name",
27 | "filename",
28 | "path",
29 | "cache",
30 | "caching"
31 | ],
32 | "dependencies": {
33 | "modify-filename": "^1.0.0"
34 | },
35 | "devDependencies": {
36 | "ava": "*",
37 | "xo": "*"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/h5/views/pages/home/ejs.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 | EJS模板
9 |
10 |
11 |
12 | EJS模板引擎
13 | 这是很简单的一个小流程就不在一一的标注流程了,注释的很清楚了
14 | 这里是姓名: <%= name %>
15 | 这里是性别: <%= sex %>
16 |
17 |
18 | 这里是性别: <%= content %>
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/h5/dist-views/pages/home/ejs.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 | EJS模板
9 |
10 |
11 |
12 | EJS模板引擎
13 | 这是很简单的一个小流程就不在一一的标注流程了,注释的很清楚了
14 | 这里是姓名: <%= name %>
15 | 这里是性别: <%= sex %>
16 |
17 |
18 | 这里是性别: <%= content %>
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/components/core/images/loadImage.js:
--------------------------------------------------------------------------------
1 | import { window } from 'ssr-window';
2 |
3 | export default function (imageEl, src, srcset, sizes, checkForComplete, callback) {
4 | let image;
5 | function onReady() {
6 | if (callback) callback();
7 | }
8 | if (!imageEl.complete || !checkForComplete) {
9 | if (src) {
10 | image = new window.Image();
11 | image.onload = onReady;
12 | image.onerror = onReady;
13 | if (sizes) {
14 | image.sizes = sizes;
15 | }
16 | if (srcset) {
17 | image.srcset = srcset;
18 | }
19 | if (src) {
20 | image.src = src;
21 | }
22 | } else {
23 | onReady();
24 | }
25 | } else {
26 | // image already loaded...
27 | onReady();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/components/core/images/loadImage.js:
--------------------------------------------------------------------------------
1 | import { window } from 'ssr-window';
2 |
3 | export default function (imageEl, src, srcset, sizes, checkForComplete, callback) {
4 | let image;
5 | function onReady() {
6 | if (callback) callback();
7 | }
8 | if (!imageEl.complete || !checkForComplete) {
9 | if (src) {
10 | image = new window.Image();
11 | image.onload = onReady;
12 | image.onerror = onReady;
13 | if (sizes) {
14 | image.sizes = sizes;
15 | }
16 | if (srcset) {
17 | image.srcset = srcset;
18 | }
19 | if (src) {
20 | image.src = src;
21 | }
22 | } else {
23 | onReady();
24 | }
25 | } else {
26 | // image already loaded...
27 | onReady();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/components/core/update/index.js:
--------------------------------------------------------------------------------
1 | import updateSize from './updateSize';
2 | import updateSlides from './updateSlides';
3 | import updateAutoHeight from './updateAutoHeight';
4 | import updateSlidesOffset from './updateSlidesOffset';
5 | import updateSlidesProgress from './updateSlidesProgress';
6 | import updateProgress from './updateProgress';
7 | import updateSlidesClasses from './updateSlidesClasses';
8 | import updateActiveIndex from './updateActiveIndex';
9 | import updateClickedSlide from './updateClickedSlide';
10 |
11 | export default {
12 | updateSize,
13 | updateSlides,
14 | updateAutoHeight,
15 | updateSlidesOffset,
16 | updateSlidesProgress,
17 | updateProgress,
18 | updateSlidesClasses,
19 | updateActiveIndex,
20 | updateClickedSlide,
21 | };
22 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/components/core/update/index.js:
--------------------------------------------------------------------------------
1 | import updateSize from './updateSize';
2 | import updateSlides from './updateSlides';
3 | import updateAutoHeight from './updateAutoHeight';
4 | import updateSlidesOffset from './updateSlidesOffset';
5 | import updateSlidesProgress from './updateSlidesProgress';
6 | import updateProgress from './updateProgress';
7 | import updateSlidesClasses from './updateSlidesClasses';
8 | import updateActiveIndex from './updateActiveIndex';
9 | import updateClickedSlide from './updateClickedSlide';
10 |
11 | export default {
12 | updateSize,
13 | updateSlides,
14 | updateAutoHeight,
15 | updateSlidesOffset,
16 | updateSlidesProgress,
17 | updateProgress,
18 | updateSlidesClasses,
19 | updateActiveIndex,
20 | updateClickedSlide,
21 | };
22 |
--------------------------------------------------------------------------------
/common/prototype/datePrototype.js:
--------------------------------------------------------------------------------
1 | Date.prototype.Format = function(fmt) { //author: zouqj
2 | fmt = fmt ? fmt:'yyyy-MM-dd hh:mm:ss';
3 |
4 | var o = {
5 | "M+": this.getMonth() + 1, //月份
6 | "d+": this.getDate(), //日
7 | "h+": this.getHours(), //小时
8 | "m+": this.getMinutes(), //分
9 | "s+": this.getSeconds(), //秒
10 | "q+": Math.floor((this.getMonth() + 3) / 3), //季度
11 | "S": this.getMilliseconds() //毫秒
12 | };
13 | if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
14 | for (var k in o)
15 | if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
16 | return fmt;
17 | };
--------------------------------------------------------------------------------
/common/tool/require.js:
--------------------------------------------------------------------------------
1 | let fs = require("fs");
2 | let rp = require("request-promise");
3 | let request = require("request");
4 | let timoRp = require("./timoRp.js");
5 | let cheerio = require("cheerio");
6 | let iconv = require("iconv-lite");
7 | let morgan = require("morgan");
8 | let path = require("path");
9 | let db = require("./mysql.js");
10 | let tool = require("./tool.js");
11 | let oauth = require("./oauth.js");
12 | let log = require('tracer').colorConsole();
13 | let async = require("async");
14 | let xlsx = require('node-xlsx');
15 |
16 | module.exports = {
17 | fs,
18 | rp,
19 | request,
20 | timoRp,
21 | cheerio,
22 | iconv,
23 | morgan,
24 | path,
25 | db,
26 | tool,
27 | oauth,
28 | log,
29 | async,
30 | xlsx
31 | // wss
32 | };
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/components/core/slide/slideToClosest.js:
--------------------------------------------------------------------------------
1 | /* eslint no-unused-vars: "off" */
2 | export default function (speed = this.params.speed, runCallbacks = true, internal) {
3 | const swiper = this;
4 | let index = swiper.activeIndex;
5 | const snapIndex = Math.floor(index / swiper.params.slidesPerGroup);
6 |
7 | if (snapIndex < swiper.snapGrid.length - 1) {
8 | const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
9 |
10 | const currentSnap = swiper.snapGrid[snapIndex];
11 | const nextSnap = swiper.snapGrid[snapIndex + 1];
12 |
13 | if ((translate - currentSnap) > (nextSnap - currentSnap) / 2) {
14 | index = swiper.params.slidesPerGroup;
15 | }
16 | }
17 |
18 | return swiper.slideTo(index, speed, runCallbacks, internal);
19 | }
20 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/components/core/slide/slideToClosest.js:
--------------------------------------------------------------------------------
1 | /* eslint no-unused-vars: "off" */
2 | export default function (speed = this.params.speed, runCallbacks = true, internal) {
3 | const swiper = this;
4 | let index = swiper.activeIndex;
5 | const snapIndex = Math.floor(index / swiper.params.slidesPerGroup);
6 |
7 | if (snapIndex < swiper.snapGrid.length - 1) {
8 | const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
9 |
10 | const currentSnap = swiper.snapGrid[snapIndex];
11 | const nextSnap = swiper.snapGrid[snapIndex + 1];
12 |
13 | if ((translate - currentSnap) > (nextSnap - currentSnap) / 2) {
14 | index = swiper.params.slidesPerGroup;
15 | }
16 | }
17 |
18 | return swiper.slideTo(index, speed, runCallbacks, internal);
19 | }
20 |
--------------------------------------------------------------------------------
/adminApi/routes/log/delete.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | const { oauth, tool, path, fs, log } = require("../../tool/require");
4 | const { logService } = require("../../service/");
5 |
6 | router.use('', oauth(3002), async function(req, res, next) {
7 |
8 | let logType = parseInt(tool.getParams(req, 'logType'));
9 | let nameArr = tool.getParams(req, 'nameArr');
10 |
11 | if(nameArr.indexOf('../') != -1) {
12 | res.send(tool.toJson(null, 'nameArr参数不对', 1002));
13 | return;
14 | }
15 |
16 | logService.dele(logType, nameArr).then((data) => {
17 | res.send(tool.toJson(data, null, 1000));
18 | }).catch((err) => {
19 | res.send(tool.toJson(null, err, 1002));
20 | });
21 | });
22 |
23 | module.exports = router;
24 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "timotaoshu",
3 | "version": "2.0.1",
4 | "description": "mysql\r redis",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "dependencies": {
10 | "async": "^2.6.1",
11 | "cheerio": "^1.0.0-rc.2",
12 | "compression": "^1.7.3",
13 | "iconv-lite": "^0.4.19",
14 | "jwt-simple": "^0.5.1",
15 | "morgan": "~1.9.0",
16 | "multer": "^1.3.1",
17 | "mysql": "^2.15.0",
18 | "node-xlsx": "^0.12.1",
19 | "redis": "^2.8.0",
20 | "request": "^2.85.0",
21 | "request-promise": "^4.2.2",
22 | "tracer": "^0.8.15"
23 | },
24 | "devDependencies": {
25 | "babel-cli": "^6.26.0",
26 | "babel-preset-es2015": "^6.24.1",
27 | "babel-preset-es2017": "^6.24.1"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/adminApi/routes/permission/staffList.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | const { oauth, tool,db } = require("../../tool/require");
4 |
5 | router.use('', oauth(6101), async function(req, res, next) {
6 | let page = tool.getParams(req, 'page') || 1;
7 | let limit = tool.getParams(req, 'limit') || 10;
8 |
9 | let userList = await db.query(`select users.id, users.roleId, users.name, users.mobile, role.roleName from users INNER JOIN role on users.roleId = role.id limit ${(page-1) * limit},${limit}`);
10 | let count = (await db.query(`select count(*) from users`))[0]["count(*)"];
11 | let userData = {
12 | count: count,
13 | userList: userList
14 | }
15 | res.send(tool.toJson(userData, '', 1000));
16 | });
17 |
18 | module.exports = router;
19 |
--------------------------------------------------------------------------------
/adminApi/routes/log/list.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | const {oauth, tool, db, log, fs, path} = require("../../tool/require");
4 | const { logService } = require("../../service/");
5 |
6 | /*
7 | * page 页数
8 | * limit 一页几条
9 | *
10 | * */
11 | router.use('', oauth(3003), async function (req, res, next) {
12 |
13 | let logType = parseInt(tool.getParams(req, 'logType')) || 1;
14 | let page = parseInt(tool.getParams(req, 'page')) || 1;
15 | let limit = parseInt(tool.getParams(req, 'limit')) || 20;
16 |
17 |
18 | logService.list(logType,page,limit).then((logList) => {
19 | res.send(tool.toJson(logList, null, 1000));
20 | }).catch((err) => {
21 | res.send(tool.toJson(null, err, 1002));
22 | });
23 | });
24 |
25 | module.exports = router;
26 |
--------------------------------------------------------------------------------
/h5/src/js/common/rem.js:
--------------------------------------------------------------------------------
1 | ;(function (doc, win) {
2 | var docEl = doc.documentElement,
3 | resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
4 | recalc = function () {
5 | var clientWidth = docEl.clientWidth;
6 | if (typeof(clientWidth) == 'number' && clientWidth <= 750) { //手机端自适应, 基础20
7 | docEl.style.fontSize = 20 * (clientWidth / 375) + 'px';
8 | } else if (typeof(clientWidth) == 'number' && clientWidth > 750) { //pc端基础为40/2 20 手机端的适配
9 | docEl.style.fontSize = '40' + 'px';
10 | }
11 | };
12 | if (!doc.addEventListener) return;
13 | win.addEventListener(resizeEvt, recalc, false);
14 | doc.addEventListener('DOMContentLoaded', recalc, false);
15 | recalc();
16 | })(document, window);
--------------------------------------------------------------------------------
/iview-admin-dev/src/views/login.less:
--------------------------------------------------------------------------------
1 | .login{
2 | width: 100%;
3 | height: 100%;
4 | background-image: url('https://file.iviewui.com/iview-admin/login_bg.jpg');
5 | background-size: cover;
6 | background-position: center;
7 | position: relative;
8 | &-con{
9 | position: absolute;
10 | right: 160px;
11 | top: 50%;
12 | transform: translateY(-60%);
13 | width: 300px;
14 | &-header{
15 | font-size: 16px;
16 | font-weight: 300;
17 | text-align: center;
18 | padding: 30px 0;
19 | }
20 | .form-con{
21 | padding: 10px 0 0;
22 | }
23 | .login-tip{
24 | font-size: 10px;
25 | text-align: center;
26 | color: #c3c3c3;
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/common/tool/queue.js:
--------------------------------------------------------------------------------
1 | let async = require("async");
2 |
3 | let queue = async.queue(function (obj, cb) {
4 | obj.pro.apply(this, obj.params).then(async (data) => {
5 | obj.result && await obj.result.apply(this, data);
6 | await cb();
7 | }).catch(async (err) => {
8 | console.log("queue报错啦");
9 | console.log(err);
10 | obj.error && await obj.error(err);
11 | await cb(err);
12 | });
13 | }, 150);
14 |
15 | queue.empty = function() {
16 | // console.log("当最后一个任务交给worker执行时,会调用empty函数");
17 | // console.log("开始最后一个ip检查");
18 | }
19 | queue.saturated = function() {
20 | // console.log("worker数量将用完时,会调用saturated函数");
21 |
22 | }
23 | queue.drain = function() {
24 | // console.log("哭泣")
25 | // console.log("当所有任务都执行完时,会调用drain函数");
26 | }
27 |
28 |
29 | module.exports = queue;
--------------------------------------------------------------------------------
/iview-admin-dev/src/locale/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Locales from './locale';
3 | import zhLocale from 'iview/src/locale/lang/zh-CN';
4 | import enLocale from 'iview/src/locale/lang/en-US';
5 | import zhTLocale from 'iview/src/locale/lang/zh-TW';
6 |
7 | // 自动设置语言
8 | const navLang = navigator.language;
9 | const localLang = (navLang === 'zh-CN' || navLang === 'en-US') ? navLang : false;
10 | const lang = window.localStorage.lang || localLang || 'zh-CN';
11 |
12 | Vue.config.lang = lang;
13 |
14 | // 多语言配置
15 | const locales = Locales;
16 | const mergeZH = Object.assign(zhLocale, locales['zh-CN']);
17 | const mergeEN = Object.assign(enLocale, locales['en-US']);
18 | const mergeTW = Object.assign(zhTLocale, locales['zh-TW']);
19 | Vue.locale('zh-CN', mergeZH);
20 | Vue.locale('en-US', mergeEN);
21 | Vue.locale('zh-TW', mergeTW);
22 |
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/components/core/manipulation/prependSlide.js:
--------------------------------------------------------------------------------
1 | import Support from '../../../utils/support';
2 |
3 | export default function (slides) {
4 | const swiper = this;
5 | const { params, $wrapperEl, activeIndex } = swiper;
6 |
7 | if (params.loop) {
8 | swiper.loopDestroy();
9 | }
10 | let newActiveIndex = activeIndex + 1;
11 | if (typeof slides === 'object' && 'length' in slides) {
12 | for (let i = 0; i < slides.length; i += 1) {
13 | if (slides[i]) $wrapperEl.prepend(slides[i]);
14 | }
15 | newActiveIndex = activeIndex + slides.length;
16 | } else {
17 | $wrapperEl.prepend(slides);
18 | }
19 | if (params.loop) {
20 | swiper.loopCreate();
21 | }
22 | if (!(params.observer && Support.observer)) {
23 | swiper.update();
24 | }
25 | swiper.slideTo(newActiveIndex, 0, false);
26 | }
27 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/components/core/manipulation/prependSlide.js:
--------------------------------------------------------------------------------
1 | import Support from '../../../utils/support';
2 |
3 | export default function (slides) {
4 | const swiper = this;
5 | const { params, $wrapperEl, activeIndex } = swiper;
6 |
7 | if (params.loop) {
8 | swiper.loopDestroy();
9 | }
10 | let newActiveIndex = activeIndex + 1;
11 | if (typeof slides === 'object' && 'length' in slides) {
12 | for (let i = 0; i < slides.length; i += 1) {
13 | if (slides[i]) $wrapperEl.prepend(slides[i]);
14 | }
15 | newActiveIndex = activeIndex + slides.length;
16 | } else {
17 | $wrapperEl.prepend(slides);
18 | }
19 | if (params.loop) {
20 | swiper.loopCreate();
21 | }
22 | if (!(params.observer && Support.observer)) {
23 | swiper.update();
24 | }
25 | swiper.slideTo(newActiveIndex, 0, false);
26 | }
27 |
--------------------------------------------------------------------------------
/common/tool/ipQueue.js:
--------------------------------------------------------------------------------
1 | let async = require("async");
2 |
3 | let ipQueue = async.queue(function (obj, cb) {
4 | obj.pro.apply(this, obj.params).then(async (data) => {
5 | obj.result && await obj.result.apply(this, data);
6 | await cb();
7 | }).catch(async (err) => {
8 | console.log("ipQueue报错啦");
9 | console.log(err);
10 | obj.error && await obj.error(err);
11 | await cb(err);
12 | });
13 | }, 500);
14 |
15 | ipQueue.empty = function() {
16 | // console.log("当最后一个任务交给worker执行时,会调用empty函数");
17 | // console.log("开始最后一个ip检查");
18 | }
19 | ipQueue.saturated = function() {
20 | // console.log("worker数量将用完时,会调用saturated函数");
21 |
22 | }
23 | ipQueue.drain = function() {
24 | // console.log("哭泣")
25 | // console.log("当所有任务都执行完时,会调用drain函数");
26 | }
27 |
28 |
29 | module.exports = ipQueue;
--------------------------------------------------------------------------------
/h5/src/css/common/search.less:
--------------------------------------------------------------------------------
1 | /*搜索框样式*/
2 |
3 | .book-search{
4 | text-align: center;
5 | padding: 0.4rem 0;
6 | color:#333;
7 | background: @catalog-background-color;
8 | &>input.book-search-input{
9 | background: #FFF;
10 | color: #000;
11 | padding: .2rem .3rem;
12 | margin: 0 .5rem;
13 | border: 1px solid @timo-color;
14 | width: 6rem;
15 | border-radius:.2rem;
16 | &:focus{
17 | box-shadow:0 0 5px @timo-color;
18 | }
19 | }
20 | &>a.book-searct-a{
21 | display: inline-block;
22 | line-height: 1;
23 | padding: .2rem .3rem;
24 | border-radius: .2rem;
25 | border: 1px solid @timo-color;
26 | background: @timo-color;
27 | color: #fff;
28 | margin-right: .5rem;
29 | vertical-align: middle;
30 | }
31 | }
--------------------------------------------------------------------------------
/iview-admin-dev/src/views/main-components/message-tip.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
31 |
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/components/scrollbar/scrollbar.less:
--------------------------------------------------------------------------------
1 | /* Scrollbar */
2 | .swiper-scrollbar {
3 | border-radius: 10px;
4 | position: relative;
5 | -ms-touch-action: none;
6 | background: rgba(0,0,0,0.1);
7 | .swiper-container-horizontal > & {
8 | position: absolute;
9 | left: 1%;
10 | bottom: 3px;
11 | z-index: 50;
12 | height: 5px;
13 | width: 98%;
14 | }
15 | .swiper-container-vertical > & {
16 | position: absolute;
17 | right: 3px;
18 | top: 1%;
19 | z-index: 50;
20 | width: 5px;
21 | height: 98%;
22 | }
23 | }
24 | .swiper-scrollbar-drag {
25 | height: 100%;
26 | width: 100%;
27 | position: relative;
28 | background: rgba(0,0,0,0.5);
29 | border-radius: 10px;
30 | left: 0;
31 | top: 0;
32 | }
33 | .swiper-scrollbar-cursor-drag {
34 | cursor: move;
35 | }
36 | .swiper-scrollbar-lock {
37 | display: none;
38 | }
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/components/scrollbar/scrollbar.less:
--------------------------------------------------------------------------------
1 | /* Scrollbar */
2 | .swiper-scrollbar {
3 | border-radius: 10px;
4 | position: relative;
5 | -ms-touch-action: none;
6 | background: rgba(0,0,0,0.1);
7 | .swiper-container-horizontal > & {
8 | position: absolute;
9 | left: 1%;
10 | bottom: 3px;
11 | z-index: 50;
12 | height: 5px;
13 | width: 98%;
14 | }
15 | .swiper-container-vertical > & {
16 | position: absolute;
17 | right: 3px;
18 | top: 1%;
19 | z-index: 50;
20 | width: 5px;
21 | height: 98%;
22 | }
23 | }
24 | .swiper-scrollbar-drag {
25 | height: 100%;
26 | width: 100%;
27 | position: relative;
28 | background: rgba(0,0,0,0.5);
29 | border-radius: 10px;
30 | left: 0;
31 | top: 0;
32 | }
33 | .swiper-scrollbar-cursor-drag {
34 | cursor: move;
35 | }
36 | .swiper-scrollbar-lock {
37 | display: none;
38 | }
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/components/core/transition/transitionEnd.js:
--------------------------------------------------------------------------------
1 | export default function (runCallbacks = true, direction) {
2 | const swiper = this;
3 | const { activeIndex, previousIndex } = swiper;
4 | swiper.animating = false;
5 | swiper.setTransition(0);
6 |
7 | let dir = direction;
8 | if (!dir) {
9 | if (activeIndex > previousIndex) dir = 'next';
10 | else if (activeIndex < previousIndex) dir = 'prev';
11 | else dir = 'reset';
12 | }
13 |
14 | swiper.emit('transitionEnd');
15 |
16 | if (runCallbacks && activeIndex !== previousIndex) {
17 | if (dir === 'reset') {
18 | swiper.emit('slideResetTransitionEnd');
19 | return;
20 | }
21 | swiper.emit('slideChangeTransitionEnd');
22 | if (dir === 'next') {
23 | swiper.emit('slideNextTransitionEnd');
24 | } else {
25 | swiper.emit('slidePrevTransitionEnd');
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/components/core/transition/transitionEnd.js:
--------------------------------------------------------------------------------
1 | export default function (runCallbacks = true, direction) {
2 | const swiper = this;
3 | const { activeIndex, previousIndex } = swiper;
4 | swiper.animating = false;
5 | swiper.setTransition(0);
6 |
7 | let dir = direction;
8 | if (!dir) {
9 | if (activeIndex > previousIndex) dir = 'next';
10 | else if (activeIndex < previousIndex) dir = 'prev';
11 | else dir = 'reset';
12 | }
13 |
14 | swiper.emit('transitionEnd');
15 |
16 | if (runCallbacks && activeIndex !== previousIndex) {
17 | if (dir === 'reset') {
18 | swiper.emit('slideResetTransitionEnd');
19 | return;
20 | }
21 | swiper.emit('slideChangeTransitionEnd');
22 | if (dir === 'next') {
23 | swiper.emit('slideNextTransitionEnd');
24 | } else {
25 | swiper.emit('slidePrevTransitionEnd');
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/api文档/timoh5/mo-ban.md:
--------------------------------------------------------------------------------
1 | ### 接口模板(不对外开放,忽视)
2 |
3 | 1、接口地址:/catalogList
4 |
5 | 2、参数
6 |
7 | | 参数名 | 参数类型 | 是否必填 | 备注 |
8 | | :--- | :--- | :--- | :--- |
9 | | | | | |
10 | | | | | |
11 |
12 | 3、接口返回结构
13 |
14 | ```js
15 | data: {
16 | "count": 全部小说类型数量
17 | "bookTypeList": [
18 | {
19 | "count(bookType)": 多少本这种类型的小说
20 | "bookType":"都市小说"
21 | },
22 | {
23 | "count(bookType)": 多少本这种类型的小说
24 | "bookType":"言情小说"
25 | }
26 |
27 | ]
28 | }
29 | ```
30 |
31 | 4、接口返回例子
32 |
33 | ```js
34 | {
35 | "code": 1000,
36 | "data": {
37 | "bookTypeList": [
38 | {
39 | "count(bookType)": 40,
40 | "bookType": "都市小说"
41 | },
42 | {
43 | "count(bookType)": 3,
44 | "bookType": "言情小说"
45 | }
46 | ],
47 | "count": 11
48 | },
49 | "msg": ""
50 | }
51 | ```
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/iview-admin-dev/src/views/my-components/file-upload/upload.less:
--------------------------------------------------------------------------------
1 | .admin-upload-list{
2 | display: inline-block;
3 | width: 60px;
4 | height: 60px;
5 | text-align: center;
6 | line-height: 60px;
7 | border: 1px solid transparent;
8 | border-radius: 4px;
9 | overflow: hidden;
10 | background: #fff;
11 | position: relative;
12 | box-shadow: 0 1px 1px rgba(0,0,0,.2);
13 | margin-right: 4px;
14 | }
15 | .admin-upload-list img{
16 | width: 100%;
17 | height: 100%;
18 | }
19 | .admin-upload-list-cover{
20 | display: none;
21 | position: absolute;
22 | top: 0;
23 | bottom: 0;
24 | left: 0;
25 | right: 0;
26 | background: rgba(0,0,0,.6);
27 | }
28 | .admin-upload-list:hover .admin-upload-list-cover{
29 | display: block;
30 | }
31 | .admin-upload-list-cover i{
32 | color: #fff;
33 | font-size: 20px;
34 | cursor: pointer;
35 | margin: 0 2px;
36 | }
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/components/core/transition/transitionStart.js:
--------------------------------------------------------------------------------
1 | export default function (runCallbacks = true, direction) {
2 | const swiper = this;
3 | const { activeIndex, params, previousIndex } = swiper;
4 | if (params.autoHeight) {
5 | swiper.updateAutoHeight();
6 | }
7 |
8 | let dir = direction;
9 | if (!dir) {
10 | if (activeIndex > previousIndex) dir = 'next';
11 | else if (activeIndex < previousIndex) dir = 'prev';
12 | else dir = 'reset';
13 | }
14 |
15 | swiper.emit('transitionStart');
16 |
17 | if (runCallbacks && activeIndex !== previousIndex) {
18 | if (dir === 'reset') {
19 | swiper.emit('slideResetTransitionStart');
20 | return;
21 | }
22 | swiper.emit('slideChangeTransitionStart');
23 | if (dir === 'next') {
24 | swiper.emit('slideNextTransitionStart');
25 | } else {
26 | swiper.emit('slidePrevTransitionStart');
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/components/core/transition/transitionStart.js:
--------------------------------------------------------------------------------
1 | export default function (runCallbacks = true, direction) {
2 | const swiper = this;
3 | const { activeIndex, params, previousIndex } = swiper;
4 | if (params.autoHeight) {
5 | swiper.updateAutoHeight();
6 | }
7 |
8 | let dir = direction;
9 | if (!dir) {
10 | if (activeIndex > previousIndex) dir = 'next';
11 | else if (activeIndex < previousIndex) dir = 'prev';
12 | else dir = 'reset';
13 | }
14 |
15 | swiper.emit('transitionStart');
16 |
17 | if (runCallbacks && activeIndex !== previousIndex) {
18 | if (dir === 'reset') {
19 | swiper.emit('slideResetTransitionStart');
20 | return;
21 | }
22 | swiper.emit('slideChangeTransitionStart');
23 | if (dir === 'next') {
24 | swiper.emit('slideNextTransitionStart');
25 | } else {
26 | swiper.emit('slidePrevTransitionStart');
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/iview-admin-dev/src/views/home/components/wb-img.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
![]()
4 |
5 |
6 |
15 |
38 |
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/components/core/images/preloadImages.js:
--------------------------------------------------------------------------------
1 | export default function () {
2 | const swiper = this;
3 | swiper.imagesToLoad = swiper.$el.find('img');
4 | function onReady() {
5 | if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;
6 | if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;
7 | if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
8 | if (swiper.params.updateOnImagesReady) swiper.update();
9 | swiper.emit('imagesReady');
10 | }
11 | }
12 | for (let i = 0; i < swiper.imagesToLoad.length; i += 1) {
13 | const imageEl = swiper.imagesToLoad[i];
14 | swiper.loadImage(
15 | imageEl,
16 | imageEl.currentSrc || imageEl.getAttribute('src'),
17 | imageEl.srcset || imageEl.getAttribute('srcset'),
18 | imageEl.sizes || imageEl.getAttribute('sizes'),
19 | true,
20 | onReady
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/components/core/images/preloadImages.js:
--------------------------------------------------------------------------------
1 | export default function () {
2 | const swiper = this;
3 | swiper.imagesToLoad = swiper.$el.find('img');
4 | function onReady() {
5 | if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;
6 | if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;
7 | if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
8 | if (swiper.params.updateOnImagesReady) swiper.update();
9 | swiper.emit('imagesReady');
10 | }
11 | }
12 | for (let i = 0; i < swiper.imagesToLoad.length; i += 1) {
13 | const imageEl = swiper.imagesToLoad[i];
14 | swiper.loadImage(
15 | imageEl,
16 | imageEl.currentSrc || imageEl.getAttribute('src'),
17 | imageEl.srcset || imageEl.getAttribute('srcset'),
18 | imageEl.sizes || imageEl.getAttribute('sizes'),
19 | true,
20 | onReady
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/adminApi/service/reptile/startReptile.js:
--------------------------------------------------------------------------------
1 | const getBooksFromJson = require("../../reptileTool/getBooksFromJson.js");
2 |
3 |
4 |
5 | const startReptile = async () => {
6 | return new Promise(async (resolve, reject) => {
7 |
8 | // reject("mysql服务器爆棚,暂不允许爬取");
9 | // return;
10 | let startTime = new Date().getTime();
11 | if(global.isReptile) {
12 | if((startTime - (global.reptileLastTime || 0)) > 1000*60*60){ //距离上次爬取超过一个小时
13 | global.isReptile = false;
14 | }
15 | }
16 | if(global.isReptile) {
17 | reject("正在爬取中...")
18 | } else {
19 | global.reptileLastTime = startTime;
20 | global.isReptile = true;
21 | getBooksFromJson(() => {
22 | global.isReptile = false;
23 | });
24 | resolve("开始爬取");
25 | }
26 | });
27 | }
28 |
29 |
30 |
31 |
32 |
33 | module.exports = startReptile;
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "swiper",
3 | "repository": {
4 | "type": "git",
5 | "url": "https://github.com/nolimits4web/Swiper.git"
6 | },
7 | "description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
8 | "version": "4.2.5",
9 | "author": "Vladimir Kharlampidi",
10 | "homepage": "http://www.idangero.us/swiper/",
11 | "keywords": ["swiper", "swipe", "slider", "touch", "ios", "mobile", "cordova", "phonegap", "app", "framework", "carousel", "gallery"],
12 | "dependencies": {
13 | },
14 | "scripts": [
15 | "dist/js/swiper.js"
16 | ],
17 | "main": [
18 | "dist/js/swiper.js",
19 | "dist/css/swiper.css"
20 | ],
21 | "styles": [
22 | "dist/css/swiper.css"
23 | ],
24 | "license": ["MIT"],
25 | "ignore": [
26 | ".*",
27 | "demos",
28 | "gulpfile",
29 | "build",
30 | "node_modules",
31 | "playground",
32 | "package.json"
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "swiper",
3 | "repository": {
4 | "type": "git",
5 | "url": "https://github.com/nolimits4web/Swiper.git"
6 | },
7 | "description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
8 | "version": "4.2.5",
9 | "author": "Vladimir Kharlampidi",
10 | "homepage": "http://www.idangero.us/swiper/",
11 | "keywords": ["swiper", "swipe", "slider", "touch", "ios", "mobile", "cordova", "phonegap", "app", "framework", "carousel", "gallery"],
12 | "dependencies": {
13 | },
14 | "scripts": [
15 | "dist/js/swiper.js"
16 | ],
17 | "main": [
18 | "dist/js/swiper.js",
19 | "dist/css/swiper.css"
20 | ],
21 | "styles": [
22 | "dist/css/swiper.css"
23 | ],
24 | "license": ["MIT"],
25 | "ignore": [
26 | ".*",
27 | "demos",
28 | "gulpfile",
29 | "build",
30 | "node_modules",
31 | "playground",
32 | "package.json"
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/h5/lib/rev-path/readme.md:
--------------------------------------------------------------------------------
1 | # rev-path [](https://travis-ci.org/sindresorhus/rev-path)
2 |
3 | > Create a [revved file path](http://blog.risingstack.com/automatic-cache-busting-for-your-css/)
4 |
5 |
6 | ## Install
7 |
8 | ```
9 | $ npm install rev-path
10 | ```
11 |
12 |
13 | ## Usage
14 |
15 | ```js
16 | const revPath = require('rev-path');
17 | const hash = 'bb9d8fe615'
18 |
19 | const path = revPath('src/unicorn.png', hash);
20 | //=> 'src/unicorn-bb9d8fe615.png'
21 |
22 | revPath('src/unicorn.png', Date.now());
23 | //=> 'src/unicorn-1432309925925.png'
24 |
25 | // You can also revert an already hashed path
26 | revPath.revert(path, hash);
27 | //=> 'src/unicorn.png'
28 | ```
29 |
30 |
31 | ## Related
32 |
33 | - [rev-file](https://github.com/sindresorhus/rev-file) - Get the revved file path of a file
34 |
35 |
36 | ## License
37 |
38 | MIT © [Sindre Sorhus](https://sindresorhus.com)
39 |
--------------------------------------------------------------------------------
/adminApi/reptileTool/getNextPage.js:
--------------------------------------------------------------------------------
1 | const {fs, rp, timoRp, cheerio, iconv, path, tool, db, log} = require("../tool/require2");
2 | // 下一页目录
3 | async function getNextPage({$, reptileCommon}){
4 | let result = null, count = 0;
5 | while(!result && count <= 10) {
6 | let option2 = {
7 | uri: reptileCommon.getNextPage($),
8 | userAgent: reptileCommon.userAgent,
9 | encoding: null,
10 | transform: function (body) {
11 | // let body2 = iconv.decode(body, "gbk"); //用来查看页面
12 | return cheerio.load(iconv.decode(body, reptileCommon.code), {decodeEntities: false});
13 | }
14 | }
15 | try{
16 | result = await timoRp(option2);
17 | } catch(err) {
18 | count++;
19 | log.error(`爬取失败:${err},第${count}次失败,失败地址:${option2.uri}失败代理ip:${option2.proxy}`);
20 | }
21 | }
22 | return result;
23 | }
24 |
25 | module.exports = getNextPage;
--------------------------------------------------------------------------------
/adminApi/routes/reptile/index.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | const { oauth, tool, db, log,reptileConfig } = require("../../tool/require");
4 |
5 | /*
6 | * 渠道列表
7 | * page 页数
8 | * limit 一页几条
9 | *
10 | * */
11 | router.use('', oauth(4004), async function(req, res, next) {
12 | let page = tool.getParams(req, 'page') || 1;
13 | let limit = tool.getParams(req, 'limit') || 10;
14 |
15 | let data = null;
16 | try{
17 | let reptileList = await reptileConfig.getReptileList();
18 | let count = reptileList.length;
19 |
20 | reptileList.forEach((value, index) => {
21 | reptileList[index] = JSON.parse(value);
22 | })
23 |
24 | data = {
25 | reptileList,
26 | count
27 | };
28 | res.send(tool.toJson(data, '', 1000));
29 | } catch(err) {
30 | res.send(tool.toJson(null, err, 1002));
31 | }
32 | });
33 |
34 | module.exports = router;
35 |
--------------------------------------------------------------------------------
/adminApi/routes/reptile/updateReptileList.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | const { log,db,oauth, tool,reptileConfig } = require("../../tool/require");
4 |
5 | /*
6 | * page 页数
7 | * limit 一页几条
8 | *
9 | * */
10 | router.use('', oauth(4005), async function(req, res, next) {
11 |
12 | // let limit = tool.getParams(req, 'limit') || 20;
13 | // let page = tool.getParams(req, 'page') || 1;
14 |
15 | try{
16 | let reptileList = await reptileConfig.refreshReptileList();
17 | let count = reptileList.length;
18 |
19 | reptileList.forEach((value, index) => {
20 | reptileList[index] = JSON.parse(value);
21 | });
22 | let data = {
23 | reptileList,
24 | count
25 | };
26 | res.send(tool.toJson(data, '', 1000));
27 | } catch(err) {
28 | res.send(tool.toJson(null, JSON.stringify(err), 1002));
29 | }
30 | });
31 |
32 | module.exports = router;
33 |
--------------------------------------------------------------------------------
/h5/dist/css/common/font/iconfont.css:
--------------------------------------------------------------------------------
1 | @font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_810586_pamqgips18.eot);src:url(//at.alicdn.com/t/font_810586_pamqgips18.eot?#iefix) format('embedded-opentype'),url(//at.alicdn.com/t/font_810586_pamqgips18.woff) format('woff'),url(//at.alicdn.com/t/font_810586_pamqgips18.ttf) format('truetype'),url(//at.alicdn.com/t/font_810586_pamqgips18.svg#iconfont) format('svg')}.iconfont{font-family:iconfont!important;font-size:1.1rem;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:sub}.icon-shujia:before{content:"\e7ec"}.icon-shouye:before{content:"\e60c"}.icon-geren:before{content:"\e60a"}.icon-wangqishujia:before{content:"\e617"}.icon-shujia1:before{content:"\eb3f"}.icon-books:before{content:"\e6d5"}.icon-wodeshujia:before{content:"\e72b"}.icon-xuanze:before{content:"\e611"}.icon-Toright:before{content:"\e600"}.icon-Totop:before{content:"\e805"}.icon-Toboottom:before{content:"\e804"}.icon-Toleft:before{content:"\e601"}
--------------------------------------------------------------------------------
/h5/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "h5",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "node ./bin/h5",
7 | "dev": "node ./bin/h5"
8 | },
9 | "dependencies": {
10 | "babel-core": "^6.26.3",
11 | "babel-preset-env": "^1.7.0",
12 | "clean": "^4.0.2",
13 | "cookie-parser": "~1.4.3",
14 | "debug": "~2.6.9",
15 | "ejs": "^2.6.1",
16 | "express": "~4.16.0",
17 | "gulp": "^3.9.1",
18 | "gulp-autoprefixer": "^6.0.0",
19 | "gulp-babel": "^7.0.1",
20 | "gulp-clean": "^0.4.0",
21 | "gulp-clean-css": "^3.10.0",
22 | "gulp-concat": "^2.6.1",
23 | "gulp-imagemin": "^4.1.0",
24 | "gulp-less": "^4.0.1",
25 | "gulp-rev": "^8.1.1",
26 | "gulp-rev-replace": "^0.4.4",
27 | "gulp-uglify": "^3.0.1",
28 | "http-errors": "~1.6.2",
29 | "less-middleware": "~2.2.1",
30 | "morgan": "~1.9.0",
31 | "pug": "2.0.0-beta11",
32 | "vconsole": "^3.2.0"
33 | },
34 | "devDependencies": {}
35 | }
36 |
--------------------------------------------------------------------------------
/api文档/timoh5/lie-biao-jie-kou/xiao-shuo-lei-xing-lie-biao.md:
--------------------------------------------------------------------------------
1 | ### 小说类型列表接口
2 |
3 | 1、接口地址:/bookTypeList
4 |
5 | 2、参数
6 |
7 | | 参数名 | 参数类型 | 是否必填 | 备注 |
8 | | :--- | :--- | :--- | :--- |
9 | | page | int | 否 | 页数,默认1 |
10 | | limit | int | 否 | 一页几条,默认100 |
11 |
12 | 3、接口返回结构
13 |
14 | ```js
15 | data: {
16 | "count": 全部小说类型数量
17 | "bookTypeList": [
18 | {
19 | "count(bookType)": 多少本这种类型的小说
20 | "bookType":"都市小说"
21 | },
22 | {
23 | "count(bookType)": 多少本这种类型的小说
24 | "bookType":"言情小说"
25 | }
26 |
27 | ]
28 | }
29 | ```
30 |
31 | 4、接口返回例子
32 |
33 | ```js
34 | {
35 | "code": 1000,
36 | "data": {
37 | "bookTypeList": [
38 | {
39 | "count(bookType)": 40,
40 | "bookType": "都市小说"
41 | },
42 | {
43 | "count(bookType)": 3,
44 | "bookType": "言情小说"
45 | }
46 | ],
47 | "count": 11
48 | },
49 | "msg": ""
50 | }
51 | ```
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/adminApi/routes/book/updateCatalogIsJin.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | const { oauth, tool, db, log } = require("../../tool/require");
4 |
5 | /*
6 | * 切换章节isJin
7 | * catalogId 章节id
8 | * isJin 1禁用 2不禁用
9 | * */
10 | router.use('', oauth(1104), async function(req, res, next) {
11 | let catalogId = parseInt(tool.getParams(req, 'catalogId'));
12 | let isJin = parseInt(tool.getParams(req, 'isJin'));
13 |
14 | if(!catalogId) {
15 | res.send(tool.toJson(null, 'catalogId参数不合法', 1002));
16 | return;
17 | }
18 | if(!isJin) {
19 | res.send(tool.toJson(null, 'isJin参数不合法', 1002));
20 | return;
21 | }
22 |
23 |
24 | try{
25 | await db.query(`update catalog set isJin=${isJin} where id=${catalogId}` );
26 | res.send(tool.toJson('修改成功', null, 1000));
27 | }catch(err) {
28 | res.send(tool.toJson(null, '修改失败', 1002));
29 | }
30 |
31 |
32 | });
33 |
34 | module.exports = router;
35 |
--------------------------------------------------------------------------------
/h5/src/js/pages/home/index.js:
--------------------------------------------------------------------------------
1 | ;(function() {
2 | window.addEventListener('load', function () {
3 | init();
4 | });
5 |
6 | function init(){
7 | // var swiper = new Swiper('.swiper-container', {
8 | // pagination: {
9 | // el: '.swiper-pagination',
10 | // },
11 | // });
12 |
13 |
14 | //搜索功能
15 | window.touchEvent.tap($(".book-searct-a")[0], search);
16 | $('.book-search-input')[0].onkeypress = function (e) {
17 | if (e.keyCode == 13) {
18 | search();
19 | }
20 | }
21 | }
22 |
23 |
24 | /*
25 | * 搜索功能
26 | * */
27 | function search(){
28 | let bookName = $('.book-search-input')[0].value || '';
29 | if(!bookName){
30 | return;
31 | }
32 | if(!bookName.trim()) {
33 | return;
34 | }
35 | location.href="/book/search?bookName=" + bookName;
36 | }
37 | })();
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/adminApi/service/ip/removeRepeat.js:
--------------------------------------------------------------------------------
1 | const { oauth, tool, db, log } = require("../../tool/require");
2 |
3 |
4 |
5 | async function removeRepeat() {
6 | return new Promise(async (resolve, reject) => {
7 | if(global.reptileIp) {
8 | reject(`代理IP正在爬取中,请稍后再试`);
9 | return;
10 | }
11 |
12 | if(global.removeRepeat) {
13 | reject(`代理IP正在去重中,请耐心等待`)
14 | return;
15 | }
16 | global.removeRepeat = true;
17 | try{
18 |
19 | let ipList = await tool.redisData.ipList.getAllIpList();
20 | let ipList2 = tool.distinct(ipList);
21 | await tool.redisData.ipList.updateIpList(ipList2);
22 | global.removeRepeat = false;
23 | resolve(`代理IP去重完毕`);
24 | }catch(err){
25 | global.removeRepeat = false;
26 | log.error(err);
27 | reject(`代理ip去重失败,错误原因:${err}`);
28 | }
29 | })
30 | }
31 |
32 |
33 |
34 |
35 | module.exports = removeRepeat;
--------------------------------------------------------------------------------
/iview-admin-dev/src/store/modules/user.js:
--------------------------------------------------------------------------------
1 | import Cookies from 'js-cookie';
2 |
3 | const user = {
4 | state: {
5 | user:Cookies.get("user") ? JSON.parse(Cookies.get("user")) : {}
6 | },
7 | mutations: {
8 | logout (state, vm) {
9 | Cookies.remove('token');
10 | Cookies.remove('user');
11 | Cookies.remove('access');
12 | state.user = {};
13 | // 恢复默认样式
14 | let themeLink = document.querySelector('link[name="theme"]');
15 | themeLink.setAttribute('href', '');
16 | // 清空打开的页面等数据,但是保存主题数据
17 | let theme = '';
18 | if (localStorage.theme) {
19 | theme = localStorage.theme;
20 | }
21 | localStorage.clear();
22 | if (theme) {
23 | localStorage.theme = theme;
24 | }
25 | },
26 | setUser(state,user) {
27 | state.user = user;
28 | }
29 | }
30 | };
31 |
32 | export default user;
33 |
--------------------------------------------------------------------------------
/h5/dist/lib/swiper/src/components/core/update/updateSize.js:
--------------------------------------------------------------------------------
1 | import Utils from '../../../utils/utils';
2 |
3 | export default function () {
4 | const swiper = this;
5 | let width;
6 | let height;
7 | const $el = swiper.$el;
8 | if (typeof swiper.params.width !== 'undefined') {
9 | width = swiper.params.width;
10 | } else {
11 | width = $el[0].clientWidth;
12 | }
13 | if (typeof swiper.params.height !== 'undefined') {
14 | height = swiper.params.height;
15 | } else {
16 | height = $el[0].clientHeight;
17 | }
18 | if ((width === 0 && swiper.isHorizontal()) || (height === 0 && swiper.isVertical())) {
19 | return;
20 | }
21 |
22 | // Subtract paddings
23 | width = width - parseInt($el.css('padding-left'), 10) - parseInt($el.css('padding-right'), 10);
24 | height = height - parseInt($el.css('padding-top'), 10) - parseInt($el.css('padding-bottom'), 10);
25 |
26 | Utils.extend(swiper, {
27 | width,
28 | height,
29 | size: swiper.isHorizontal() ? width : height,
30 | });
31 | }
32 |
--------------------------------------------------------------------------------
/h5/src/lib/swiper/src/components/core/update/updateSize.js:
--------------------------------------------------------------------------------
1 | import Utils from '../../../utils/utils';
2 |
3 | export default function () {
4 | const swiper = this;
5 | let width;
6 | let height;
7 | const $el = swiper.$el;
8 | if (typeof swiper.params.width !== 'undefined') {
9 | width = swiper.params.width;
10 | } else {
11 | width = $el[0].clientWidth;
12 | }
13 | if (typeof swiper.params.height !== 'undefined') {
14 | height = swiper.params.height;
15 | } else {
16 | height = $el[0].clientHeight;
17 | }
18 | if ((width === 0 && swiper.isHorizontal()) || (height === 0 && swiper.isVertical())) {
19 | return;
20 | }
21 |
22 | // Subtract paddings
23 | width = width - parseInt($el.css('padding-left'), 10) - parseInt($el.css('padding-right'), 10);
24 | height = height - parseInt($el.css('padding-top'), 10) - parseInt($el.css('padding-bottom'), 10);
25 |
26 | Utils.extend(swiper, {
27 | width,
28 | height,
29 | size: swiper.isHorizontal() ? width : height,
30 | });
31 | }
32 |
--------------------------------------------------------------------------------
/iview-admin-dev/src/views/my-components/draggable-list/draggable-list.less:
--------------------------------------------------------------------------------
1 | .iview-admin-draggable-list{
2 | height: 100%;
3 | }
4 | .iview-admin-draggable-list li{
5 | padding: 9px;
6 | border: 1px solid #e7ebee;
7 | border-radius: 3px;
8 | margin-bottom: 5px;
9 | cursor: pointer;
10 | position: relative;
11 | transition: all .2s;
12 | }
13 | .iview-admin-draggable-list li:hover{
14 | color: #87b4ee;
15 | border-color: #87b4ee;
16 | transition: all .2s;
17 | }
18 | .iview-admin-draggable-delete{
19 | height: 100%;
20 | position: absolute;
21 | right: -8px;
22 | top: 0px;
23 | display: none;
24 | }
25 | .iview-admin-draggable-list li:hover .iview-admin-draggable-delete{
26 | display: block;
27 | }
28 | .placeholder-style{
29 | display: block !important;
30 | color: transparent;
31 | border-style: dashed !important;
32 | }
33 | .delte-item-animation{
34 | opacity: 0;
35 | transition: all .2s;
36 | }
37 | .iview-admin-draggable-list{
38 | overflow: auto
39 | }
--------------------------------------------------------------------------------