Commit dabde03a by maxiaohan

如登录时有token 直接跳转home页

parent 987eb654
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<div class=" middle margin_top25_bottom10"> <div class=" middle margin_top25_bottom10">
<el-button <el-button
class="magin_left_right30" class="magin_left_right30"
:class="{ active: loginType.accountStatus }"
:autofocus="true" :autofocus="true"
type="text" type="text"
@click="changeLoginType(1)" @click="changeLoginType(1)"
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
<el-button <el-button
class="magin_left_right30" class="magin_left_right30"
type="text" type="text"
:class="{ active: loginType.keyStatus }"
@click="changeLoginType(2)" @click="changeLoginType(2)"
>KEY登录 >KEY登录
</el-button> </el-button>
...@@ -60,7 +62,7 @@ ...@@ -60,7 +62,7 @@
</template> </template>
<script> <script>
import zoom from '@/utils/autosize'; import zoom from "@/utils/autosize";
import accountsLogin from "./modules/AccountsLogin.vue"; import accountsLogin from "./modules/AccountsLogin.vue";
import keyLogin from "./modules/KeyLogin.vue"; import keyLogin from "./modules/KeyLogin.vue";
...@@ -123,6 +125,9 @@ export default { ...@@ -123,6 +125,9 @@ export default {
// zoom('homepage_hero_module') // zoom('homepage_hero_module')
// }) // })
this.loginType.accountStatus = true; this.loginType.accountStatus = true;
if (localStorage.getItem("token") !== null) {
this.$router.push("/Home/Home");
}
// todo 初始登录 帐号密码登录选中状态 // todo 初始登录 帐号密码登录选中状态
// this.init(); // this.init();
// 视频自动适应高度 // 视频自动适应高度
...@@ -197,6 +202,9 @@ video { ...@@ -197,6 +202,9 @@ video {
font-family: MicrosoftYaHei; font-family: MicrosoftYaHei;
} }
.active {
color: #ffffff;
}
.el-button--text:focus { .el-button--text:focus {
width: 108px; width: 108px;
height: 24px; height: 24px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment