Skip to content

Commit

Permalink
🦄 fix otale#81
Browse files Browse the repository at this point in the history
  • Loading branch information
hellokaton committed Mar 2, 2017
1 parent 95999ab commit 2566f64
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/tale/controller/InstallController.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class InstallController extends BaseController {
@Inject
private OptionsService optionsService;

private boolean dbConn = false;

/**
* 安装页
*
Expand Down Expand Up @@ -89,6 +91,10 @@ public RestResponse doInstall(@QueryParam String site_title, @QueryParam String
return RestResponse.fail("邮箱格式不正确");
}

if(!dbConn){
return RestResponse.fail("请检查数据库连接");
}

TaleJdbc.injection(Blade.$().ioc());

Users users = new Users();
Expand Down Expand Up @@ -143,6 +149,7 @@ public RestResponse conn_test(@QueryParam String db_host, @QueryParam String db_
TaleJdbc.put("password", db_pass);
try {
TaleJdbc.testConn();
dbConn = true;
} catch (Exception e) {
String msg = "数据库连接失败, 请检查数据库配置";
if (e instanceof TipException) {
Expand Down

0 comments on commit 2566f64

Please sign in to comment.