自动初始化中间件拦截 防止误操作无法进入初始化功能

This commit is contained in:
pixel
2021-03-04 19:48:38 +08:00
parent 184b1a903f
commit 707dbac2ca
3 changed files with 14 additions and 10 deletions

View File

@@ -9,15 +9,7 @@ import { checkDB } from "@/api/initdb"
export default {
name: 'app',
async created(){
const res = await checkDB()
if(res.code == 0 && res.data.needInit){
this.$message({
type:"info",
message:"您是第一次使用,请初始化"
})
this.$store.commit("user/NeedInit")
this.$router.push({name:"init"})
}
await checkDB()
}
}
</script>