fix: 通过请求拦截来添加 Authorization Header

This commit is contained in:
xiongxiaoyang
2022-05-19 21:35:34 +08:00
parent a23a48eaf8
commit 9ae00b0902
2 changed files with 28 additions and 6 deletions

View File

@@ -8,9 +8,8 @@
><a href="/">网站首页</a><i class="line">|</i
><a href="/about/default.html">关于我们</a><i class="line">|</i
><a href="/about/contact.html">联系我们</a><i class="line">|</i
><router-link :to="{ name: 'feadBack' }" class="line" >反馈留言</router-link><i class="line">|</i
><a href="/author/index.html">作家专区</a><i class="line">|</i
><a href="/mobile/fiction_house.apk">客户端</a>
><a href="javascript:void(0)" @click="goFeedBack">反馈留言</a><i class="line">|</i><a href="/author/index.html">作家专区</a
><i class="line">|</i><a href="/mobile/fiction_house.apk">客户端</a>
</li>
<li>
Copyright (C) xiongxyang.gitee.io All rights
@@ -23,8 +22,23 @@
</template>
<script>
import { useRouter } from "vue-router";
import { getToken } from "@/utils/auth";
export default {
name: "Footer"
name: "Footer",
setup() {
const router = useRouter();
const goFeedBack = () => {
if(!getToken()){
router.push({name: 'login'});
}else{
router.push({name: 'feadBack'});
}
};
return {
goFeedBack
}
},
};
</script>