diff --git a/cmd/install.go b/cmd/install.go
index 3f7629e..f418805 100644
--- a/cmd/install.go
+++ b/cmd/install.go
@@ -39,6 +39,7 @@ func install() {
log.Println(sql, "\t success!")
} else {
log.Println(sql, err, "\t failed!")
+ os.Exit(1)
}
}
}
diff --git a/models/models.go b/models/models.go
index 696552a..e9afaea 100644
--- a/models/models.go
+++ b/models/models.go
@@ -36,8 +36,7 @@ func init() {
InitConfig()
}
func Execute(sql string) error {
- DB.Exec(sql)
- return DB.Error
+ return DB.Exec(sql).Error
}
func CloseDB() {
defer DB.Close()
diff --git a/static/html/main.html b/static/html/main.html
index c0d112f..ed55739 100644
--- a/static/html/main.html
+++ b/static/html/main.html
@@ -89,6 +89,11 @@
openIframeUrl(url){
this.iframeUrl=url;
},
+ //退出
+ logout(){
+ localStorage.removeItem("token");
+ this.openIframeUrl('/login');
+ },
//跳转
openUrl(url){
window.location.href=url;
diff --git a/static/html/nav.html b/static/html/nav.html
index 09fa8f1..4c561e2 100644
--- a/static/html/nav.html
+++ b/static/html/nav.html
@@ -16,7 +16,7 @@
-
+
退出