Skip to content

Commit

Permalink
修改初始化数据库sql及标签列表
Browse files Browse the repository at this point in the history
  • Loading branch information
livisky committed Jul 5, 2016
1 parent ad836e9 commit 4b3145a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
11 changes: 10 additions & 1 deletion liblog.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
/*
Navicat MySQL Data Transfer
Date: 2016-07-05 10:34:42
Source Server : localhost_liblog_3306
Source Server Version : 50540
Source Host : localhost:3306
Source Database : liblog
Target Server Type : MYSQL
Target Server Version : 50540
File Encoding : 65001
Date: 2016-07-05 11:21:14
*/

SET FOREIGN_KEY_CHECKS=0;
Expand Down
8 changes: 4 additions & 4 deletions src/admin/controller/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export default class extends Base {
this.assign("title","分类管理");
return this.display();
}


async itemAction(){
if (this.get('id')) {
//编辑tags
Expand All @@ -48,7 +48,7 @@ export default class extends Base {
//编辑或者新增
let data=await this.post();
if(!think.isEmpty(this.post("id"))){
let rs=await this.model("tags").update(data);
let rs=await this.model("tags").where({id:this.post("id")}).update(data);
if(rs) return this.success();
}else{
let rs=await this.model("tags").add(data);
Expand All @@ -66,4 +66,4 @@ export default class extends Base {
}
}

}
}
4 changes: 2 additions & 2 deletions src/common/config/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
log_connect: true,
adapter: {
mysql: {
host: '127.0.0.1',
host: 'localhost',
port: '3306',
database: 'liblog',
user: 'root',
Expand All @@ -21,4 +21,4 @@ export default {

}
}
};
};

0 comments on commit 4b3145a

Please sign in to comment.