Commit 37568f03 by zhujunjie
parents 43206b59 e02149ae
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
alt="头部logo" alt="头部logo"
/> />
</div> </div>
<div class="knowledge" @click="knowledge">
<img class="knowledgeImg" src="@/assets/zhishiku.png" alt="" />
</div>
<el-input <el-input
v-model="inputVal" v-model="inputVal"
autocomplete="off" autocomplete="off"
...@@ -30,7 +33,6 @@ ...@@ -30,7 +33,6 @@
/> />
</el-input> </el-input>
<template> <template>
<div class="knowledge" @click="knowledge">知识库</div>
<div <div
v-if="showSyncWanPan" v-if="showSyncWanPan"
v-loading="showSyncWanPanloading" v-loading="showSyncWanPanloading"
...@@ -192,7 +194,7 @@ export default { ...@@ -192,7 +194,7 @@ 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=chenzekai`) // .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(
...@@ -209,7 +211,6 @@ export default { ...@@ -209,7 +211,6 @@ export default {
} }
}); });
} }
const { code, preurl } = this.$route.query; const { code, preurl } = this.$route.query;
if (preurl) { if (preurl) {
this.preurl = preurl; this.preurl = preurl;
...@@ -264,6 +265,8 @@ export default { ...@@ -264,6 +265,8 @@ export default {
return ""; return "";
}, },
SyncWanPan() { SyncWanPan() {
// alert('开始授权')
// this.getCode();
this.showSyncWanPanloading = true; this.showSyncWanPanloading = true;
axios axios
.get(`${config.WEI_PAN_URL}/weipan/ProcessWeiPanWorker`) .get(`${config.WEI_PAN_URL}/weipan/ProcessWeiPanWorker`)
...@@ -366,9 +369,13 @@ export default { ...@@ -366,9 +369,13 @@ export default {
} }
} }
.knowledge { .knowledge {
margin-left: 30px; margin-left: 5px;
cursor: pointer; cursor: pointer;
} }
.knowledgeImg {
height: 25px;
margin-top: 6px;
}
.logo2 { .logo2 {
background-position: center center; background-position: center center;
background-size: contain; background-size: contain;
......
...@@ -48,8 +48,7 @@ export default { ...@@ -48,8 +48,7 @@ export default {
include: "groups,wechat" include: "groups,wechat"
}; };
if (!this.userId) { if (!this.userId) {
this.$message.warning(`请先登录`); this.getCode();
return false;
} }
this.$store this.$store
.dispatch("jv/get", [`users/${this.userId}`, { params }]) .dispatch("jv/get", [`users/${this.userId}`, { params }])
...@@ -57,8 +56,7 @@ export default { ...@@ -57,8 +56,7 @@ export default {
this.userInfo = JSON.parse(res.wechat_info); this.userInfo = JSON.parse(res.wechat_info);
this.qywxUserid = this.userInfo.userid; this.qywxUserid = this.userInfo.userid;
if (!this.qywxUserid) { if (!this.qywxUserid) {
this.$message.warning(`请先登录`); this.getCode();
return false;
} }
this.loading = true; this.loading = true;
// 调用后台获取文件列表 // 调用后台获取文件列表
...@@ -70,12 +68,15 @@ export default { ...@@ -70,12 +68,15 @@ export default {
if (res.data.result.file_list != null) { if (res.data.result.file_list != null) {
const filelist = res.data.result.file_list.item; const filelist = res.data.result.file_list.item;
this.knowledgeList = []; this.knowledgeList = [];
filelist.forEach(element => { filelist.forEach(element => {
if (element.file_status == "1") { if (element.file_status == "1") {
var date=element.ctime.split(' ')[0].split("/")[2]+'/'+element.ctime.split(' ')[0].split("/")[1]+'/'+element.ctime.split(' ')[0].split("/")[0]+' '+element.ctime.split(' ')[1];
const knowledge = { const knowledge = {
title: element.file_name, title: element.file_name,
name: element.create_user_name, name: element.create_user_name,
time: element.ctime, time: date,
fileid: element.fileid, fileid: element.fileid,
fatherid: element.fatherid, fatherid: element.fatherid,
filetype: element.file_type filetype: element.file_type
...@@ -92,6 +93,28 @@ export default { ...@@ -92,6 +93,28 @@ export default {
}); });
}, },
methods: { methods: {
getCode() {
if (!this.userInfo) {
let ua = window.navigator.userAgent.toLowerCase();
if (
ua.match(/MicroMessenger/i) == "micromessenger" &&
ua.match(/wxwork/i) == "wxwork"
) {
// 静默授权
//const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
const local = "http://discuz.bailuntec.com/user/login";
const APPID = "ww833808f6b8dc0745"; // 企业微信
window.location.href =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
APPID +
"&redirect_uri=" +
encodeURIComponent(local) +
"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
}else{
this.$message.warning(`请先登录`);
}
}
},
knowledgeDetail(fileid, fatherid) { knowledgeDetail(fileid, fatherid) {
this.$router.push({ this.$router.push({
path: "/knowledge/knowledgeDetail", path: "/knowledge/knowledgeDetail",
......
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