Commit 28c49051 by xiongyuwen

no message

parent 3bfe6f3c
...@@ -33,14 +33,23 @@ ...@@ -33,14 +33,23 @@
/> />
</el-input> </el-input>
<template> <template>
<div <!-- <div
v-if="showSyncWanPan" v-if="showSyncWanPan"
v-loading="showSyncWanPanloading" v-loading="showSyncWanPanloading"
class="knowledge" class="knowledge"
@click="SyncWanPan" @click="SyncWanPan"
> >
刷新知识库 刷新知识库
</div> </div> -->
<el-dropdown class="filter-dropdown" v-if="showSelctWanPan" @command="handleSelctWanPan">
<span class="el-dropdown-link">
知识库切换<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="广州百伦供应链科技有限公司">百伦</el-dropdown-item>
<el-dropdown-item command="四千里数据科技有限公司">四千里</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template> </template>
</div> </div>
<div> <div>
...@@ -65,7 +74,7 @@ ...@@ -65,7 +74,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"
...@@ -115,15 +124,16 @@ export default { ...@@ -115,15 +124,16 @@ export default {
props: { props: {
headImg: { headImg: {
type: String, type: String,
default: "" default: "",
} },
}, },
data() { data() {
return { return {
showSelctWanPan: false,
showSyncWanPanloading: false, showSyncWanPanloading: false,
showSyncWanPan: false, showSyncWanPan: false,
inputVal: "", inputVal: "",
isTest:false, isTest: false,
code: "", // 邀请码 code: "", // 邀请码
canReg: false, canReg: false,
siteClose: false, siteClose: false,
...@@ -132,7 +142,7 @@ export default { ...@@ -132,7 +142,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: {
...@@ -143,30 +153,31 @@ export default { ...@@ -143,30 +153,31 @@ export default {
return this.$store.state.site.info.attributes || {}; return this.$store.state.site.info.attributes || {};
}, },
userInfo() { userInfo() {
// var result = axios.request({
// url: 'https://sso.bailuntec.com/GetUserResource',
// headers: {
// Authorization: token,
// "Content-Type": "application/x-www-form-urlencoded",
// "Access-Control-Allow-Origin": "*",
// },
// withCredentials: true, // 跨域
// method: 'get'
// }).then((res)=>{
// console.log(res.data.result);
// })
if (!!this.$store.state.user) { if (!!this.$store.state.user) {
const users = this.$store.state.user.info.attributes; const users = this.$store.state.user.info.attributes;
if (!!users) { if (!!users) {
if (users.username == "熊裕文") { axios
this.showSyncWanPan = true; .get(
`${config.WEI_PAN_URL}/weipan/isvisitfourkbyuserid?id=${users.id}`
)
.then((res) => {
if (res.data.result) {
this.showSelctWanPan = true;
} }
});
} }
} }
// if (!!this.$store.state.user) {
// const users = this.$store.state.user.info.attributes;
// if (!!users) {
// if (users.username == "熊裕文") {
// this.showSyncWanPan = true;
// }
// }
// }
return this.$store.state.user.info.attributes || {}; return this.$store.state.user.info.attributes || {};
} },
}, },
watch: { watch: {
// 监听路由变化 // 监听路由变化
...@@ -176,29 +187,28 @@ export default { ...@@ -176,29 +187,28 @@ export default {
} else { } else {
this.siteClose = false; this.siteClose = false;
} }
} },
}, },
mounted() { mounted() {
this.showSyncWanPan = false; this.showSyncWanPan = false;
// 获取cookies拿到token // 获取cookies拿到token
var token = this.getCookie("BailunToken"); var token = this.getCookie("BailunToken");
this.isTest=false; this.isTest = false;
if(this.isTest) if (this.isTest) {
{
token = token =
"Bearer%20eyJhbGciOiJSUzI1NiIsImtpZCI6IjQ1ZmMzZDYzYjRmNGM5YjAzMWVhNjQ0MzhhNTE1NmM3IiwidHlwIjoiSldUIn0.eyJuYmYiOjE2MTAxNzMxNTAsImV4cCI6MTYxMDIwOTE1MCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1MDAxIiwiYXVkIjpbImh0dHA6Ly9sb2Nhb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QutKJiG_zgE8kW2om5I5SB-rEA-c4LHvDZ0CzMLDGNNq-n40WodpD6W3W0nncKSObmvAycGo4Ko5bboAdP4zJykpoHEqSZ2naOZGwpvq8YnE50Ce0Nw1QgLWm0sXdNK6AfxItT04MOqjmhGrZ3KkQsS6VujXFCxBq1Mt2aVjhAgZjH5MKNMrPBuFN2h1l-fDWsjDoJw7JBNQQOJ2PlXHTCXIKLN3GzLt7VTmUa1Up8UozfoXu2k5Vzl5tCrNgGIUAmgdvME_I_eE3M-Klmqa6Tb2XfSRGqkmc7fnbF79ni4YtvxgYhQHAl-v9BNJF3OtQKXnGtGSaUC8rMTxzg";
}else{ } else {
token = token.replace("Bearer%20", "").replace("Bearer ", ""); token = token.replace("Bearer%20", "").replace("Bearer ", "");
} }
if (token) { if (token) {
// 有值 // 有值
const jwt = require("jsonwebtoken"); const jwt = require("jsonwebtoken");
const wxUserid = this.isTest?"xiongyuwen":jwt.decode(token).WxUserId; const wxUserid = this.isTest ? "xiongyuwen" : jwt.decode(token).WxUserId;
// 更加微信用户id获取对应得用户信息并返回 // 更加微信用户id获取对应得用户信息并返回
axios axios
.get(`https://discuz.bailuntec.com/api/login?useid=${wxUserid}`) .get(`https://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",
...@@ -252,8 +262,15 @@ export default { ...@@ -252,8 +262,15 @@ export default {
} }
}, },
methods: { methods: {
handleSelctWanPan:function(companyName){
localStorage.setItem(
"company_name",
companyName
);
this.knowledge(companyName)
},
// 获取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,现在循环");
...@@ -273,7 +290,7 @@ export default { ...@@ -273,7 +290,7 @@ export default {
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 {
...@@ -321,10 +338,16 @@ export default { ...@@ -321,10 +338,16 @@ export default {
toIndex() { toIndex() {
this.$router.push("/category"); this.$router.push("/category");
}, },
knowledge() { knowledge(companyName) {
this.$router.push(`/knowledge`); this.$router.replace({
} path: '/knowledge',
} query: {
company:companyName
}
})
//this.$router.push(`/knowledge`);
},
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -417,6 +440,20 @@ export default { ...@@ -417,6 +440,20 @@ export default {
} }
} }
.el-dropdown {
margin-left: 30px;
}
.el-dropdown-link {
cursor: pointer;
color: #409eff;
outline: none;
&.active, &:hover{
color: $color-blue-base;
}
}
.el-icon-arrow-down {
font-size: 12px;
}
.h-button { .h-button {
width: 60px; width: 60px;
height: 35px; height: 35px;
......
...@@ -40,14 +40,29 @@ export default { ...@@ -40,14 +40,29 @@ export default {
qywxUserid: "", qywxUserid: "",
loading: false, loading: false,
knowledgeList: [], knowledgeList: [],
companyName: "",
}; };
}, },
watch: {
$route(route) {
let _this = this;
let company = route.query.company;
if (route.query.company) {
this.companyName = company;
history.go(0)
}
},
},
computed: {}, computed: {},
mounted() { mounted() {
const params = { const params = {
include: "groups,wechat", include: "groups,wechat",
}; };
this.userId=localStorage.getItem("user_id"); this.userId = localStorage.getItem("user_id");
this.companyName = localStorage.getItem("company_name");
if (!this.companyName) {
this.companyName = "广州百伦供应链科技有限公司";
}
if (!this.userId) { if (!this.userId) {
this.getCode(); this.getCode();
} }
...@@ -63,7 +78,7 @@ export default { ...@@ -63,7 +78,7 @@ export default {
// 调用后台获取文件列表 // 调用后台获取文件列表
axios axios
.get( .get(
`${config.WEI_PAN_URL}/weipan/getfirstfilelist?userId=${this.qywxUserid}` `${config.WEI_PAN_URL}/weipan/getfirstfilelist?userId=${this.qywxUserid}&companyName=${this.companyName}`
) )
.then((res) => { .then((res) => {
if (res.data.result.file_list != null) { if (res.data.result.file_list != null) {
...@@ -112,7 +127,7 @@ export default { ...@@ -112,7 +127,7 @@ export default {
//const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId //const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
let local = "https://wiki.bailuntec.com/user/login"; let local = "https://wiki.bailuntec.com/user/login";
let APPID = "ww833808f6b8dc0745"; // 企业微信 let APPID = "ww833808f6b8dc0745"; // 企业微信
let href=window.location.href; let href = window.location.href;
if (href.indexOf("discuz.bailuntec.com") > -1) { if (href.indexOf("discuz.bailuntec.com") > -1) {
local = "https://discuz.bailuntec.com/user/login"; local = "https://discuz.bailuntec.com/user/login";
APPID = "ww4e7dd5ae312eb101"; // 企业微信 APPID = "ww4e7dd5ae312eb101"; // 企业微信
...@@ -122,7 +137,6 @@ export default { ...@@ -122,7 +137,6 @@ export default {
"&redirect_uri=" + "&redirect_uri=" +
encodeURIComponent(local) + encodeURIComponent(local) +
"&response_type=code&scope=snsapi_base&state=4k#wechat_redirect"; "&response_type=code&scope=snsapi_base&state=4k#wechat_redirect";
} else { } else {
window.location.href = window.location.href =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
...@@ -143,6 +157,7 @@ export default { ...@@ -143,6 +157,7 @@ export default {
id: fileid, id: fileid,
fatherid: fatherid, fatherid: fatherid,
useid: this.qywxUserid, useid: this.qywxUserid,
companyName: this.companyName,
}, },
}); });
}, },
......
...@@ -306,6 +306,7 @@ export default { ...@@ -306,6 +306,7 @@ export default {
this.loading = true; this.loading = true;
// 获取知识库带过来的id // 获取知识库带过来的id
let fildId = this.$route.query.id; let fildId = this.$route.query.id;
let companyName= this.$route.query.companyName;
const qywxUserid = this.$route.query.useid; const qywxUserid = this.$route.query.useid;
this.qywxUserid = this.$route.query.useid; this.qywxUserid = this.$route.query.useid;
const fatherid = this.$route.query.fatherid; const fatherid = this.$route.query.fatherid;
...@@ -317,7 +318,7 @@ export default { ...@@ -317,7 +318,7 @@ export default {
// 获取树状数据 // 获取树状数据
axios axios
.get( .get(
`${config.WEI_PAN_URL}/weipan/getfilelisttree?userId=${qywxUserid}&fildId=${fildId}&fatherid=${fatherid}` `${config.WEI_PAN_URL}/weipan/getfilelisttree?userId=${qywxUserid}&fildId=${fildId}&fatherid=${fatherid}&companyName=${companyName}`
) )
.then(res => { .then(res => {
// this.data = res.data.result; // this.data = res.data.result;
...@@ -327,7 +328,7 @@ export default { ...@@ -327,7 +328,7 @@ export default {
if (appointfileid) { if (appointfileid) {
axios axios
.get( .get(
`${config.WEI_PAN_URL}/weipan/getfilelisttree?userId=${qywxUserid}&fildId=${appointfileid}` `${config.WEI_PAN_URL}/weipan/getfilelisttree?userId=${qywxUserid}&fildId=${appointfileid}&companyName=${companyName}`
) )
.then(res => { .then(res => {
const file = res.data.result; const file = res.data.result;
......
...@@ -263,7 +263,10 @@ export default { ...@@ -263,7 +263,10 @@ export default {
"user_id", "user_id",
res.data.data.relationships.users.data.id res.data.data.relationships.users.data.id
); );
localStorage.setItem(
"company_name",
this.state=="4k"?"四千里数据科技有限公司":"广州百伦供应链科技有限公司"
);
localStorage.setItem( localStorage.setItem(
"access_token", "access_token",
res.data.data.attributes.access_token res.data.data.attributes.access_token
......
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