|
|
@@ -43,6 +43,7 @@
|
|
|
<script>
|
|
|
import Footer from "@/components/Footer";
|
|
|
import { mapGetters } from "vuex";
|
|
|
+ import { ref } from "vue";
|
|
|
export default {
|
|
|
components: {
|
|
|
Footer
|
|
|
@@ -74,6 +75,10 @@
|
|
|
|
|
|
this.$store.commit("updateLogin", false);
|
|
|
localStorage.removeItem("userInfo");
|
|
|
+
|
|
|
+ console.log("logout");
|
|
|
+ // 清除缓存的keep-alive页面
|
|
|
+ this.clearKeepAliveCache();
|
|
|
this.$router.push({path:"/login", query: {loginAny: true}});
|
|
|
},
|
|
|
bindWeiXin(){
|
|
|
@@ -95,6 +100,14 @@
|
|
|
var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=0#wechat_redirect";
|
|
|
window.location.href = weixinUrl;
|
|
|
},
|
|
|
+
|
|
|
+ clearKeepAliveCache() {
|
|
|
+ const indexs = this.$router.options.routes.filter(route => route.path && route.path === "/index");
|
|
|
+ console.log(indexs);
|
|
|
+ if (indexs.length > 0 && indexs[0].meta.keepAlive){
|
|
|
+ indexs[0].meta.keepAlive = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
create() {
|
|
|
},
|