diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..9e7ac80 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,59 @@ +/** + Gulpfile for gulp-liblog + created by livisky +*/ + +var gulp = require('gulp'), + concat = require('gulp-concat'), + uglify = require('gulp-uglify'), + cssmin = require('gulp-cssmin'), + minifyHTML = require('gulp-minify-html'), + htmlreplace = require('gulp-html-replace'); + +var targetUrl = 'www/static/theme/liblog/res/'; + +//将css拷贝到目标目录并压缩-livi +gulp.task('copy:css', function() { + return gulp.src([targetUrl + 'src/css/**/**/*']) + //压缩less编译后的css及目录下的css + .pipe(cssmin()) + //拷贝到相应目录 + .pipe(gulp.dest(targetUrl + 'css')); +}); + +// 合并公用css文件 +gulp.task('concat', ['copy:css'], function() { + return gulp.src([targetUrl + 'css/business/index/index.css', targetUrl + 'css/business/index/layout.css']) + .pipe(concat('default.min.css')) + .pipe(gulp.dest(targetUrl + 'css/business/index')); +}); + +//将js拷贝到目标目录并压缩-livi +gulp.task('copy:js', function() { + return gulp.src([targetUrl + 'src/js/**/**/*']) + // /www/static/theme/liblog/res/ + .pipe(uglify()) + .pipe(gulp.dest(targetUrl + 'js')) +}); + +// 合并公用js文件 +gulp.task('uglify', ['copy:js'], function() { + return gulp.src([targetUrl + 'js/business/pagecommon/footer.js', targetUrl + 'js/widget/timeago/timeago.js', targetUrl + 'js/widget/timeago/timeago.zh-cn.js']) + .pipe(concat('footer.min.js')) + .pipe(gulp.dest(targetUrl + 'js/business/pagecommon')) +}); + + +gulp.task('html-replace', function() { + var opts = { comments: false, spare: false, quotes: true }; + return gulp.src('www/static/theme/liblog/modules_src/**/**/*.html') + .pipe(htmlreplace({ + 'css': '/static/theme/liblog/res/css/business/index/default.min.css', + 'js': '/static/theme/liblog/res/js/business/pagecommon/footer.min.js' + })) + .pipe(minifyHTML(opts)) + .pipe(gulp.dest('www/static/theme/liblog/modules')); +}); + +//压缩、发布 +gulp.task('default', ['copy:css', 'concat', 'copy:js', 'uglify', 'html-replace']); \ No newline at end of file diff --git a/liblog.sql b/liblog.sql index 2a7e1bb..7a487e0 100644 --- a/liblog.sql +++ b/liblog.sql @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50540 File Encoding : 65001 -Date: 2016-09-28 14:31:31 +Date: 2017-01-05 14:26:16 */ SET FOREIGN_KEY_CHECKS=0; @@ -176,7 +176,7 @@ INSERT INTO `li_article` VALUES ('296', 'rest controller', '', '

think.c INSERT INTO `li_article` VALUES ('297', 'model', '', '

think.model.base 继承自 think.base 类。

\n
使用 ES6 的语法继承该类
\n
export default class extends think.model.base {\n  getList(){\n\n  }\n}\n
\n
使用普通方式继承该类
\n
module.exports = think.model({\n  getList: function(){\n\n  }\n})\n
\n

属性

\n

model.pk

\n

数据表主键,默认为 id

\n

model.name

\n

模型名,默认从当前文件名中解析。

\n

当前文件路径为 for/bar/app/home/model/user.js,那么解析的模型名为 user

\n

model.tablePrefix

\n

数据表名称前缀,默认为 think_

\n

model.tableName

\n

数据表名称,不包含前缀。默认等于模型名。

\n

model.schema

\n

数据表字段,关系型数据库默认自动从数据表分析。

\n

model.indexes

\n

数据表索引,关系数据库会自动从数据表分析。

\n

model.config

\n

配置,实例化的时候指定。

\n

model._db

\n

连接数据库句柄。

\n

model._data

\n

操作的数据。

\n

model._options

\n

操作选项。

\n

方法

\n

model.model(name, options, module)

\n\n

获取模型实例,可以跨模块获取。

\n
export default class extends think.model.base {\n  * getList(){\n    //获取 user 模型实例\n    let instance = this.model(\'user\');\n    let list = yield instance.select();\n    let ids = list.map(item => {\n      return item.id;\n    });\n    let data = yield this.where({id: [\'IN\', ids]}).select();\n    return data;\n  }\n}\n
\n

model.getTablePrefix()

\n\n

获取表名前缀。

\n

model.getConfigKey()

\n\n

获取配置对应的 key,缓存 db 句柄时使用。

\n

model.db()

\n\n

根据当前的配置获取 db 实例,如果已经存在则直接返回。

\n

model.getModelName()

\n\n

如果已经配置则直接返回,否则解析当前的文件名。

\n

model.getTableName()

\n\n

获取表名,包含表前缀。

\n

model.cache(key, timeout)

\n\n

设置缓存选项。

\n
设置缓存 key 和时间
\n
export default class extends think.model.base {\n  getList(){\n    return this.cache(\'getList\', 1000).where({id: {\'>\': 100}}).select();\n  }\n}\n
\n
只设置缓存时间,缓存 key 自动生成
\n
export default class extends think.model.base {\n  getList(){\n    return this.cache(1000).where({id: {\'>\': 100}}).select();\n  }\n}\n
\n
设置更多的缓存信息
\n
export default class extends think.model.base {\n  getList(){\n    return this.cache({\n      key: \'getList\',\n      timeout: 1000,\n      type: \'file\' //使用文件方式缓存\n    }).where({id: {\'>\': 100}}).select();\n  }\n}\n
\n

model.limit(offset, length)

\n\n

设置查询结果的限制条件。

\n
限制数据长度
\n
export default class extends think.model.base {\n  getList(){\n    //查询20条数据\n    return this.limit(20).where({id: {\'>\': 100}}).select();\n  }\n}\n
\n
限制数据起始位置和长度
\n
export default class extends think.model.base {\n  getList(){\n    //从起始位置100开始查询20调数据\n    return this.limit(100, 20).where({id: {\'>\': 100}}).select();\n  }\n}\n
\n

model.page(page, listRows)

\n\n

设置查询分页数据,自动转化为 limit 数据。

\n
export default class extends think.model.base {\n  getList(){\n    //查询第 2 页数据,每页 10 条数据\n    return this.page(2, 10).where({id: {\'>\': 100}}).select();\n  }\n}\n
\n

model.where(where)

\n\n

设置 where 查询条件。可以通过属性 _logic 设置逻辑,默认为 AND。可以通过属性 _complex 设置复合查询。

\n

:1、以下示例不适合 mongo model,mongo 中设置 where 条件请见 model.mongo 里的 where 条件设定。2、where 条件中的值需要在 Logic 里做数据校验,否则可能会有漏洞。

\n
普通条件
\n
export default class extends think.model.base {\n  where1(){\n    //SELECT * FROM `think_user`\n    return this.where().select();\n  }\n  where2(){\n    //SELECT * FROM `think_user` WHERE ( `id` = 10 )\n    return this.where({id: 10}).select();\n  }\n  where3(){\n    //SELECT * FROM `think_user` WHERE ( id = 10 OR id < 2 )\n    return this.where(\'id = 10 OR id < 2\').select();\n  }\n  where4(){\n    //SELECT * FROM `think_user` WHERE ( `id` != 10 )\n    return this.where({id: [\'!=\', 10]}).select();\n  }\n}\n
\n
null 条件
\n
export default class extends think.model.base {\n  where1(){\n    //SELECT * FROM `think_user` where ( title IS NULL );\n    return this.where({title: null}).select();\n  }\n  where2(){\n    //SELECT * FROM `think_user` where ( title IS NOT NULL );\n    return this.where({title: [\'!=\', null]}).select();\n  }\n}\n
\n
EXP 条件
\n

ThinkJS 默认会对字段和值进行转义,防止安全漏洞。有时候一些特殊的情况不希望被转义,可以使用 EXP 的方式,如:

\n
export default class extends think.model.base {\n  where1(){\n    //SELECT * FROM `think_user` WHERE ( (`name` =\'name\') )\n    return this.where({name: [\'EXP\', \"=\\\"name\\\"\"]}).select();\n  }\n}\n
\n
LIKE 条件
\n
export default class extends think.model.base {\n  where1(){\n    //SELECT * FROM `think_user` WHERE ( `title` NOT LIKE \'welefen\' )\n    return this.where({title: [\'NOTLIKE\', \'welefen\']}).select();\n  }\n  where2(){\n    //SELECT * FROM `think_user` WHERE ( `title` LIKE \'%welefen%\' )\n    return this.where({title: [\'like\', \'%welefen%\']}).select();\n  }\n  //like 多个值\n  where3(){\n    //SELECT * FROM `think_user` WHERE ( (`title` LIKE \'welefen\' OR `title` LIKE \'suredy\') )\n    return this.where({title: [\'like\', [\'welefen\', \'suredy\']]}).select();\n  }\n  //多个字段或的关系 like 一个值\n  where4(){\n    //SELECT * FROM `think_user` WHERE ( (`title` LIKE \'%welefen%\') OR (`content` LIKE \'%welefen%\') )\n    return this.where({\'title|content\': [\'like\', \'%welefen%\']}).select();\n  }\n  //多个字段与的关系 Like 一个值\n  where5(){\n    //SELECT * FROM `think_user` WHERE ( (`title` LIKE \'%welefen%\') AND (`content` LIKE \'%welefen%\') )\n    return this.where({\'title&content\': [\'like\', \'%welefen%\']}).select();\n  }\n}\n
\n
IN 条件
\n
export default class extens think.model.base {\n  where1(){\n    //SELECT * FROM `think_user` WHERE ( `id` IN (\'10\',\'20\') )\n    return this.where({id: [\'IN\', \'10,20\']}).select();\n  }\n  where2(){\n    //SELECT * FROM `think_user` WHERE ( `id` IN (10,20) )\n    return this.where({id: [\'IN\', [10, 20]]}).select();\n  }\n  where3(){\n    //SELECT * FROM `think_user` WHERE ( `id` NOT IN (10,20) )\n    return this.where({id: [\'NOTIN\', [10, 20]]}).select();\n  }\n}\n
\n
BETWEEN 查询
\n
export default class extens think.model.base {\n  where1(){\n    //SELECT * FROM `think_user` WHERE (  (`id` BETWEEN 1 AND 2) )\n    return this.where({id: [\'BETWEEN\', 1, 2]}).select();\n  }\n  where2(){\n    //SELECT * FROM `think_user` WHERE (  (`id` BETWEEN \'1\' AND \'2\') )\n    return this.where({id: [\'between\', \'1,2\']}).select();\n  }\n}\n
\n
多字段查询
\n
export default class extends think.model.base {\n  where1(){\n    //SELECT * FROM `think_user` WHERE ( `id` = 10 ) AND ( `title` = \'www\' )\n    return this.where({id: 10, title: \"www\"}).select();\n  }\n  //修改逻辑为 OR\n  where2(){\n    //SELECT * FROM `think_user` WHERE ( `id` = 10 ) OR ( `title` = \'www\' )\n    return this.where({id: 10, title: \"www\", _logic: \'OR\'}).select();\n  }\n  //修改逻辑为 XOR\n  where2(){\n    //SELECT * FROM `think_user` WHERE ( `id` = 10 ) XOR ( `title` = \'www\' )\n    return this.where({id: 10, title: \"www\", _logic: \'XOR\'}).select();\n  }\n}\n
\n
多条件查询
\n
export default class extends think.model.base {\n  where1(){\n    //SELECT * FROM `think_user` WHERE ( `id` > 10 AND `id` < 20 )\n    return this.where({id: {\'>\': 10, \'<\': 20}}).select();\n  }\n  //修改逻辑为 OR \n  where2(){\n    //SELECT * FROM `think_user` WHERE ( `id` < 10 OR `id` > 20 )\n    return this.where({id: {\'<\': 10, \'>\': 20, _logic: \'OR\'}}).select()\n  }\n}\n
\n
复合查询
\n
export default class extends think.model.base {\n  where1(){\n    //SELECT * FROM `think_user` WHERE ( `title` = \'test\' ) AND (  ( `id` IN (1,2,3) ) OR ( `content` = \'www\' ) )\n    return this.where({\n      title: \'test\',\n      _complex: {id: [\'IN\', [1, 2, 3]],\n        content: \'www\',\n        _logic: \'or\'\n      }\n    }).select()\n  }\n}\n
\n

model.field(field)

\n\n

设置要查询的字段。

\n
字符串方式
\n
export default class extends think.controller.base {\n  async indexAction(){\n    let model = this.model(\'user\');\n    //设置要查询的字符串,字符串方式,多个用逗号隔开\n    let data = await model.field(\'name,title\').select();\n  }\n}\n
\n
调用 SQL 函数
\n
export default class extends think.controller.base {\n  //字段里调用 SQL 函数\n  async listAction(){\n    let model = this.model(\'user\');\n    let data = await model.field(\'id, INSTR(\\\'30,35,31,\\\',id + \\\',\\\') as d\').select();\n  }\n}\n
\n
数组方式
\n
export default class extends think.controller.base {\n  async indexAction(){\n    let model = this.model(\'user\');\n    //设置要查询的字符串,数组方式\n    let data = await model.field([\'name\',\'title\']).select();\n  }\n}\n
\n

model.fieldReverse(field)

\n\n

设置反选字段,查询的时候会过滤这些字段,支持字符串和数组 2 种方式。

\n

model.table(table, hasPrefix)

\n\n

设置表名,可以将一个 SQL 语句设置为表名。

\n
设置当前表名
\n
export default class extends think.model.base {\n  getList(){\n    return this.table(\'test\', true).select();\n  }\n}\n
\n
SQL 语句作为表名
\n
export default class extends think.model.base {\n  async getList(){\n    let sql = await this.model(\'group\').group(\'name\').buildSql();\n    let data = await this.table(sql).select();\n    return data;\n  }\n}\n
\n

model.union(union, all)

\n\n

联合查询。

\n
SQL 联合查询
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` UNION (SELECT * FROM think_pic2)\n    return this.union(\'SELECT * FROM think_pic2\').select();\n  }\n}\n
\n
表名联合查询
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` UNION ALL (SELECT * FROM `think_pic2`)\n    return this.union({table: \'think_pic2\'}, true).select();\n  }\n}\n
\n

model.join(join)

\n\n

组合查询,支持字符串、数组和对象等多种方式。

\n
字符串
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` LEFT JOIN think_cate ON think_group.cate_id=think_cate.id\n    return this.join(\'think_cate ON think_group.cate_id=think_cate.id\').select();\n  }\n}\n
\n
数组
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` LEFT JOIN think_cate ON think_group.cate_id=think_cate.id RIGHT JOIN think_tag ON think_group.tag_id=think_tag.id\n    return this.join([\n      \'think_cate ON think_group.cate_id=think_cate.id\', \n      \'RIGHT JOIN think_tag ON think_group.tag_id=think_tag.id\'\n    ]).select();\n  }\n}\n
\n
对象:单个表
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` INNER JOIN `think_cate` AS c ON think_user.`cate_id`=c.`id`\n    return this.join({\n      table: \'cate\', \n      join: \'inner\', //join 方式,有 left, right, inner 3 种方式\n      as: \'c\', // 表别名\n      on: [\'cate_id\', \'id\'] //ON 条件\n    }).select();\n  }\n}\n
\n
对象:多次 JOIN
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM think_user AS a LEFT JOIN `think_cate` AS c ON a.`cate_id`=c.`id` LEFT JOIN `think_group_tag` AS d ON a.`id`=d.`group_id`\n    return this.alias(\'a\').join({\n      table: \'cate\',\n      join: \'left\',\n      as: \'c\',\n      on: [\'cate_id\', \'id\']\n    }).join({\n      table: \'group_tag\',\n      join: \'left\',\n      as: \'d\',\n      on: [\'id\', \'group_id\']\n    }).select()\n  }\n}\n
\n
对象:多个表
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` LEFT JOIN `think_cate` ON think_user.`id`=think_cate.`id` LEFT JOIN `think_group_tag` ON think_user.`id`=think_group_tag.`group_id`\n    return this.join({\n      cate: {\n        on: [\'id\', \'id\']\n      },\n      group_tag: {\n        on: [\'id\', \'group_id\']\n      }\n    }).select();\n  }\n}\n
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM think_user AS a LEFT JOIN `think_cate` AS c ON a.`id`=c.`id` LEFT JOIN `think_group_tag` AS d ON a.`id`=d.`group_id`\n    return this.alias(\'a\').join({\n      cate: {\n        join: \'left\', // 有 left,right,inner 3 个值\n        as: \'c\',\n        on: [\'id\', \'id\']\n      },\n      group_tag: {\n        join: \'left\',\n        as: \'d\',\n        on: [\'id\', \'group_id\']\n      }\n    }).select()\n  }\n}\n
\n
对象:ON 条件含有多个字段
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` LEFT JOIN `think_cate` ON think_user.`id`=think_cate.`id` LEFT JOIN `think_group_tag` ON think_user.`id`=think_group_tag.`group_id` LEFT JOIN `think_tag` ON (think_user.`id`=think_tag.`id` AND think_user.`title`=think_tag.`name`)\n    return this.join({\n      cate: {on: \'id, id\'},\n      group_tag: {on: [\'id\', \'group_id\']},\n      tag: {\n        on: { // 多个字段的 ON\n          id: \'id\',\n          title: \'name\'\n        }\n      }\n    }).select()\n  }\n}\n
\n
对象:table 值为 SQL 语句
\n
export default class extends think.model.base {\n  async getList(){\n    let sql = await this.model(\'group\').buildSql();\n    //SELECT * FROM `think_user` LEFT JOIN ( SELECT * FROM `think_group` ) ON think_user.`gid`=( SELECT * FROM `think_group` ).`id`\n    return this.join({\n      table: sql,\n      on: [\'gid\', \'id\']\n    }).select();\n  }\n}\n
\n

model.order(order)

\n\n

设置排序方式。

\n
字符串
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` ORDER BY id DESC, name ASC\n    return this.order(\'id DESC, name ASC\').select();\n  }\n  getList1(){\n    //SELECT * FROM `think_user` ORDER BY count(num) DESC\n    return this.order(\'count(num) DESC\').select();\n  }\n}\n
\n
数组
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` ORDER BY id DESC,name ASC\n    return this.order([\'id DESC\', \'name ASC\']).select();\n  }\n}\n
\n
对象
\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` ORDER BY `id` DESC,`name` ASC\n    return this.order({\n      id: \'DESC\',\n      name: \'ASC\'\n    }).select();\n  }\n}\n
\n

model.alias(tableAlias)

\n\n

设置表别名。

\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM think_user AS a;\n    return this.alias(\'a\').select();\n  }\n}\n
\n

model.having(having)

\n\n

设置 having 查询。

\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` HAVING view_nums > 1000 AND view_nums < 2000\n    return this.having(\'view_nums > 1000 AND view_nums < 2000\').select();\n  }\n}\n
\n

model.group(group)

\n\n

设定分组查询。

\n
export default class extends think.model.base {\n  getList(){\n    //SELECT * FROM `think_user` GROUP BY `name`\n    return this.group(\'name\').select();\n  }\n}\n
\n

model.distinct(distinct)

\n\n

去重查询。

\n
export default class extends think.model.base {\n  getList(){\n    //SELECT DISTINCT `name` FROM `think_user`\n    return this.distinct(\'name\').select();\n  }\n}\n
\n

model.explain(explain)

\n\n

是否在 SQL 之前添加 explain 执行,用来查看 SQL 的性能。

\n

model.optionsFilter(options)

\n

操作选项过滤。

\n

model.dataFilter(data)

\n\n

数据过滤。

\n

model.beforeAdd(data)

\n\n

添加前置操作。

\n

model.afterAdd(data)

\n\n

添加后置操作。

\n

model.afterDelete(data)

\n

删除后置操作。

\n

model.beforeUpdate(data)

\n\n

更新前置操作。

\n

model.afterUpdate(data)

\n\n

更新后置操作。

\n

model.afterFind(data)

\n\n

find 查询后置操作。

\n

model.afterSelect(data)

\n\n

select 查询后置操作。

\n

model.data(data)

\n\n

添加和更新操作时设置操作的数据。

\n

model.options(options)

\n\n

设置操作选项。如:

\n
export default class extends think.model.base {\n  getList(){\n    return this.options({\n      where: \'id = 1\',\n      limit: [10, 1]\n    }).select();\n  }\n}\n
\n

model.close()

\n

关于数据库连接,一般情况下不要直接调用。

\n

model.getSchema(table)

\n\n

获取表的字段信息,自动从数据库中读取。

\n

model.getTableFields(table)

\n

已废弃,使用 model.getSchema 方法替代。

\n

model.getLastSql()

\n\n

获取最后执行的 SQL 语句。

\n

model.buildSql()

\n\n

将当前的查询条件生成一个 SQL 语句。

\n

model.parseOptions(oriOpts, extraOptions)

\n\n

根据已经设定的一些条件解析当前的操作选项。

\n

model.getPk()

\n\n

返回 pk 的值,返回一个 Promise。

\n

model.parseType(field, value)

\n\n

根据数据表中的字段类型解析 value。

\n

model.parseData(data)

\n\n

调用 parseType 方法解析数据。

\n

model.add(data, options, replace)

\n\n

添加一条数据。

\n

model.thenAdd(data, where)

\n\n

当 where 条件未命中到任何数据时才添加数据。

\n

model.addMany(dataList, options, replace)

\n\n

一次添加多条数据。

\n

model.delete(options)

\n\n

删除数据。

\n

删除 id 为 7 的数据。

\n
model.delete({\n  where: {id: 7}\n});\n
\n

model.update(data, options)

\n\n

更新数据。

\n

updateMany(dataList, options)

\n\n

更新多条数据,dataList 里必须包含主键的值,会自动设置为更新条件。

\n

model.increment(field, step)

\n\n

字段值增加。

\n

model.decrement(field, step)

\n\n

字段值减少。

\n

model.find(options)

\n\n

查询单条数据,返回的数据类型为对象。如果未查询到相关数据,返回值为 {}

\n

model.select(options)

\n\n

查询多条数据,返回的数据类型为数组。如果未查询到相关数据,返回值为 []

\n

model.countSelect(options, pageFlag)

\n\n

分页查询,一般需要结合 page 方法一起使用。如:

\n
export default class extends think.controller.base {\n  async listAction(){\n    let model = this.model(\'user\');\n    let data = await model.page(this.get(\'page\')).countSelect();\n  }\n}\n
\n

返回值数据结构如下:

\n
{\n  numsPerPage: 10, //每页显示的条数\n  currentPage: 1, //当前页\n  count: 100, //总条数\n  totalPages: 10, //总页数\n  data: [{ //当前页下的数据列表\n    name: \"thinkjs\",\n    email: \"admin@thinkjs.org\"\n  }, ...]\n}\n
\n

model.getField(field, one)

\n\n

获取特定字段的值。

\n

model.count(field)

\n\n

获取总条数。

\n

model.sum(field)

\n\n

对字段值进行求和。

\n

model.min(field)

\n\n

求字段的最小值。

\n

model.max(field)

\n\n

求字段的最大值。

\n

model.avg(field)

\n\n

求字段的平均值。

\n

model.query(...args)

\n\n

指定 SQL 语句执行查询。

\n

model.execute(...args)

\n\n

执行 SQL 语句。

\n

model.parseSql(sql, ...args)

\n\n

解析 SQL 语句,调用 util.format 方法解析 SQL 语句,并将 SQL 语句中的 __TABLENAME__ 解析为对应的表名。

\n
export default class extends think.model.base {\n  getSql(){\n    let sql = \'SELECT * FROM __GROUP__ WHERE id=%d\';\n    sql = this.parseSql(sql, 10);\n    //sql is SELECT * FROM think_group WHERE id=10\n  }\n}\n
\n

model.startTrans()

\n\n

开启事务。

\n

model.commit()

\n\n

提交事务。

\n

model.rollback()

\n\n

回滚事务。

\n

model.transaction(fn)

\n\n

使用事务来执行传递的函数,函数要返回 Promise。

\n
export default class extends think.model.base {\n  updateData(data){\n    return this.transaction(async () => {\n      let insertId = await this.add(data);\n      let result = await this.model(\'user_cate\').add({user_id: insertId, cate_id: 100});\n      return result;\n    })\n  }\n}\n

\n文章来源:http://www.thinkjs.org


', '', '', '2016-07-17 14:37:21', '62', '0', '0', '0', '18', 'thinkjs,nodejs', '1', '1', '', '8', '0', null, null, null, null); INSERT INTO `li_article` VALUES ('298', 'MongoDB', '', '

think.model.mongo 继承类 think.model.base

\n
使用 ES6 的语法继承该类
\n
export default class extends think.model.mongo {\n  getList(){\n\n  }\n}\n
\n
使用普通方式继承该类
\n
module.exports = think.model(\'mongo\', {\n  getList: function(){\n\n  }\n})\n
\n

属性

\n

model.schema

\n

设置字段,如:

\n
export default class extends think.model.mongo {\n  init(...args){\n    super.init(...args);\n    //设置字段\n    this.schema = {\n      name: {\n        type: \'string\'\n      },\n      pwd: {\n        type: \'string\'\n      }\n    }\n  }\n}\n
\n

:目前框架并不会对字段进行检查。

\n

model.indexes

\n

设置字段索引,数据操作之前会自动创建索引。

\n
export default class extends think.model.mongo {\n  init(...args){\n    super.init(...args);\n    //配置索引\n    this.indexes = { \n\n    }\n  }\n}\n
\n
单字段索引
\n
export default class extends think.model.mongo {\n  init(...args){\n    super.init(...args);\n    //配置索引\n    this.indexes = { \n      name: 1\n    }\n  }\n}\n
\n
唯一索引
\n

通过 $unique 来指定为唯一索引,如:

\n
export default class extends think.model.mongo {\n  init(...args){\n    super.init(...args);\n    //配置索引\n    this.indexes = { \n      name: {$unique: 1}\n    }\n  }\n}\n
\n
多字段索引
\n

可以将多个字段联合索引,如:

\n
export default class extends think.model.mongo {\n  init(...args){\n    super.init(...args);\n    //配置索引\n    this.indexes = { \n      email: 1\n      test: {\n        name: 1,\n        title: 1,\n        $unique: 1\n      }\n    }\n  }\n}\n
\n

model.pk

\n

主键名,默认为 _id,可以通过 this.getPk 方法获取。

\n

方法

\n

model.where(where)

\n

mongo 模型中的 where 条件设置和关系数据库中不太一样。

\n
等于判断
\n
export default class extends think.model.mongo {\n  where1(){\n    return this.where({ type: \"snacks\" }).select();\n  }\n}\n
\n
AND 条件
\n
export default class extends think.model.mongo {\n  where1(){\n    return this.where({ type: \'food\', price: { $lt: 9.95 } }).select();\n  }\n}\n
\n
OR 条件
\n
export default class extends think.model.mongo {\n  where1(){\n    return this.where({\n     $or: [ { qty: { $gt: 100 } }, { price: { $lt: 9.95 } } ]\n    }).select();\n  }\n  where2(){\n    return this.where({\n     type: \'food\',\n     $or: [ { qty: { $gt: 100 } }, { price: { $lt: 9.95 } } ]\n   }).select();\n  }\n}\n
\n
内嵌文档
\n
export default class extends think.model.mongo {\n  where1(){\n    return this.where( {\n      producer:\n        {\n          company: \'ABC123\',\n          address: \'123 Street\'\n        }\n    }).select();\n  }\n  where2(){\n    return this.where({ \'producer.company\': \'ABC123\' } ).select();\n  }\n}\n
\n
IN 条件
\n
export default class extends think.model.mongo {\n  where1(){\n    return this.where({ type: { $in: [ \'food\', \'snacks\' ] } }).select();\n  }\n}\n
\n
\n

更多文档请见 https://docs.mongodb.org/manual/reference/operator/query/#query-selectors

\n

model.collection()

\n\n

获取操作当前表的句柄。

\n
export default class extends think.model.mongo {\n  async getIndexes(){\n    let collection = await this.collection();\n    return collection.indexes();\n  }\n}\n
\n

model.aggregate(options)

\n

聚合查询。具体请见 https://docs.mongodb.org/manual/core/aggregation-introduction/

\n

model.mapReduce(map, reduce, out)

\n

mapReduce 操作,具体请见 https://docs.mongodb.org/manual/core/map-reduce/

\n

model.createIndex(indexes, options)

\n\n

创建索引。

\n

model.getIndexes()

\n\n

获取索引。

文章来源:http://www.thinkjs.org


', '', '', '2016-07-17 14:39:00', '76', '0', '0', '0', '18', 'thinkjs,nodejs', '1', '1', '', '8', '0', null, null, null, null); INSERT INTO `li_article` VALUES ('299', 'middleware', '', '

think.middleware.base 类继承自 think.http.base

\n
ES6 方式
\n
export default class extends think.middleware.base {\n  run(){\n\n  }\n}\n
\n
动态创建类的方式
\n
module.exports = think.middleware({\n  run: function(){\n\n  }\n})\n
\n

方法

\n

middleare.run()

\n\n

middleware 对外的方法入口,调用 middleware 时会自动调用该方法。

文章来源:http://www.thinkjs.org

\n


', '', '', '2016-07-17 14:39:59', '178', '0', '0', '0', '18', 'thinkjs,nodejs', '1', '1', '', '8', '0', null, null, null, null); -INSERT INTO `li_article` VALUES ('308', '杭州微易信息科技-互联网金融的新兴力量(15k-25k)', '杭州微易信息科技-互联网金融的新兴力量,\n\n创立于2014年,专注于保险市场垂直细分领域。\n\n公司旗下产品“保险师”自2015年5月上线以来,\n\n以精准的产品定位、便捷的功能体验,拥有了行业领先的用户量,\n\n在AppStore工具类应用下载排名位居前50。', '

公司简介:

杭州微易信息科技-互联网金融的新兴力量,\n

创立于2014年,专注于保险市场垂直细分领域。\n

公司旗下产品“保险师”自2015年5月上线以来,\n

以精准的产品定位、便捷的功能体验,拥有了行业领先的用户量,\n

在AppStore工具类应用下载排名位居前50。\n

团队成员以陈伟星(快的打车创始人)为代表,\n

主要来自阿里、腾讯、中国平安等知名企业,具有丰富的互联网从业经验和行业资源。\n

目前公司已与业内多家知名保险企业及互联网平台达成战略合作,\n

并提供业内具有竞争力的薪酬福利和宽松的工作氛围,Win期待你的加入!\n

网址:http://www.winbaoxian.com/\n

现招高级前端工程师一名。薪资15k-25k。\n

职位描述:\n

1、负责前端开发、前端架构设计与技术性能优化;\n

2、与后端开发工程师配合完成产品开发;\n

职位要求:\n

1、3年或以上web前端工作经验,熟悉W3C标准,有强烈的前端性能优化意识;\n

2、精通各种Web前端技术,XHTML(HTML5)、XML、CSS(3)、JavaScript,熟悉页面架构和布局;\n

3、熟悉原生Javascript,有Node.js开发经验者优先;\n

4、HTML5/CSS3方面有实际的理解和实践经验;\n

5、对工作认真负责,具有良好的沟通能力、分析问题和解决问题的能力;\n

公司地址:杭州市西湖区万塘路252号计量大厦16楼

感兴趣的,可以加qq:97781721


', 'static/upload/pics/7/29/2016Mo2NYNCO2MgN4DmO1dTMrVVB.jpg', '前端汇', '2016-07-29 10:36:09', '581', '1', '1', '0', '15', '', '1', '1', '', '5', '0', null, null, null, null); +INSERT INTO `li_article` VALUES ('308', '杭州微易信息科技-互联网金融的新兴力量(15k-25k)', '杭州微易信息科技-互联网金融的新兴力量,\n\n创立于2014年,专注于保险市场垂直细分领域。\n\n公司旗下产品“保险师”自2015年5月上线以来,\n\n以精准的产品定位、便捷的功能体验,拥有了行业领先的用户量,\n\n在AppStore工具类应用下载排名位居前50。', '

公司简介:

杭州微易信息科技-互联网金融的新兴力量,\n

创立于2014年,专注于保险市场垂直细分领域。\n

公司旗下产品“保险师”自2015年5月上线以来,\n

以精准的产品定位、便捷的功能体验,拥有了行业领先的用户量,\n

在AppStore工具类应用下载排名位居前50。\n

团队成员以陈伟星(快的打车创始人)为代表,\n

主要来自阿里、腾讯、中国平安等知名企业,具有丰富的互联网从业经验和行业资源。\n

目前公司已与业内多家知名保险企业及互联网平台达成战略合作,\n

并提供业内具有竞争力的薪酬福利和宽松的工作氛围,Win期待你的加入!\n

网址:http://www.winbaoxian.com/\n

现招高级前端工程师一名。薪资15k-25k。\n

职位描述:\n

1、负责前端开发、前端架构设计与技术性能优化;\n

2、与后端开发工程师配合完成产品开发;\n

职位要求:\n

1、3年或以上web前端工作经验,熟悉W3C标准,有强烈的前端性能优化意识;\n

2、精通各种Web前端技术,XHTML(HTML5)、XML、CSS(3)、JavaScript,熟悉页面架构和布局;\n

3、熟悉原生Javascript,有Node.js开发经验者优先;\n

4、HTML5/CSS3方面有实际的理解和实践经验;\n

5、对工作认真负责,具有良好的沟通能力、分析问题和解决问题的能力;\n

公司地址:杭州市西湖区万塘路252号计量大厦16楼

感兴趣的,可以加qq:97781721


', 'static/upload/pics/7/29/2016Mo2NYNCO2MgN4DmO1dTMrVVB.jpg', '前端汇', '2016-07-29 10:36:09', '583', '1', '1', '0', '15', '', '1', '1', '', '5', '0', null, null, null, null); INSERT INTO `li_article` VALUES ('309', '【杭州】OSC源创会第51期报名开始', '时间:2016-08-13 14:00\n地点:杭州 拱墅区莫干山路188-200号之江饭店\n费用:现场缴费¥50/人,女士免费,积分50以上,开源软件作者和学生(出示学生证)均免费,提供饮料和小食', '
时间:2016-08-13 14:00
地点:杭州 拱墅区莫干山路188-200号之江饭店
费用:现场缴费¥50/人,女士免费,积分50以上,开源软件作者和学生(出示学生证)均免费,提供饮料和小食
类型: 源创会
引用标识: hz784
发起人:Alaise
活动链接:http://www.oschina.net/question/2686220_2187784

活动介绍:

邀请超过3个好友报名并确认,你将可以免费参加此次源创会 邀请链接:http://city.oschina.net/hangzhou/event/2187784?inviter=

都说上有天堂,下有杭州,OSC源创会也不能抵挡的美丽,这已经是我们第五次来到杭州,与各位OSCer共约线下,本次八月杭州站我们依旧和去年一样在之江饭店,等你来赴约。

本期主题有:

1.云时代的企业运维转型

内容简介:随着云的概念逐步被接受,很多企业开始尝试公有云,这给传统运维模式带来了一系列的变化,例如跨云的管理、虚拟化及容器化带来的操作单元暴增、运维职能被部分新技术所取代,运维如何探索职能边界的延伸、运维如何利用云及大数据技术帮助业务实现精细化运营。

分享嘉宾:党受辉,腾讯游戏蓝鲸产品中心总监,曾就职于东软集团,为能源行业定制信息化体系。加入腾讯后负责过游戏运维团队管理。2012年负责腾讯游戏技术支撑体系(蓝鲸)的设计、建设和运营。

2.Freezer—OpenStack Backup/Restore as a Service

内容简介:在OpenStack的使用过程中,你是不是遇到过这样的问题,虚拟机突然不可用或者被误删! 云硬盘突然无法使用或不小心被删除!对此,数据备份才是关键所在,其重要性不言而喻。 本次内容主要分享 Freezer 作为OpenStack的一个Official 项目,在OpenStack开源云环境中,针对数据备份存在的痛点,通过Freezer构建备份机制,以及进行有效的配置对虚拟机、云硬盘数据进行全量以及增量的数据备份。

分享嘉宾:杨亚鹏,现就职于九州云99Cloud,从事OpenStack相关工作两年。现主要从事OpenStack 备份相关工作。

3.数据可视化与大数据的结合

内容简介:分享数据可视化与大数据结合的相关技术点及经验。

分享嘉宾:乔刚,高德开放平台资深前端开发工程师,从事SPA应用开发,对此有丰富的经验。目前主要负责地图数据可视化相关的开发工作。

4.透过 TheDAO 众筹安全事件看区块链安全问题

内容简介:2016年6月17日,TheDAO(目前人类历史上最大规模的众筹项目)发生了区块链领域重大的安全事件,期间剧情跌宕起伏,注定会被载入区块链安全史册。由于其编写的智能合约存在着重大缺陷,区块链业界最大的众筹项目TheDAO(被攻击前 拥有1亿美元左右资产)遭到攻击,目前已导致300多万以太币资产被分离出去。本次分享将为大家介绍 TheDAO 事件的始末,以及区块链和智能合约的安全性方面的探讨。

分享嘉宾:吕国宁,资深程序员 & 区块链技术专家,杭州融识科技合伙人,EthFans 以太坊爱好者社区运营负责人,前云币交易所 CTO,国内最大的线上技术社区 RubyChina 的创始人,管理员,RubyConfChina 大会组织者,技术音频播客 Teahour.FM 主播。

5.跨平台移动开发工具 Weex 开源之路

内容简介:介绍 Weex 从诞生到开源的心路历程,希望给所有对开源有兴趣的同学一些帮助和启发。

分享嘉宾:赵锦江,花名勾股,就职于阿里巴巴淘宝,h5slides 作者,Weex 团队一员。

本次杭州站源创会礼品之丰厚可谓超乎想象,除了经典的大型鼠标垫、开源内裤、扑克,还有樱桃机械键盘等着你哟!

本次源创会需要摄影、录像及会务协助志愿者,有意愿的小伙伴请站内私信@penny-osc ,会后还将有精美礼品相送呦~

请大家下载 OSC 客户端用于现场扫描二维码签到和抽奖:http://www.oschina.net/app

为了方便大家线上交流,本次源创会提供微信群,报名的小伙伴可扫描以下二维码,备注杭州源创会,添加好友,拉你入群~

\"171848_v9EO_2686220\"

活动详情:http://city.oschina.net/hangzhou/event/2187784


', 'static/upload/pics/8/6/2016sS0SWY9BOhOiFqyMDzDpTmLP.png', '前端汇', '2016-08-16 10:10:22', '283', '0', '0', '0', '14', '', '1', '1', '', '6', '0', null, null, null, null); -- ---------------------------- @@ -196,7 +196,7 @@ CREATE TABLE `li_comment` ( `createtime` datetime DEFAULT NULL, `pic` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '头像', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of li_comment @@ -346,7 +346,7 @@ CREATE TABLE `li_manage_role` ( `pid` text, `permission` longtext CHARACTER SET utf8 COLLATE utf8_bin, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of li_manage_role @@ -507,11 +507,11 @@ CREATE TABLE `li_topic` ( -- ---------------------------- -- Records of li_topic -- ---------------------------- -INSERT INTO `li_topic` VALUES ('31', 'ask', 0x3C703EE59CA8E5819AE799BBE99986E9A1B5E79A84E9AA8CE8AF81E7A081E58A9FE883BDEFBC8CE4B98BE5898DE6B2A1E69C89E794A86E6F6465E5819AE8BF87EFBC8CE69C89E4BB80E4B988E58A9EE6B395E4B988EFBC9F3C2F703E, 'Dean', '2016-09-02 15:52:44', '新手求解,thinkjs如何生成随机验证码,并返回至前台?', '193', '2016-09-02 16:30:43', 'livisky', 'common/images/pic/avatar_7.jpg', '4', '1'); -INSERT INTO `li_topic` VALUES ('32', 'thinkjs', 0x3C703EE4BDBFE794A8E58886E7BB84E69FA5E8AFA2E5B9B6E5B8A6E69C89E58886E9A1B5E69FA5E8AFA2EFBC8CE7BB93E69E9CE5BE97E588B0E79A84E7BB93E69E9CE99B86E4B8ADE58886E9A1B5E4BFA1E681AFE698AFE99499E8AFAFE79A84EFBC8CE8AFB7E997AEE698AFE4B88DE694AFE68C81E58886E7BB84E5908EE59CA8E58886E9A1B5E69FA5E8AFA2E4B988EFBC8CE8BF98E698AFE58699E6B395E79A84E997AEE9A298EFBC9FE4BBA5E4B88BE698AFE4BBA3E7A081E5928CE7BB93E69E9CE688AAE59BBEEFBC9A3C696D67207372633D222F7374617469632F75706C6F61642F706963732F392F392F3230313663514838696A714653344842395A315350736130617441742E706E672220616C743D225151E688AAE59BBE323031363039303931303432343622207374796C653D226D61782D77696474683A20313030253B223E3C696D67207372633D222F7374617469632F75706C6F61642F706963732F392F392F32303136394947696A674F41717A527A6C6A614A474536714D427A622E706E672220616C743D22E7BB93E69E9C22207374796C653D226D61782D77696474683A20313030253B223E3C2F703E3C703E3C62723E3C2F703E, 'bella', '2016-09-09 10:45:05', '分页问题', '83', '2016-09-12 10:25:32', 'livichen', 'common/images/pic/avatar_2.jpg', '1', '1'); -INSERT INTO `li_topic` VALUES ('33', 'liblog', 0x3C703EE6B7BBE58AA0E69687E7ABA0E58685E5AEB9E8B083E794A8E6A087E7ADBEEFBC8CE9809AE8BF87E6A087E7ADBEE9858DE7BDAEE58DB3E58FAFE5AE9EE78EB0E58685E5AEB9E79A84E8AFBBE58F963C2F703E3C703EE5A682EFBC9AE88EB7E58F96E7BDAEE9A1B6E79A8436E69DA1E69687E7ABA0E58897E8A1A83C2F703E3C707265207374796C653D226D61782D77696474683A20313030253B223E3C636F646520636C6173733D226A61766173637269707420686C6A732220636F64656D61726B3D2231223E7B252061727469636C652064617461203D203C7370616E20636C6173733D22686C6A732D737472696E67223E22746F704C697374223C2F7370616E3E2C6C696D69743D203C7370616E20636C6173733D22686C6A732D737472696E67223E2236223C2F7370616E3E2C666C61673D3C7370616E20636C6173733D22686C6A732D737472696E67223E22746F746F70223C2F7370616E3E257D3C2F636F64653E3C2F7072653E3C703EE784B6E5908EE5868DE5BEAAE78EAFE587BAE69DA53C2F703E3C707265207374796C653D226D61782D77696474683A20313030253B223E3C636F646520636C6173733D226A61766173637269707420686C6A732220636F64656D61726B3D2231223E7B252061727469636C652064617461203D203C7370616E20636C6173733D22686C6A732D737472696E67223E22746F704C697374223C2F7370616E3E2C6C696D69743D203C7370616E20636C6173733D22686C6A732D737472696E67223E2236223C2F7370616E3E2C666C61673D3C7370616E20636C6173733D22686C6A732D737472696E67223E22746F746F70223C2F7370616E3E257D0A2020202020207B25203C7370616E20636C6173733D22686C6A732D6B6579776F7264223E666F723C2F7370616E3E206974656D203C7370616E20636C6173733D22686C6A732D6B6579776F7264223E696E3C2F7370616E3E20746F704C69737420257D0A202020202020266C743B646976203C7370616E20636C6173733D22686C6A732D636C617373223E3C7370616E20636C6173733D22686C6A732D6B6579776F7264223E636C6173733C2F7370616E3E3C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22626C6F6773223C2F7370616E3E2667743B0A2020202020202020203C7370616E20636C6173733D22786D6C223E3C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E6669677572653C2F7370616E3E2667743B3C2F7370616E3E0A2020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E687265663C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E222F706167652F7B7B6974656D2E6169647D7D2E68746D6C223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7461726765743C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E225F626C616E6B223C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E696D673C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7372633C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E227B7B5F7765622E75726C7D7D7B7B277374617469632F636F6D6D6F6E2F696D616765732F636F6D6D6F6E2F64656661756C742E6A706727206966206974656D2E70696375726C3D3D272720656C7365206974656D2E70696375726C207D7D223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7469746C653C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E227B7B6974656D2E7469746C657D7D223C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E6669677572653C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E756C3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E2261727469636C65756C223C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E68333C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E687265663C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E222F706167652F7B7B6974656D2E6169647D7D2E68746D6C223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7461726765743C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E225F626C616E6B223C2F7370616E3E2667743B3C2F7370616E3E7B7B6974656D2E7469746C657D7D3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E68333C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E703C2F7370616E3E2667743B3C2F7370616E3E7B7B6974656D2E61627374726163747D7D3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E703C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22617574686F72223C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E226C6D20665F6C223C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E687265663C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E226A6176617363726970743A766F69642830293B223C2F7370616E3E2667743B3C2F7370616E3E7B7B6974656D2E7461676E616D657D7D3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E2667743B3C2F7370616E3E0A2020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3E0A2020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E226474696D6520665F6C223C2F7370616E3E2667743B3C2F7370616E3E7B7B7468696E6B2E6461746574696D65286974656D2E63726561746574696D652C22595959592D4D4D2D444422297D7D3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22617574686F72223C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020202020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22766965776E756D20665F72223C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020E6B58FE8A788EFBC887B7B6974656D2E766965777D7DEFBC893C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3E0A2020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E2270696E676C20665F72223C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020E8AF84E8AEBAEFBC883C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E69643C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22736F7572636549643A3A7B7B6974656D2E6169647D7D223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E2263795F636D745F636F756E74223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7374796C653C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E226D617267696E3A203070783B70616464696E673A20307078223C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3EEFBC890A2020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E756C3C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E2667743B3C2F7370616E3E3C2F7370616E3E0A207B2520656E64666F7220257D3C2F636F64653E3C2F7072653E3C703EE585B6E4BB96E6A087E7ADBEE5A682EFBC9A3C2F703E3C707265207374796C653D226D61782D77696474683A20313030253B223E3C636F646520636C6173733D226A61766173637269707420686C6A732220636F64656D61726B3D2231223EE7AB99E995BFE68EA8E88D900A0A7B252061727469636C652064617461203D203C7370616E20636C6173733D22686C6A732D737472696E67223E22746F7265636F6D4C697374223C2F7370616E3E2C6C696D69743D203C7370616E20636C6173733D22686C6A732D737472696E67223E2236223C2F7370616E3E2C666C61673D3C7370616E20636C6173733D22686C6A732D737472696E67223E22746F7265636F6D223C2F7370616E3E257D0A0AE59BBEE69687E68EA8E88D900A0A7B252061727469636C652064617461203D203C7370616E20636C6173733D22686C6A732D737472696E67223E227069637265636F6D4C697374223C2F7370616E3E2C6C696D69743D203C7370616E20636C6173733D22686C6A732D737472696E67223E2236223C2F7370616E3E2C666C61673D3C7370616E20636C6173733D22686C6A732D737472696E67223E22746F7069637265636F6D223C2F7370616E3E257D3C2F636F64653E3C2F7072653E3C703E3C623E6C69626C6F67322E30E5B086E4BA8E39E69C88E5BA95E69BB4E696B0E588B067697468756220E5B9B6E5BC80E6BA90EFBC8C3C2F623E3C2F703E3C703E3C623EE6ACA2E8BF8EE585B3E6B3A8EFBC813C2F623E3C2F703E3C703E3C62723E3C2F703E, 'livisky', '2016-09-14 15:38:28', 'liblog v2.0功能更新(2016/9/14)', '49', '2016-09-14 15:38:28', 'livisky', 'common/images/pic/avatar_13.jpg', '0', '1'); -INSERT INTO `li_topic` VALUES ('34', 'liblog', 0x3C703EE4BFAEE694B9E6B3A8E5868CE58F8AE799BBE99986E79A84E9AA8CE8AF81E7A081E9AA8CE8AF81E696B9E5BC8F3C2F703E3C703EE58E9FE59BA0E69C8933E782B9EFBC9A3C2F703E3C703E31E3808177696E646F7773E4B88BEFBC8CE58E9FE585886C69626C6F67E79A84E9AA8CE8AF81E7A081E6A8A1E59D973C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E63636170E5AE89E8A385E88081E698AFE587BAE997AEE9A298E68896E4B88DE5AE8CE695B4286C696E7578E7AD89E585B6E4BB96E6938DE4BD9CE7B3BBE7BB9FE58FAFE4BBA5E5AE8CE695B4E5AE89E8A38529EFBC8CE88083E89991E983A8E5888677696E646F77E794A8E688B7E79A84E5AE89E8A385E58F8AE6B58BE8AF95E380823C2F7370616E3E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E32E38081E9AA8CE8AF81E7A081E5AD97E6AF8DE58AA0E695B0E5AD97E6A8A1E5BC8FE8BE83E4B8BAE4BCA0E7BB9FEFBC8CE6B2A1E69C89E59BBEE78987E68B96E58AA8E7AE80E58D95E38081E696B9E4BEBFE38081E7BE8EE8A7823C2F7370616E3E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E33E38081E58E9FE58588E79A84E6A8A1E59D97E6B2A1E69C89E58F8AE697B6E58F8AE995BFE69C9FE7BBB4E68AA43C2F7370616E3E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223EE78EB0E59CA8E79A84E9AA8CE8AF81E7A081E4B8BAE69E81E9AA8C67656574657374E6A8A1E59D97EFBC8CE8AFA6E8A781E5AE98E7BD91EFBC9A687474703A2F2F3C2F7370616E3E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E7777772E676565746573742E636F6D3C2F7370616E3E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223EE58887E68DA2E5908EE79A84E9AA8CE8AF81E7A081E696B9E5BC8FE69588E69E9CE5A682E4B88BE59BBEEFBC9A3C2F7370616E3E3C2F703E3C703E3C696D67207372633D222F7374617469632F75706C6F61642F706963732F392F31382F3230313666394241517A77577A52637573514E4F63363941424568742E706E672220616C743D223122207374796C653D226D61782D77696474683A313030253B223E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E3C62723E3C2F7370616E3E3C2F703E3C703EE782B9E587BBE5B9B6E68B96E58AA8E68C89E992AEEFBC8CE69588E69E9CE5A682E4B88BEFBC9A3C2F703E3C703E3C696D67207372633D222F7374617469632F75706C6F61642F706963732F392F31382F32303136324C553036544B6F505150476B736F367869504F6D424B342E706E672220616C743D223222207374796C653D226D61782D77696474683A313030253B223E3C62723E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223EE69E81E9AA8CE99C80E8A681E5AE98E7BD91E6B3A8E5868CE5B9B6E88EB7E58F966964E5928C6B6579EFBC8CE8BF9BE8A18CE9858DE7BDAEE380823C2F7370616E3E3C62723E3C2F703E3C703EE585B7E4BD93E69599E7A88BE5908EE7BBADE69BB4E696B0E380823C2F703E3C703E3C623E6C69626C6F67322E30E5B086E4BA8E39E69C88E5BA95E69BB4E696B0E588B067697468756220E5B9B6E5BC80E6BA90EFBC8C3C2F623E3C2F703E3C703E3C2F703E3C703E3C623EE6ACA2E8BF8EE585B3E6B3A8EFBC813C2F623E3C2F703E3C703E3C62723E3C2F703E, 'livichen', '2016-09-18 17:47:47', 'liblog v2.0功能更新(2016/9/18)', '22', '2016-09-18 18:52:27', 'liweifeng', 'common/images/pic/avatar_11.jpg', '2', '1'); -INSERT INTO `li_topic` VALUES ('35', 'share', 0x3C703E676974E68F90E4BAA4E697B6E587BAE78EB022596F7572266E6273703B6C6F63616C266E6273703B6368616E676573266E6273703B746F266E6273703B746865266E6273703B666F6C6C6F77696E67266E6273703B66696C6573266E6273703B776F756C64266E6273703B6265266E6273703B6F7665727772697474656E266E6273703B6279266E6273703B6D6572676522EFBC8CE698AFE59BA0E4B8BA6769742070756C6CE79A84E794B5E88491E69CACE59CB0E4BFAEE694B9E4BA86EFBC8CE8B79F676974E79A84E5BA93E9878CE4B88DE4B880E887B4EFBC8CE68980E4BBA5E68F90E7A4BAE99499E8AFAFE4BFA1E681AFE380823C2F703E3C703E3C62723E3C2F703E, 'admin', '2016-09-19 10:22:07', 'git提交时出现\"Your local changes to the following files would be overwritten by merge\"', '4', '2016-09-19 10:22:07', 'admin', 'common/images/pic/avatar_7.jpg', '0', '1'); +INSERT INTO `li_topic` VALUES ('31', 'ask', 0x3C703EE59CA8E5819AE799BBE99986E9A1B5E79A84E9AA8CE8AF81E7A081E58A9FE883BDEFBC8CE4B98BE5898DE6B2A1E69C89E794A86E6F6465E5819AE8BF87EFBC8CE69C89E4BB80E4B988E58A9EE6B395E4B988EFBC9F3C2F703E, 'livi', '2016-09-02 15:52:44', '新手求解,thinkjs如何生成随机验证码,并返回至前台?', '193', '2016-09-02 16:30:43', 'livisky', 'common/images/pic/avatar_7.jpg', '4', '1'); +INSERT INTO `li_topic` VALUES ('32', 'thinkjs', 0x3C703EE4BDBFE794A8E58886E7BB84E69FA5E8AFA2E5B9B6E5B8A6E69C89E58886E9A1B5E69FA5E8AFA2EFBC8CE7BB93E69E9CE5BE97E588B0E79A84E7BB93E69E9CE99B86E4B8ADE58886E9A1B5E4BFA1E681AFE698AFE99499E8AFAFE79A84EFBC8CE8AFB7E997AEE698AFE4B88DE694AFE68C81E58886E7BB84E5908EE59CA8E58886E9A1B5E69FA5E8AFA2E4B988EFBC8CE8BF98E698AFE58699E6B395E79A84E997AEE9A298EFBC9FE4BBA5E4B88BE698AFE4BBA3E7A081E5928CE7BB93E69E9CE688AAE59BBEEFBC9A3C696D67207372633D222F7374617469632F75706C6F61642F706963732F392F392F3230313663514838696A714653344842395A315350736130617441742E706E672220616C743D225151E688AAE59BBE323031363039303931303432343622207374796C653D226D61782D77696474683A20313030253B223E3C696D67207372633D222F7374617469632F75706C6F61642F706963732F392F392F32303136394947696A674F41717A527A6C6A614A474536714D427A622E706E672220616C743D22E7BB93E69E9C22207374796C653D226D61782D77696474683A20313030253B223E3C2F703E3C703E3C62723E3C2F703E, 'livi', '2016-09-09 10:45:05', '分页问题', '83', '2016-09-12 10:25:32', 'livi', 'common/images/pic/avatar_2.jpg', '1', '1'); +INSERT INTO `li_topic` VALUES ('33', 'liblog', 0x3C703EE6B7BBE58AA0E69687E7ABA0E58685E5AEB9E8B083E794A8E6A087E7ADBEEFBC8CE9809AE8BF87E6A087E7ADBEE9858DE7BDAEE58DB3E58FAFE5AE9EE78EB0E58685E5AEB9E79A84E8AFBBE58F963C2F703E3C703EE5A682EFBC9AE88EB7E58F96E7BDAEE9A1B6E79A8436E69DA1E69687E7ABA0E58897E8A1A83C2F703E3C707265207374796C653D226D61782D77696474683A20313030253B223E3C636F646520636C6173733D226A61766173637269707420686C6A732220636F64656D61726B3D2231223E7B252061727469636C652064617461203D203C7370616E20636C6173733D22686C6A732D737472696E67223E22746F704C697374223C2F7370616E3E2C6C696D69743D203C7370616E20636C6173733D22686C6A732D737472696E67223E2236223C2F7370616E3E2C666C61673D3C7370616E20636C6173733D22686C6A732D737472696E67223E22746F746F70223C2F7370616E3E257D3C2F636F64653E3C2F7072653E3C703EE784B6E5908EE5868DE5BEAAE78EAFE587BAE69DA53C2F703E3C707265207374796C653D226D61782D77696474683A20313030253B223E3C636F646520636C6173733D226A61766173637269707420686C6A732220636F64656D61726B3D2231223E7B252061727469636C652064617461203D203C7370616E20636C6173733D22686C6A732D737472696E67223E22746F704C697374223C2F7370616E3E2C6C696D69743D203C7370616E20636C6173733D22686C6A732D737472696E67223E2236223C2F7370616E3E2C666C61673D3C7370616E20636C6173733D22686C6A732D737472696E67223E22746F746F70223C2F7370616E3E257D0A2020202020207B25203C7370616E20636C6173733D22686C6A732D6B6579776F7264223E666F723C2F7370616E3E206974656D203C7370616E20636C6173733D22686C6A732D6B6579776F7264223E696E3C2F7370616E3E20746F704C69737420257D0A202020202020266C743B646976203C7370616E20636C6173733D22686C6A732D636C617373223E3C7370616E20636C6173733D22686C6A732D6B6579776F7264223E636C6173733C2F7370616E3E3C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22626C6F6773223C2F7370616E3E2667743B0A2020202020202020203C7370616E20636C6173733D22786D6C223E3C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E6669677572653C2F7370616E3E2667743B3C2F7370616E3E0A2020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E687265663C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E222F706167652F7B7B6974656D2E6169647D7D2E68746D6C223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7461726765743C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E225F626C616E6B223C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E696D673C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7372633C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E227B7B5F7765622E75726C7D7D7B7B277374617469632F636F6D6D6F6E2F696D616765732F636F6D6D6F6E2F64656661756C742E6A706727206966206974656D2E70696375726C3D3D272720656C7365206974656D2E70696375726C207D7D223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7469746C653C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E227B7B6974656D2E7469746C657D7D223C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E6669677572653C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E756C3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E2261727469636C65756C223C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E68333C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E687265663C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E222F706167652F7B7B6974656D2E6169647D7D2E68746D6C223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7461726765743C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E225F626C616E6B223C2F7370616E3E2667743B3C2F7370616E3E7B7B6974656D2E7469746C657D7D3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E68333C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E703C2F7370616E3E2667743B3C2F7370616E3E7B7B6974656D2E61627374726163747D7D3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E703C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22617574686F72223C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E226C6D20665F6C223C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E687265663C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E226A6176617363726970743A766F69642830293B223C2F7370616E3E2667743B3C2F7370616E3E7B7B6974656D2E7461676E616D657D7D3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E613C2F7370616E3E2667743B3C2F7370616E3E0A2020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3E0A2020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E226474696D6520665F6C223C2F7370616E3E2667743B3C2F7370616E3E7B7B7468696E6B2E6461746574696D65286974656D2E63726561746574696D652C22595959592D4D4D2D444422297D7D3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22617574686F72223C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020202020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22766965776E756D20665F72223C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020E6B58FE8A788EFBC887B7B6974656D2E766965777D7DEFBC893C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3E0A2020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E2270696E676C20665F72223C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020E8AF84E8AEBAEFBC883C7370616E20636C6173733D22686C6A732D746167223E266C743B3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E69643C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E22736F7572636549643A3A7B7B6974656D2E6169647D7D223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E636C6173733C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E2263795F636D745F636F756E74223C2F7370616E3E203C7370616E20636C6173733D22686C6A732D61747472223E7374796C653C2F7370616E3E3D3C7370616E20636C6173733D22686C6A732D737472696E67223E226D617267696E3A203070783B70616464696E673A20307078223C2F7370616E3E2667743B3C2F7370616E3E3C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3EEFBC890A2020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E7370616E3C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020202020202020202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E2667743B3C2F7370616E3E0A202020202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E756C3C2F7370616E3E2667743B3C2F7370616E3E0A20202020202020203C7370616E20636C6173733D22686C6A732D746167223E266C743B2F3C7370616E20636C6173733D22686C6A732D6E616D65223E6469763C2F7370616E3E2667743B3C2F7370616E3E3C2F7370616E3E0A207B2520656E64666F7220257D3C2F636F64653E3C2F7072653E3C703EE585B6E4BB96E6A087E7ADBEE5A682EFBC9A3C2F703E3C707265207374796C653D226D61782D77696474683A20313030253B223E3C636F646520636C6173733D226A61766173637269707420686C6A732220636F64656D61726B3D2231223EE7AB99E995BFE68EA8E88D900A0A7B252061727469636C652064617461203D203C7370616E20636C6173733D22686C6A732D737472696E67223E22746F7265636F6D4C697374223C2F7370616E3E2C6C696D69743D203C7370616E20636C6173733D22686C6A732D737472696E67223E2236223C2F7370616E3E2C666C61673D3C7370616E20636C6173733D22686C6A732D737472696E67223E22746F7265636F6D223C2F7370616E3E257D0A0AE59BBEE69687E68EA8E88D900A0A7B252061727469636C652064617461203D203C7370616E20636C6173733D22686C6A732D737472696E67223E227069637265636F6D4C697374223C2F7370616E3E2C6C696D69743D203C7370616E20636C6173733D22686C6A732D737472696E67223E2236223C2F7370616E3E2C666C61673D3C7370616E20636C6173733D22686C6A732D737472696E67223E22746F7069637265636F6D223C2F7370616E3E257D3C2F636F64653E3C2F7072653E3C703E3C623E6C69626C6F67322E30E5B086E4BA8E39E69C88E5BA95E69BB4E696B0E588B067697468756220E5B9B6E5BC80E6BA90EFBC8C3C2F623E3C2F703E3C703E3C623EE6ACA2E8BF8EE585B3E6B3A8EFBC813C2F623E3C2F703E3C703E3C62723E3C2F703E, 'livi', '2016-09-14 15:38:28', 'liblog v2.0功能更新(2016/9/14)', '49', '2016-09-14 15:38:28', 'livisky', 'common/images/pic/avatar_13.jpg', '0', '1'); +INSERT INTO `li_topic` VALUES ('34', 'liblog', 0x3C703EE4BFAEE694B9E6B3A8E5868CE58F8AE799BBE99986E79A84E9AA8CE8AF81E7A081E9AA8CE8AF81E696B9E5BC8F3C2F703E3C703EE58E9FE59BA0E69C8933E782B9EFBC9A3C2F703E3C703E31E3808177696E646F7773E4B88BEFBC8CE58E9FE585886C69626C6F67E79A84E9AA8CE8AF81E7A081E6A8A1E59D973C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E63636170E5AE89E8A385E88081E698AFE587BAE997AEE9A298E68896E4B88DE5AE8CE695B4286C696E7578E7AD89E585B6E4BB96E6938DE4BD9CE7B3BBE7BB9FE58FAFE4BBA5E5AE8CE695B4E5AE89E8A38529EFBC8CE88083E89991E983A8E5888677696E646F77E794A8E688B7E79A84E5AE89E8A385E58F8AE6B58BE8AF95E380823C2F7370616E3E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E32E38081E9AA8CE8AF81E7A081E5AD97E6AF8DE58AA0E695B0E5AD97E6A8A1E5BC8FE8BE83E4B8BAE4BCA0E7BB9FEFBC8CE6B2A1E69C89E59BBEE78987E68B96E58AA8E7AE80E58D95E38081E696B9E4BEBFE38081E7BE8EE8A7823C2F7370616E3E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E33E38081E58E9FE58588E79A84E6A8A1E59D97E6B2A1E69C89E58F8AE697B6E58F8AE995BFE69C9FE7BBB4E68AA43C2F7370616E3E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223EE78EB0E59CA8E79A84E9AA8CE8AF81E7A081E4B8BAE69E81E9AA8C67656574657374E6A8A1E59D97EFBC8CE8AFA6E8A781E5AE98E7BD91EFBC9A687474703A2F2F3C2F7370616E3E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E7777772E676565746573742E636F6D3C2F7370616E3E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223EE58887E68DA2E5908EE79A84E9AA8CE8AF81E7A081E696B9E5BC8FE69588E69E9CE5A682E4B88BE59BBEEFBC9A3C2F7370616E3E3C2F703E3C703E3C696D67207372633D222F7374617469632F75706C6F61642F706963732F392F31382F3230313666394241517A77577A52637573514E4F63363941424568742E706E672220616C743D223122207374796C653D226D61782D77696474683A313030253B223E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223E3C62723E3C2F7370616E3E3C2F703E3C703EE782B9E587BBE5B9B6E68B96E58AA8E68C89E992AEEFBC8CE69588E69E9CE5A682E4B88BEFBC9A3C2F703E3C703E3C696D67207372633D222F7374617469632F75706C6F61642F706963732F392F31382F32303136324C553036544B6F505150476B736F367869504F6D424B342E706E672220616C743D223222207374796C653D226D61782D77696474683A313030253B223E3C62723E3C2F703E3C703E3C7370616E207374796C653D226C696E652D6865696768743A20312E383B223EE69E81E9AA8CE99C80E8A681E5AE98E7BD91E6B3A8E5868CE5B9B6E88EB7E58F966964E5928C6B6579EFBC8CE8BF9BE8A18CE9858DE7BDAEE380823C2F7370616E3E3C62723E3C2F703E3C703EE585B7E4BD93E69599E7A88BE5908EE7BBADE69BB4E696B0E380823C2F703E3C703E3C623E6C69626C6F67322E30E5B086E4BA8E39E69C88E5BA95E69BB4E696B0E588B067697468756220E5B9B6E5BC80E6BA90EFBC8C3C2F623E3C2F703E3C703E3C2F703E3C703E3C623EE6ACA2E8BF8EE585B3E6B3A8EFBC813C2F623E3C2F703E3C703E3C62723E3C2F703E, 'livi', '2016-09-18 17:47:47', 'liblog v2.0功能更新(2016/9/18)', '22', '2016-09-18 18:52:27', 'admin', 'common/images/pic/avatar_11.jpg', '2', '1'); +INSERT INTO `li_topic` VALUES ('35', 'share', 0x3C703E676974E68F90E4BAA4E697B6E587BAE78EB022596F7572266E6273703B6C6F63616C266E6273703B6368616E676573266E6273703B746F266E6273703B746865266E6273703B666F6C6C6F77696E67266E6273703B66696C6573266E6273703B776F756C64266E6273703B6265266E6273703B6F7665727772697474656E266E6273703B6279266E6273703B6D6572676522EFBC8CE698AFE59BA0E4B8BA6769742070756C6CE79A84E794B5E88491E69CACE59CB0E4BFAEE694B9E4BA86EFBC8CE8B79F676974E79A84E5BA93E9878CE4B88DE4B880E887B4EFBC8CE68980E4BBA5E68F90E7A4BAE99499E8AFAFE4BFA1E681AFE380823C2F703E3C703E3C62723E3C2F703E, 'admin', '2016-09-19 10:22:07', 'git提交时出现\"Your local changes to the following files would be overwritten by merge\"', '9', '2016-09-19 10:22:07', 'admin', 'common/images/pic/avatar_7.jpg', '0', '1'); -- ---------------------------- -- Table structure for li_topic_comment @@ -603,12 +603,13 @@ CREATE TABLE `li_user` ( `vip` int(11) DEFAULT '0' COMMENT 'vip', `isverify` int(11) DEFAULT '0' COMMENT '是否已验证邮箱', PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=85 DEFAULT CHARSET=utf8; +) ENGINE=MyISAM AUTO_INCREMENT=86 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of li_user -- ---------------------------- -INSERT INTO `li_user` VALUES ('56', 'admin', 'admin', 'e10adc3949ba59abbe56e057f20f883e', 'admin@jsout.com', '1', null, 'common/images/pic/avatar_7.jpg', 'site', '15', null, '2016-08-22 14:44:32', '1', '0', '0'); +INSERT INTO `li_user` VALUES ('56', 'admin', 'admin', 'fcea920f7412b5da7be0cf42b8c93759', 'admin@jsout.com', '1', null, 'common/images/pic/avatar_7.jpg', 'site', '15', null, '2016-08-22 14:44:32', '1', '0', '0'); +INSERT INTO `li_user` VALUES ('85', 'livi', 'livi', null, 'livisky@163.com', '4', null, '', 'site', '10', null, null, '1', '0', '0'); -- ---------------------------- -- Table structure for li_user_collect diff --git a/package.json b/package.json index cf3a1de..7ed891d 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,46 @@ { - "name": "thinkjs-application", - "description": "application created by thinkjs", - "version": "1.0.0", - "scripts": { - "start": "node www/development.js", - "compile": "babel --presets es2015-loose,stage-1 --plugins transform-runtime src/ --out-dir app/ --retain-lines", - "watch-compile": "node -e \"console.log(' no longer need, use command direct.');console.log();\"", - "watch": "npm run watch-compile" - }, - "dependencies": { - "babel-runtime": "6.x.x", - "cheerio": "^0.22.0", - "geetest": "^3.0.2", - "marked": "^0.3.5", - "nodemailer": "^0.7.1", - "nunjucks": "^2.2.0", - "pm2": "^1.1.2", - "ali-oss":"4.5.0", - "co":"4.5.0", - "request": "^2.74.0", - "source-map-support": "^0.4.0", - "thinkjs": "2.2.12" - }, - "devDependencies": { - "babel-cli": "6.x.x", - "babel-preset-es2015-loose": "6.x.x", - "babel-preset-stage-1": "6.x.x", - "babel-plugin-transform-runtime": "6.x.x", - "babel-core": "6.x.x" - }, - "repository": "", - "license": "MIT" -} + "name": "thinkjs-application", + "description": "application created by thinkjs", + "version": "1.0.0", + "scripts": { + "start": "node www/development.js", + "dev": "node www/development.js", + "app": "node www/production.js", + "compress": "gulp default", + "compile": "babel --presets es2015-loose,stage-1 --plugins transform-runtime src/ --out-dir app/ --retain-lines", + "watch-compile": "node -e \"console.log(' no longer need, use command direct.');console.log();\"", + "watch": "npm run watch-compile" + }, + "dependencies": { + "ali-oss": "4.5.0", + "babel-runtime": "6.x.x", + "cheerio": "^0.22.0", + "co": "4.5.0", + "geetest": "^3.0.2", + "marked": "^0.3.5", + "nodemailer": "^0.7.1", + "nunjucks": "^2.2.0", + "pm2": "^1.1.2", + "request": "^2.74.0", + "source-map-support": "^0.4.0", + "thinkjs": "2.2.12", + "transfer-webpack-plugin": "^0.1.4" + }, + "devDependencies": { + "babel-cli": "6.x.x", + "babel-core": "6.x.x", + "babel-plugin-transform-runtime": "6.x.x", + "babel-preset-es2015-loose": "6.x.x", + "babel-preset-stage-1": "6.x.x", + "gulp": "^3.8.10", + "gulp-concat": "2.6.0", + "gulp-cssmin": "0.1.7", + "gulp-file-include": "0.13.7", + "gulp-html-replace": "^1.6.2", + "gulp-md5-plus": "0.1.8", + "gulp-minify-html": "^1.0.6", + "gulp-uglify": "1.4.2" + }, + "repository": "", + "license": "MIT" +} \ No newline at end of file