Commit 28b64af5 by xiongyuwen
parents 9f6976ed 37568f03
......@@ -34,9 +34,9 @@
</el-input>
<template>
<div
class="knowledge"
v-loading="showSyncWanPanloading"
v-if="showSyncWanPan"
v-loading="showSyncWanPanloading"
class="knowledge"
@click="SyncWanPan"
>
刷新知识库
......@@ -65,7 +65,7 @@
id: userInfo.id,
username: userInfo.username,
avatarUrl: userInfo.avatarUrl,
isReal: userInfo.isReal,
isReal: userInfo.isReal
}"
:size="35"
:round="true"
......@@ -83,7 +83,7 @@
<span
v-if="
userInfo.unreadNotifications &&
userInfo.unreadNotifications > 0
userInfo.unreadNotifications > 0
"
class="unread-notice"
>{{
......@@ -115,8 +115,8 @@ export default {
props: {
headImg: {
type: String,
default: "",
},
default: ""
}
},
data() {
return {
......@@ -131,7 +131,7 @@ export default {
imgurl: require("@/assets/logo.png"),
islogin: true,
hideHeader: false, // 不需要头部右侧部分
preurl: "/",
preurl: "/"
};
},
computed: {
......@@ -156,9 +156,9 @@ export default {
// console.log(res.data.result);
// })
if (!!this.$store.state.user) {
let users = this.$store.state.user.info.attributes;
if (!!users) {
if (this.$store.state.user) {
const users = this.$store.state.user.info.attributes;
if (users) {
console.log(users, 22);
if (users.username == "熊裕文") {
this.showSyncWanPan = true;
......@@ -166,7 +166,7 @@ export default {
}
}
return this.$store.state.user.info.attributes || {};
},
}
},
watch: {
// 监听路由变化
......@@ -176,7 +176,7 @@ export default {
} else {
this.siteClose = false;
}
},
}
},
mounted() {
this.showSyncWanPan = false;
......@@ -194,8 +194,8 @@ export default {
// 更加微信用户id获取对应得用户信息并返回
axios
.get(`http://discuz.bailuntec.com/api/login?useid=${wxUserid}`)
//.get(`http://discuz.bailuntec.com/api/login?useid=chenqi`)
.then((res) => {
// .get(`http://discuz.bailuntec.com/api/login?useid=chenqi`)
.then(res => {
if (res.data.data.relationships.users.data.id) {
localStorage.setItem(
"user_id",
......@@ -250,7 +250,7 @@ export default {
},
methods: {
// 获取cookie
getCookie: function (cname) {
getCookie: function(cname) {
const name = `${cname}=`;
const ca = document.cookie.split(";");
console.log("获取cookie,现在循环");
......@@ -265,12 +265,12 @@ export default {
return "";
},
SyncWanPan() {
//alert('开始授权')
//this.getCode();
// alert('开始授权')
// this.getCode();
this.showSyncWanPanloading = true;
axios
.get(`${config.WEI_PAN_URL}/weipan/ProcessWeiPanWorker`)
.then((res) => {
.then(res => {
if (res.data.statusCode == 200) {
this.$message.success(res.data.result);
} else {
......@@ -316,16 +316,12 @@ export default {
},
// 跳转首页
toIndex() {
if (this.$route.path === "/") {
window.location.href = "/";
} else {
this.$router.push("/");
}
this.$router.push("/category");
},
knowledge() {
this.$router.push(`/knowledge`);
},
},
}
}
};
</script>
<style lang="scss" scoped>
......
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