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
37568f03
Commit
37568f03
authored
Feb 03, 2021
by
zhujunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://code.bailuntec.com/Discuz/DiscuzWeb
parents
43206b59
e02149ae
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
9 deletions
+39
-9
zhishiku.png
assets/zhishiku.png
+0
-0
Header.vue
components/Header.vue
+11
-4
config.js
config.js
+0
-0
index.vue
pages/knowledge/index.vue
+28
-5
No files found.
assets/zhishiku.png
0 → 100644
View file @
37568f03
1.47 KB
components/Header.vue
View file @
37568f03
...
...
@@ -13,6 +13,9 @@
alt=
"头部logo"
/>
</div>
<div
class=
"knowledge"
@
click=
"knowledge"
>
<img
class=
"knowledgeImg"
src=
"@/assets/zhishiku.png"
alt=
""
/>
</div>
<el-input
v-model=
"inputVal"
autocomplete=
"off"
...
...
@@ -30,7 +33,6 @@
/>
</el-input>
<template>
<div
class=
"knowledge"
@
click=
"knowledge"
>
知识库
</div>
<div
v-if=
"showSyncWanPan"
v-loading=
"showSyncWanPanloading"
...
...
@@ -192,7 +194,7 @@ export default {
// 更加微信用户id获取对应得用户信息并返回
axios
.
get
(
`http://discuz.bailuntec.com/api/login?useid=
${
wxUserid
}
`
)
// .get(`http://discuz.bailuntec.com/api/login?useid=chen
zeka
i`)
// .get(`http://discuz.bailuntec.com/api/login?useid=chen
q
i`)
.
then
(
res
=>
{
if
(
res
.
data
.
data
.
relationships
.
users
.
data
.
id
)
{
localStorage
.
setItem
(
...
...
@@ -209,7 +211,6 @@ export default {
}
});
}
const
{
code
,
preurl
}
=
this
.
$route
.
query
;
if
(
preurl
)
{
this
.
preurl
=
preurl
;
...
...
@@ -264,6 +265,8 @@ export default {
return
""
;
},
SyncWanPan
()
{
// alert('开始授权')
// this.getCode();
this
.
showSyncWanPanloading
=
true
;
axios
.
get
(
`
${
config
.
WEI_PAN_URL
}
/weipan/ProcessWeiPanWorker`
)
...
...
@@ -366,9 +369,13 @@ export default {
}
}
.knowledge
{
margin-left
:
30
px
;
margin-left
:
5
px
;
cursor
:
pointer
;
}
.knowledgeImg
{
height
:
25px
;
margin-top
:
6px
;
}
.logo2
{
background-position
:
center
center
;
background-size
:
contain
;
...
...
config.js
View file @
37568f03
pages/knowledge/index.vue
View file @
37568f03
...
...
@@ -48,8 +48,7 @@ export default {
include
:
"groups,wechat"
};
if
(
!
this
.
userId
)
{
this
.
$message
.
warning
(
`请先登录`
);
return
false
;
this
.
getCode
();
}
this
.
$store
.
dispatch
(
"jv/get"
,
[
`users/
${
this
.
userId
}
`
,
{
params
}])
...
...
@@ -57,8 +56,7 @@ export default {
this
.
userInfo
=
JSON
.
parse
(
res
.
wechat_info
);
this
.
qywxUserid
=
this
.
userInfo
.
userid
;
if
(
!
this
.
qywxUserid
)
{
this
.
$message
.
warning
(
`请先登录`
);
return
false
;
this
.
getCode
();
}
this
.
loading
=
true
;
// 调用后台获取文件列表
...
...
@@ -70,12 +68,15 @@ export default {
if
(
res
.
data
.
result
.
file_list
!=
null
)
{
const
filelist
=
res
.
data
.
result
.
file_list
.
item
;
this
.
knowledgeList
=
[];
filelist
.
forEach
(
element
=>
{
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
=
{
title
:
element
.
file_name
,
name
:
element
.
create_user_name
,
time
:
element
.
ctim
e
,
time
:
dat
e
,
fileid
:
element
.
fileid
,
fatherid
:
element
.
fatherid
,
filetype
:
element
.
file_type
...
...
@@ -92,6 +93,28 @@ export default {
});
},
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
)
{
this
.
$router
.
push
({
path
:
"/knowledge/knowledgeDetail"
,
...
...
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