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