修复导入数据遇到错误退出

pull/23/head
陶士涵 3 years ago
parent 2ff80dac52
commit a756e706e4

@ -39,6 +39,7 @@ func install() {
log.Println(sql, "\t success!")
} else {
log.Println(sql, err, "\t failed!")
os.Exit(1)
}
}
}

@ -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()

@ -89,6 +89,11 @@
openIframeUrl(url){
this.iframeUrl=url;
},
//退出
logout(){
localStorage.removeItem("token");
this.openIframeUrl('/login');
},
//跳转
openUrl(url){
window.location.href=url;

@ -16,7 +16,7 @@
<el-avatar :size="30" :src="adminAvator"></el-avatar>
<span v-html="adminRole"></span>
</template>
<el-menu-item v-on:click="openIframeUrl('/login')">
<el-menu-item v-on:click="logout()">
退出
</el-menu-item>
</el-submenu>

Loading…
Cancel
Save