Skip to content

Commit

Permalink
🆕 Completed log-in and usr verification module
Browse files Browse the repository at this point in the history
  • Loading branch information
kotori-y committed Oct 17, 2021
1 parent a3d7771 commit 7d08289
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline';img-src * 'self' data:;font-src 'self' data:">
<!-- <meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline';img-src * 'self' data:;font-src 'self' data:">-->
<link rel="apple-touch-icon" href="icon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
Expand Down
1 change: 1 addition & 0 deletions src/assets/icon/more.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 15 additions & 2 deletions src/pages/Home.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div class="home">
<img @click.prevent="quit" class=more src="../assets/icon/more.svg" alt="">
<MainTitle/>
<TravelIndex/>
<Notice/>
Expand All @@ -20,13 +21,25 @@ export default {
beforeCreate () {
document.querySelector('body').setAttribute('style', 'background: #3CAD60')
},
beforeDestroy () {
document.querySelector('body').setAttribute('style', 'background: #e3e1e1;')
// beforeDestroy () {
// document.querySelector('body').setAttribute('style', 'background: #e3e1e1;')
// },
methods: {
quit() {
localStorage.removeItem("phoneNum");
this.$router.push({name: "login"})
}
}
}
</script>

<style scoped>
.more {
position: absolute;
top: 5vh;
height: 2.5vh;
right: 5vw;
}
</style>
5 changes: 4 additions & 1 deletion src/pages/LogIn/LogInPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import MainTitle from "@/components/Title";
import LonInAccount from "@/pages/LogIn/LonInAccount";
export default {
name: "LogInPage",
components: {LonInAccount, MainTitle}
components: {LonInAccount, MainTitle},
beforeCreate () {
document.querySelector('body').setAttribute('style', 'background: #FFFFFF')
},
}
</script>

Expand Down
3 changes: 2 additions & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ const router = new VueRouter({

router.beforeEach((to, from, next) => {

if ((to.meta["index"] !== 0) || !from.meta["index"]) {
if ((to.meta["index"] !== 0) || !from.meta["index"] ||
(to.meta["index"] === 0 && !localStorage.getItem("phoneNum"))) {
next()
}

Expand Down

0 comments on commit 7d08289

Please sign in to comment.