Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-front
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
beyond-clouds-front
Commits
af905a0f
Commit
af905a0f
authored
Feb 23, 2020
by
yanju
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复话题详情页
parent
131873ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
20 deletions
+21
-20
pages/topic/detail/_name.vue
+21
-18
plugins/axios.js
+0
-2
No files found.
pages/topic/detail/_name.vue
View file @
af905a0f
...
@@ -75,6 +75,25 @@
...
@@ -75,6 +75,25 @@
import
config
from
'../../../action/config'
import
config
from
'../../../action/config'
export
default
{
export
default
{
components
:
{
TopicCard
,
Pagination
,
CardContainer
,
NavWrap
,
ReleaseCard
,
SocialCard
,
UserCard
},
components
:
{
TopicCard
,
Pagination
,
CardContainer
,
NavWrap
,
ReleaseCard
,
SocialCard
,
UserCard
},
async
asyncData
({
$axios
,
params
}){
try
{
let
regExp
=
/^
[\u
4e00-
\u
9fa5
]
/
let
typicName
=
regExp
.
test
(
params
.
name
)?
encodeURI
(
params
.
name
):
params
.
name
;
let
TopicDetail
=
await
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
detail
+
typicName
,{
params
:{
by
:
'name'
}
});
return
{
topicCardInfo
:
TopicDetail
.
data
}
}
catch
(
e
)
{
}
},
data
(){
data
(){
return
{
return
{
list
:
[
list
:
[
...
@@ -119,10 +138,7 @@
...
@@ -119,10 +138,7 @@
}
}
},
},
created
()
{
created
()
{
let
name
=
this
.
$route
.
params
.
name
;
this
.
dataGetUsers
(
this
.
topicCardInfo
.
topicId
);
this
.
dataGetTopicInfo
(
name
);
this
.
$router
.
replace
({
this
.
$router
.
replace
({
path
:
this
.
$route
.
path
,
path
:
this
.
$route
.
path
,
query
:
{
query
:
{
...
@@ -157,18 +173,6 @@
...
@@ -157,18 +173,6 @@
},
},
methods
:{
methods
:{
dataGetTopicInfo
(
name
){
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
detail
+
name
,{
params
:{
by
:
'name'
}
}).
then
((
response
)
=>
{
this
.
topicCardInfo
=
response
.
data
;
this
.
dataGetUsers
(
response
.
data
.
topicId
);
})
},
restartPagination
(){
restartPagination
(){
this
.
postList
=
[];
this
.
postList
=
[];
this
.
pages
=
1
;
this
.
pages
=
1
;
...
@@ -304,7 +308,6 @@
...
@@ -304,7 +308,6 @@
changePage
(
currentPage
){
changePage
(
currentPage
){
console
.
log
(
currentPage
)
//返回页数 请求新的数据
//返回页数 请求新的数据
let
type
=
this
.
$route
.
query
.
type
;
let
type
=
this
.
$route
.
query
.
type
;
if
(
type
===
'new'
){
if
(
type
===
'new'
){
...
@@ -361,7 +364,7 @@
...
@@ -361,7 +364,7 @@
div{
div{
position
:
relative
;
position
:
relative
;
}
}
.topic-detail-container__search
{
>
.topic-detail-container__search
{
width
:
100%
;
width
:
100%
;
height
:
160
*$
length
;
height
:
160
*$
length
;
background-image
:
url("../../../assets/img/search_bg.png")
;
background-image
:
url("../../../assets/img/search_bg.png")
;
...
...
plugins/axios.js
View file @
af905a0f
...
@@ -25,12 +25,10 @@ export default function ({ store, redirect, app: { $axios } }) {
...
@@ -25,12 +25,10 @@ export default function ({ store, redirect, app: { $axios } }) {
redirect
(
'/users/login'
);
redirect
(
'/users/login'
);
}
}
}
}
console
.
log
(
error
)
console
.
log
(
error
)
});
});
$axios
.
interceptors
.
response
.
use
((
response
)
=>
{
$axios
.
interceptors
.
response
.
use
((
response
)
=>
{
return
response
return
response
})
})
}
}
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