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
2053ffdc
Commit
2053ffdc
authored
Jan 25, 2021
by
zhujunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://code.bailuntec.com/Discuz/DiscuzWeb
parents
15e738ce
e965b3f0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
32 deletions
+62
-32
Header.vue
components/Header.vue
+52
-16
PostItem.vue
components/PostItem.vue
+0
-0
knowledgeDetail.vue
pages/knowledge/knowledgeDetail.vue
+10
-16
No files found.
components/Header.vue
View file @
2053ffdc
...
@@ -31,6 +31,14 @@
...
@@ -31,6 +31,14 @@
</el-input>
</el-input>
<template>
<template>
<div
class=
"knowledge"
@
click=
"knowledge"
>
知识库
</div>
<div
class=
"knowledge"
@
click=
"knowledge"
>
知识库
</div>
<div
class=
"knowledge"
v-loading=
"showSyncWanPanloading"
v-if=
"showSyncWanPan"
@
click=
"SyncWanPan"
>
刷新知识库
</div>
</
template
>
</
template
>
</div>
</div>
<div>
<div>
...
@@ -55,7 +63,7 @@
...
@@ -55,7 +63,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"
...
@@ -73,7 +81,7 @@
...
@@ -73,7 +81,7 @@
<span
<span
v-if=
"
v-if=
"
userInfo.unreadNotifications &&
userInfo.unreadNotifications &&
userInfo.unreadNotifications > 0
userInfo.unreadNotifications > 0
"
"
class=
"unread-notice"
class=
"unread-notice"
>
{{
>
{{
...
@@ -98,17 +106,20 @@
...
@@ -98,17 +106,20 @@
import
loginAbout
from
"@/mixin/loginAbout"
;
import
loginAbout
from
"@/mixin/loginAbout"
;
import
jwt
from
"jsonwebtoken"
;
import
jwt
from
"jsonwebtoken"
;
import
axios
from
"@/plugins/axios.js"
;
import
axios
from
"@/plugins/axios.js"
;
import
config
from
"@/config.js"
;
export
default
{
export
default
{
name
:
"Header"
,
name
:
"Header"
,
mixins
:
[
loginAbout
],
mixins
:
[
loginAbout
],
props
:
{
props
:
{
headImg
:
{
headImg
:
{
type
:
String
,
type
:
String
,
default
:
""
default
:
""
,
}
}
,
},
},
data
()
{
data
()
{
return
{
return
{
showSyncWanPanloading
:
false
,
showSyncWanPan
:
false
,
inputVal
:
""
,
inputVal
:
""
,
code
:
""
,
// 邀请码
code
:
""
,
// 邀请码
canReg
:
false
,
canReg
:
false
,
...
@@ -118,7 +129,7 @@ export default {
...
@@ -118,7 +129,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,8 +154,19 @@ export default {
...
@@ -143,8 +154,19 @@ export default {
// console.log(res.data.result);
// console.log(res.data.result);
// })
// })
if
(
!!
this
.
$store
.
state
.
user
)
{
let
users
=
this
.
$store
.
state
.
user
.
info
.
attributes
;
if
(
!!
users
)
{
console
.
log
(
users
,
22
)
if
(
users
.
username
==
"熊裕文"
)
{
this
.
showSyncWanPan
=
true
;
}
}
}
return
this
.
$store
.
state
.
user
.
info
.
attributes
||
{};
return
this
.
$store
.
state
.
user
.
info
.
attributes
||
{};
}
}
,
},
},
watch
:
{
watch
:
{
// 监听路由变化
// 监听路由变化
...
@@ -154,15 +176,16 @@ export default {
...
@@ -154,15 +176,16 @@ export default {
}
else
{
}
else
{
this
.
siteClose
=
false
;
this
.
siteClose
=
false
;
}
}
}
}
,
},
},
mounted
()
{
mounted
()
{
this
.
showSyncWanPan
=
false
;
// 获取cookies拿到token
// 获取cookies拿到token
var
token
=
this
.
getCookie
(
"BailunToken"
);
var
token
=
this
.
getCookie
(
"BailunToken"
);
//
var token =
var
token
=
//
"Bearer%20eyJhbGciOiJSUzI1NiIsImtpZCI6IjQ1ZmMzZDYzYjRmNGM5YjAzMWVhNjQ0MzhhNTE1NmM3IiwidHlwIjoiSldUIn0.eyJuYmYiOjE2MTAxNzMxNTAsImV4cCI6MTYxMDIwOTE1MCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1MDAxIiwiYXVkIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NTAwMS9yZXNvdXJjZXMiLCJiYWlsdW5BcGkiXSwiY2xpZW50X2lkIjoiYmFpbHVuQ2xpZW50Iiwic3ViIjoi54aK6KOV5paHIiwiYXV0aF90aW1lIjoxNjEwMTczMTUwLCJpZHAiOiJsb2NhbCIsIlVzZXJJZCI6IjI5MjEyNzAiLCJXeFVzZXJJZCI6Inhpb25neXV3ZW4iLCJzdWNlc3NzIjoidHJ1ZSIsIkNvbXBhbnkiOiJ7XCJJZFwiOjEsXCJDb21wYW55Q29kZVwiOlwiYmFpbHVuXCIsXCJDb21wYW55TmFtZVwiOlwi5bm_5bee55m-5Lym5L6b5bqU6ZO-56eR5oqA5pyJ6ZmQ5YWs5Y-4XCJ9IiwiQWxsQ29tcGFueSI6IkZhbHNlIiwiVXNlckNvZGVOZXciOiJCTDE4ODQiLCJVc2VyQ29kZSI6IkJMNTU2NjkyMiIsIk9hVXNlcklkIjoiMzk4OCIsIkRlcGFydG1lbnQiOiJ7XCJEZXBhcnR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6b5bqU6ZO-56eR5oqA5pyJ6ZmQ5YWs5Y-4XCJ9IiwiQWxsQ29tcGFueSI6IkZhbHNlIiwiVXNlckNvZGVOZXciOiJCTDE4ODQiLCJVc2VyQ29kZSI6IkJMNTU2NjkyMiIsIk9hVXNlcklkIjoiMzk4OCIsIkRlcGFydG1lbnQiOiJ7XCJEZXBhcnRtZW50SWRcIjoyNTYsXCJOYW1lXCI6XCLliIrnmbvlsI_nu4RcIixcIkNvZGVcIjpcIlwifSIsInNjb3BlIjpbIm9wZW5pZCIsInByb2ZpbGUiLCJiYWlsdW5BcGkiXSwiYW1yIjpbImN1c3RvbSJdfQ.LWd_QutKJiG_zgE8kW2om5I5SB-rEA-c4LHvDZ0CzMLDGNNq-n40WodpD6W3W0nncKSObmvAycGo4Ko5bboAdP4zJykpoHEqSZ2naOZGwpvq8YnE50Ce0Nw1QgLWm0sXdNK6AfxItT04MOqjmhGrZ3KkQsS6VujXFCxBq1Mt2aVjhAgZjH5MKNMrPBuFN2h1l-fDWsjDoJw7JBNQQOJ2PlXHTCXIKLN3GzLt7VTmUa1Up8UozfoXu2k5Vzl5tCrNgGIUAmgdvME_I_eE3M-Klmqa6Tb2XfSRGqkmc7fnbF79ni4YtvxgYhQHAl-v9BNJF3OtQKXnGtGSaUC8rMTxzg"
;
var
token
=
token
.
replace
(
"Bearer%20"
,
""
).
replace
(
"Bearer "
,
""
);
var
token
=
token
.
replace
(
"Bearer%20"
,
""
).
replace
(
"Bearer "
,
""
);
if
(
token
)
{
if
(
token
)
{
// 有值
// 有值
const
jwt
=
require
(
"jsonwebtoken"
);
const
jwt
=
require
(
"jsonwebtoken"
);
...
@@ -170,9 +193,9 @@ export default {
...
@@ -170,9 +193,9 @@ 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=xiongyuwen
`
)
.
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"
,
...
@@ -228,7 +251,7 @@ export default {
...
@@ -228,7 +251,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,现在循环"
);
...
@@ -242,6 +265,19 @@ export default {
...
@@ -242,6 +265,19 @@ export default {
}
}
return
""
;
return
""
;
},
},
SyncWanPan
()
{
this
.
showSyncWanPanloading
=
true
;
axios
.
get
(
`
${
config
.
WEI_PAN_URL
}
/weipan/ProcessWeiPanWorker`
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
statusCode
==
200
)
{
this
.
$message
.
success
(
res
.
data
.
result
);
}
else
{
this
.
$message
.
err
(
res
.
data
.
result
);
}
this
.
showSyncWanPanloading
=
false
;
});
},
// 退出
// 退出
logout
()
{
logout
()
{
this
.
$store
.
dispatch
(
"session/logout"
).
then
(()
=>
{
this
.
$store
.
dispatch
(
"session/logout"
).
then
(()
=>
{
...
@@ -287,8 +323,8 @@ export default {
...
@@ -287,8 +323,8 @@ export default {
},
},
knowledge
()
{
knowledge
()
{
this
.
$router
.
push
(
`/knowledge`
);
this
.
$router
.
push
(
`/knowledge`
);
}
}
,
}
}
,
};
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
components/PostItem.vue
View file @
2053ffdc
This diff is collapsed.
Click to expand it.
pages/knowledge/knowledgeDetail.vue
View file @
2053ffdc
...
@@ -92,7 +92,6 @@
...
@@ -92,7 +92,6 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
axios
from
'@/plugins/axios.js'
;
import
axios
from
'@/plugins/axios.js'
;
...
@@ -291,12 +290,16 @@ export default {
...
@@ -291,12 +290,16 @@ export default {
// this.data = res.data.result;
// this.data = res.data.result;
this
.
data
=
this
.
deleteChildren
(
res
.
data
.
result
);
this
.
data
=
this
.
deleteChildren
(
res
.
data
.
result
);
this
.
loading
=
false
;
this
.
loading
=
false
;
if
(
this
.
data
.
length
==
1
)
{
if
(
!!
this
.
data
)
if
(
this
.
data
[
0
].
file
)
{
{
let
file
=
this
.
data
.
filter
(
item
=>
item
.
file
==
true
);
if
(
!!
file
)
{
// 触发点击事件
// 触发点击事件
this
.
handleNodeClick
(
this
.
data
[
0
]);
this
.
handleNodeClick
(
file
[
0
]);
}
}
}
}
});
});
if
(
Object
.
keys
(
this
.
thread
).
length
===
0
)
this
.
getThread
();
if
(
Object
.
keys
(
this
.
thread
).
length
===
0
)
this
.
getThread
();
else
this
.
initData
();
else
this
.
initData
();
...
@@ -333,7 +336,6 @@ export default {
...
@@ -333,7 +336,6 @@ export default {
window
.
open
(
this
.
fileSrc
,
'_blank'
);
window
.
open
(
this
.
fileSrc
,
'_blank'
);
},
},
handleNodeClick
(
data
)
{
handleNodeClick
(
data
)
{
console
.
log
(
data
);
self
=
this
;
self
=
this
;
if
(
data
.
file
)
{
if
(
data
.
file
)
{
this
.
showViewloading
=
true
;
this
.
showViewloading
=
true
;
...
@@ -368,7 +370,6 @@ export default {
...
@@ -368,7 +370,6 @@ export default {
console
.
log
(
this
.
threadId
,
3232
);
console
.
log
(
this
.
threadId
,
3232
);
}
}
this
.
fileMd5
=
data
.
md5
;
this
.
fileMd5
=
data
.
md5
;
console
.
log
(
this
.
threadId
,
'我是父组件'
);
});
});
}
}
},
},
...
@@ -590,14 +591,7 @@ export default {
...
@@ -590,14 +591,7 @@ export default {
head
()
{
head
()
{
return
{
return
{
title
:
title
:
((
this
.
thread
&&
this
.
thread
.
title
)
'知识库'
,
||
(
this
.
thread
&&
this
.
thread
.
firstPost
&&
this
.
thread
.
firstPost
.
summaryText
.
slice
(
0
,
15
))
||
'主题详情页'
)
+
(
this
.
forums
&&
this
.
forums
.
set_site
&&
this
.
forums
.
set_site
.
site_name
?
` -
${
this
.
forums
.
set_site
.
site_name
}
`
:
'
\
u200E'
),
meta
:
[
meta
:
[
{
{
hid
:
'keywords'
,
hid
:
'keywords'
,
...
@@ -693,7 +687,7 @@ export default {
...
@@ -693,7 +687,7 @@ export default {
}
}
}
}
&
-right
{
&
-right
{
width
:
86
5
px
;
width
:
86
7
px
;
background
:
#fff
;
background
:
#fff
;
margin-left
:
9px
;
margin-left
:
9px
;
padding
:
20px
;
padding
:
20px
;
...
...
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