Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DiscuzWeb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Discuz
DiscuzWeb
Commits
28c49051
Commit
28c49051
authored
May 13, 2021
by
xiongyuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
3bfe6f3c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
48 deletions
+104
-48
Header.vue
components/Header.vue
+78
-41
index.vue
pages/knowledge/index.vue
+19
-4
knowledgeDetail.vue
pages/knowledge/knowledgeDetail.vue
+3
-2
login.vue
pages/user/login.vue
+4
-1
No files found.
components/Header.vue
View file @
28c49051
...
...
@@ -33,14 +33,23 @@
/>
</el-input>
<template>
<div
<
!--
<
div
v-if=
"showSyncWanPan"
v-loading=
"showSyncWanPanloading"
class=
"knowledge"
@
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
>
</div>
<div>
...
...
@@ -65,7 +74,7 @@
id: userInfo.id,
username: userInfo.username,
avatarUrl: userInfo.avatarUrl,
isReal: userInfo.isReal
isReal: userInfo.isReal
,
}"
:size=
"35"
:round=
"true"
...
...
@@ -83,7 +92,7 @@
<span
v-if=
"
userInfo.unreadNotifications &&
userInfo.unreadNotifications > 0
userInfo.unreadNotifications > 0
"
class=
"unread-notice"
>
{{
...
...
@@ -115,15 +124,16 @@ export default {
props
:
{
headImg
:
{
type
:
String
,
default
:
""
}
default
:
""
,
}
,
},
data
()
{
return
{
showSelctWanPan
:
false
,
showSyncWanPanloading
:
false
,
showSyncWanPan
:
false
,
inputVal
:
""
,
isTest
:
false
,
isTest
:
false
,
code
:
""
,
// 邀请码
canReg
:
false
,
siteClose
:
false
,
...
...
@@ -132,7 +142,7 @@ export default {
imgurl
:
require
(
"@/assets/logo.png"
),
islogin
:
true
,
hideHeader
:
false
,
// 不需要头部右侧部分
preurl
:
"/"
preurl
:
"/"
,
};
},
computed
:
{
...
...
@@ -143,30 +153,31 @@ export default {
return
this
.
$store
.
state
.
site
.
info
.
attributes
||
{};
},
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
)
{
const
users
=
this
.
$store
.
state
.
user
.
info
.
attributes
;
if
(
!!
users
)
{
if
(
users
.
username
==
"熊裕文"
)
{
this
.
showSyncWanPan
=
true
;
}
axios
.
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
||
{};
}
}
,
},
watch
:
{
// 监听路由变化
...
...
@@ -176,29 +187,28 @@ export default {
}
else
{
this
.
siteClose
=
false
;
}
}
}
,
},
mounted
()
{
this
.
showSyncWanPan
=
false
;
// 获取cookies拿到token
var
token
=
this
.
getCookie
(
"BailunToken"
);
this
.
isTest
=
false
;
if
(
this
.
isTest
)
{
token
=
"Bearer%20eyJhbGciOiJSUzI1NiIsImtpZCI6IjQ1ZmMzZDYzYjRmNGM5YjAzMWVhNjQ0MzhhNTE1NmM3IiwidHlwIjoiSldUIn0.eyJuYmYiOjE2MTAxNzMxNTAsImV4cCI6MTYxMDIwOTE1MCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1MDAxIiwiYXVkIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NTAwMS9yZXNvdXJjZXMiLCJiYWlsdW5BcGkiXSwiY2xpZW50X2lkIjoiYmFpbHVuQ2xpZW50Iiwic3ViIjoi54aK6KOV5paHIiwiYXV0aF90aW1lIjoxNjEwMTczMTUwLCJpZHAiOiJsb2NhbCIsIlVzZXJJZCI6IjI5MjEyNzAiLCJXeFVzZXJJZCI6Inhpb25neXV3ZW4iLCJzdWNlc3NzIjoidHJ1ZSIsIkNvbXBhbnkiOiJ7XCJJZFwiOjEsXCJDb21wYW55Q29kZVwiOlwiYmFpbHVuXCIsXCJDb21wYW55TmFtZVwiOlwi5bm_5bee55m-5Lym5L6b5bqU6ZO-56eR5oqA5pyJ6ZmQ5YWs5Y-4XCJ9IiwiQWxsQ29tcGFueSI6IkZhbHNlIiwiVXNlckNvZGVOZXciOiJCTDE4ODQiLCJVc2VyQ29kZSI6IkJMNTU2NjkyMiIsIk9hVXNlcklkIjoiMzk4OCIsIkRlcGFydG1lbnQiOiJ7XCJEZXBhcnRtZW50SWRcIjoyNTYsXCJOYW1lXCI6XCLliIrnmbvlsI_nu4RcIixcIkNvZGVcIjpcIlwifSIsInNjb3BlIjpbIm9wZW5pZCIsInByb2ZpbGUiLCJiYWlsdW5BcGkiXSwiYW1yIjpbImN1c3R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jEsXCJDb21wYW55Q29kZVwiOlwiYmFpbHVuXCIsXCJDb21wYW55TmFtZVwiOlwi5bm_5bee55m-5Lym5L6b5bqU6ZO-56eR5oqA5pyJ6ZmQ5YWs5Y-4XCJ9IiwiQWxsQ29tcGFueSI6IkZhbHNlIiwiVXNlckNvZGVOZXciOiJCTDE4ODQiLCJVc2VyQ29kZSI6IkJMNTU2NjkyMiIsIk9hVXNlcklkIjoiMzk4OCIsIkRlcGFydG1lbnQiOiJ7XCJEZXBhcnRtZW50SWRcIjoyNTYsXCJOYW1lXCI6XCLliIrnmbvlsI_nu4RcIixcIkNvZGVcIjpcIlwifSIsInNjb3BlIjpbIm9wZW5pZCIsInByb2ZpbGUiLCJiYWlsdW5BcGkiXSwiYW1yIjpbImN1c3RvbSJdfQ.LWd_QutKJiG_zgE8kW2om5I5SB-rEA-c4LHvDZ0CzMLDGNNq-n40WodpD6W3W0nncKSObmvAycGo4Ko5bboAdP4zJykpoHEqSZ2naOZGwpvq8YnE50Ce0Nw1QgLWm0sXdNK6AfxItT04MOqjmhGrZ3KkQsS6VujXFCxBq1Mt2aVjhAgZjH5MKNMrPBuFN2h1l-fDWsjDoJw7JBNQQOJ2PlXHTCXIKLN3GzLt7VTmUa1Up8UozfoXu2k5Vzl5tCrNgGIUAmgdvME_I_eE3M-Klmqa6Tb2XfSRGqkmc7fnbF79ni4YtvxgYhQHAl-v9BNJF3OtQKXnGtGSaUC8rMTxzg"
;
}
else
{
token
=
token
.
replace
(
"Bearer%20"
,
""
).
replace
(
"Bearer "
,
""
);
}
if
(
token
)
{
// 有值
const
jwt
=
require
(
"jsonwebtoken"
);
const
wxUserid
=
this
.
isTest
?
"xiongyuwen"
:
jwt
.
decode
(
token
).
WxUserId
;
const
wxUserid
=
this
.
isTest
?
"xiongyuwen"
:
jwt
.
decode
(
token
).
WxUserId
;
// 更加微信用户id获取对应得用户信息并返回
axios
.
get
(
`https://discuz.bailuntec.com/api/login?useid=
${
wxUserid
}
`
)
// .get(`http://discuz.bailuntec.com/api/login?useid=chenqi`)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
data
.
data
.
relationships
.
users
.
data
.
id
)
{
localStorage
.
setItem
(
"user_id"
,
...
...
@@ -252,8 +262,15 @@ export default {
}
},
methods
:
{
handleSelctWanPan
:
function
(
companyName
){
localStorage
.
setItem
(
"company_name"
,
companyName
);
this
.
knowledge
(
companyName
)
},
// 获取cookie
getCookie
:
function
(
cname
)
{
getCookie
:
function
(
cname
)
{
const
name
=
`
${
cname
}
=`
;
const
ca
=
document
.
cookie
.
split
(
";"
);
console
.
log
(
"获取cookie,现在循环"
);
...
...
@@ -273,7 +290,7 @@ export default {
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
{
...
...
@@ -321,10 +338,16 @@ export default {
toIndex
()
{
this
.
$router
.
push
(
"/category"
);
},
knowledge
()
{
this
.
$router
.
push
(
`/knowledge`
);
}
}
knowledge
(
companyName
)
{
this
.
$router
.
replace
({
path
:
'/knowledge'
,
query
:
{
company
:
companyName
}
})
//this.$router.push(`/knowledge`);
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -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
{
width
:
60px
;
height
:
35px
;
...
...
pages/knowledge/index.vue
View file @
28c49051
...
...
@@ -40,14 +40,29 @@ export default {
qywxUserid
:
""
,
loading
:
false
,
knowledgeList
:
[],
companyName
:
""
,
};
},
watch
:
{
$route
(
route
)
{
let
_this
=
this
;
let
company
=
route
.
query
.
company
;
if
(
route
.
query
.
company
)
{
this
.
companyName
=
company
;
history
.
go
(
0
)
}
},
},
computed
:
{},
mounted
()
{
const
params
=
{
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
)
{
this
.
getCode
();
}
...
...
@@ -63,7 +78,7 @@ export default {
// 调用后台获取文件列表
axios
.
get
(
`
${
config
.
WEI_PAN_URL
}
/weipan/getfirstfilelist?userId=
${
this
.
qywxUserid
}
`
`
${
config
.
WEI_PAN_URL
}
/weipan/getfirstfilelist?userId=
${
this
.
qywxUserid
}
&companyName=
${
this
.
companyName
}
`
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
result
.
file_list
!=
null
)
{
...
...
@@ -112,7 +127,7 @@ export default {
//const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
let
local
=
"https://wiki.bailuntec.com/user/login"
;
let
APPID
=
"ww833808f6b8dc0745"
;
// 企业微信
let
href
=
window
.
location
.
href
;
let
href
=
window
.
location
.
href
;
if
(
href
.
indexOf
(
"discuz.bailuntec.com"
)
>
-
1
)
{
local
=
"https://discuz.bailuntec.com/user/login"
;
APPID
=
"ww4e7dd5ae312eb101"
;
// 企业微信
...
...
@@ -122,7 +137,6 @@ export default {
"&redirect_uri="
+
encodeURIComponent
(
local
)
+
"&response_type=code&scope=snsapi_base&state=4k#wechat_redirect"
;
}
else
{
window
.
location
.
href
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
...
...
@@ -143,6 +157,7 @@ export default {
id
:
fileid
,
fatherid
:
fatherid
,
useid
:
this
.
qywxUserid
,
companyName
:
this
.
companyName
,
},
});
},
...
...
pages/knowledge/knowledgeDetail.vue
View file @
28c49051
...
...
@@ -306,6 +306,7 @@ export default {
this
.
loading
=
true
;
// 获取知识库带过来的id
let
fildId
=
this
.
$route
.
query
.
id
;
let
companyName
=
this
.
$route
.
query
.
companyName
;
const
qywxUserid
=
this
.
$route
.
query
.
useid
;
this
.
qywxUserid
=
this
.
$route
.
query
.
useid
;
const
fatherid
=
this
.
$route
.
query
.
fatherid
;
...
...
@@ -317,7 +318,7 @@ export default {
// 获取树状数据
axios
.
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
=>
{
// this.data = res.data.result;
...
...
@@ -327,7 +328,7 @@ export default {
if
(
appointfileid
)
{
axios
.
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
=>
{
const
file
=
res
.
data
.
result
;
...
...
pages/user/login.vue
View file @
28c49051
...
...
@@ -263,7 +263,10 @@ export default {
"user_id"
,
res
.
data
.
data
.
relationships
.
users
.
data
.
id
);
localStorage
.
setItem
(
"company_name"
,
this
.
state
==
"4k"
?
"四千里数据科技有限公司"
:
"广州百伦供应链科技有限公司"
);
localStorage
.
setItem
(
"access_token"
,
res
.
data
.
data
.
attributes
.
access_token
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment