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
f9b24111
Commit
f9b24111
authored
Feb 14, 2020
by
yanju
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of coding.yundingshuyuan.com:pigbigbig/beyond-clouds-front
parents
b94d61ca
e80cc168
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
109 additions
and
31 deletions
+109
-31
nuxt.config.js
+8
-1
pages/answer/release/index.vue
+43
-3
pages/personal-center/account/info.vue
+5
-3
pages/project/release/index.vue
+42
-2
plugins/axios.js
+0
-4
store/index.js
+0
-1
store/userProfile.js
+11
-17
No files found.
nuxt.config.js
View file @
f9b24111
module
.
exports
=
{
server
:{
port
:
3010
,
port
:
process
.
env
.
NODE_ENV
===
'production'
?
3011
:
3010
,
host
:
'0.0.0.0'
},
...
...
@@ -57,6 +57,13 @@ module.exports = {
modules
:
[
'@nuxtjs/axios'
,
],
/**
* axios options
*/
axios
:
{
baseURL
:
process
.
env
.
NODE_ENV
===
'production'
?
'http://localhost:8080'
:
'http://opensource.yundingshuyuan.com'
,
browserBaseURL
:
'http://opensource.yundingshuyuan.com'
},
router
:
{
scrollBehavior
(
to
,
from
,
savedPosition
)
{
...
...
pages/answer/release/index.vue
View file @
f9b24111
...
...
@@ -5,7 +5,14 @@
title=
"以发布的问题"
width=
"302px"
height=
"270px"
></card-container>
>
<div
class=
"answer-release_List"
v-for=
"val in questionList"
:key=
"val.questionId"
:info=
"val"
>
<div
class=
"answer-box"
@
click=
"toDetail(val.questionId)"
>
<p>
{{
val
.
questionTitle
}}
</p>
<p
style=
"color: #999"
>
{{
val
.
category
}}
</p>
</div>
</div>
</card-container>
<card-container
title=
"问题草稿箱"
width=
"302px"
...
...
@@ -66,6 +73,12 @@
import
config
from
"../../../action/config"
;
export
default
{
async
asyncData
({
$axios
,
query
})
{
const
questionListRes
=
await
$axios
.
$get
(
config
.
api
.
get
.
Question
.
myCreated
,
{
params
:
{
page
:
1
,
size
:
12
,
}
});
const
questionClass
=
await
$axios
.
$get
(
config
.
api
.
get
.
QuestionCategory
.
list
);
let
classList
=
[];
questionClass
.
data
.
forEach
(
item
=>
{
...
...
@@ -74,16 +87,21 @@
tagId
:
item
.
categoryId
})
});
console
.
log
(
classList
)
//console.log(classList);
if
(
query
.
hasOwnProperty
(
'id'
))
{
const
response
=
await
$axios
.
$get
(
config
.
api
.
get
.
Question
.
detail
+
query
.
id
);
console
.
log
(
response
);
return
{
questionList
:
questionListRes
.
data
.
dataList
,
response
:
response
,
classList
}
}
else
{
return
{
classList
}}
}
else
{
return
{
classList
,
questionList
:
questionListRes
.
data
.
dataList
,}
}
},
mounted
(){
...
...
@@ -153,6 +171,9 @@
}
},
methods
:
{
toDetail
(
path
)
{
this
.
$router
.
push
(
`/answer/detail/
${
path
}
`
);
},
handleClass
(
value
)
{
this
.
blogClass
=
value
.
tagId
;
},
...
...
@@ -340,6 +361,25 @@
align-items
:
start
;
.answer-release-container__l
{
.answer-release_List
{
width
:
266
*$
length
;
padding
:
0
18
*$
length
;
.answer-box
{
margin
:
15
*$
length
0
;
@extend
%cursorPointer;
@include
fontStyle(13,17,500,#333,left);
@extend
%flex-row-spb;
@extend
%cursorPointer;
.answer-box__title
{
width
:
60%
;
@extend
%nowrap;
}
&
:hover
{
color
:
#00AAE6
;
}
}
}
}
.answer-release-container__r
{
...
...
pages/personal-center/account/info.vue
View file @
f9b24111
...
...
@@ -154,8 +154,6 @@
})
},
dataPostSaveUserInfo
(
type
){
let
userInfo1
=
{
gender
:
this
.
gender
,
nickName
:
this
.
nickName
,
...
...
@@ -167,7 +165,11 @@
if
(
this
.
wxNumber
)
userInfo2
.
wxNumber
=
this
.
wxNumber
;
this
.
$axios
.
$put
(
config
.
api
.
put
.
User
.
reviseInfo
,
type
===
1
?
userInfo1
:
userInfo2
).
then
((
response
)
=>
{
if
(
response
.
code
===
0
){
let
user
=
{
userAvatar
:
this
.
userAvatar
}
let
user
=
{
...
this
.
$store
.
state
.
userProfile
,
userAvatar
:
this
.
userAvatar
,
nickName
:
this
.
nickName
}
this
.
$store
.
commit
(
'userProfile/setUser'
,
user
);
this
.
getDataUserInfo
();
this
.
isEdit
=
false
;
...
...
pages/project/release/index.vue
View file @
f9b24111
...
...
@@ -5,7 +5,14 @@
title=
"已发布项目"
width=
"302px"
height=
"400px"
></card-container>
>
<div
class=
"project-release_List"
v-for=
"val in projectList"
:key=
"val.projectId"
:info=
"val"
>
<div
class=
"project-box"
@
click=
"toDetail(val.projectId)"
>
<p>
{{
val
.
projectName
}}
</p>
<p
style=
"color: #999"
>
{{
val
.
category
}}
</p>
</div>
</div>
</card-container>
<card-container
title=
"项目草稿箱"
width=
"302px"
...
...
@@ -157,6 +164,12 @@ import config from '../../../action/config';
export
default
{
async
asyncData
({
$axios
,
query
})
{
const
projectListRes
=
await
$axios
.
$get
(
config
.
api
.
get
.
Project
.
myList
,
{
params
:
{
page
:
1
,
size
:
12
,
}
});
const
projectCategory
=
await
$axios
.
$get
(
config
.
api
.
get
.
ProjectCategory
.
list
);
let
classList
=
[];
projectCategory
.
data
.
forEach
(
item
=>
{
...
...
@@ -170,11 +183,15 @@ export default {
const
response
=
await
$axios
.
$get
(
config
.
api
.
get
.
Project
.
detail
+
query
.
id
);
console
.
log
(
response
);
return
{
projectList
:
projectListRes
.
data
.
dataList
,
response
:
response
,
classList
}
}
else
{
return
{
classList
}
return
{
classList
,
projectList
:
projectListRes
.
data
.
dataList
,
}
}
},
mounted
()
{
...
...
@@ -250,6 +267,9 @@ export default {
}
},
methods
:
{
toDetail
(
path
)
{
this
.
$router
.
push
(
`/project/detail/
${
path
}
`
);
},
imgAdd
(
pos
,
file
)
{
// filename: 写在md中的文件名, File: File Object
// 第一步.将图片上传到服务器.
...
...
@@ -481,6 +501,26 @@ export default {
align-items
:
start
;
.project-release-container__l
{
.project-release_List
{
width
:
266
*$
length
;
padding
:
0
18
*$
length
;
.project-box
{
margin
:
15
*$
length
0
;
@extend
%cursorPointer;
@include
fontStyle(13,17,500,#333,left);
@extend
%flex-row-spb;
@extend
%cursorPointer;
.project-box__title
{
width
:
60%
;
@extend
%nowrap;
}
&
:hover
{
color
:
#00AAE6
;
}
}
}
}
.project-release-container__r
{
...
...
plugins/axios.js
View file @
f9b24111
export
default
function
({
store
,
redirect
,
app
:
{
$axios
}
})
{
// 数据访问前缀
$axios
.
defaults
.
baseURL
=
'http://opensource.yundingshuyuan.com'
;
$axios
.
defaults
.
browserBaseURL
=
'http://opensource.yundingshuyuan.com'
;
// request拦截器,我这里设置了一个token,当然你可以不要
$axios
.
onRequest
((
config
)
=>
{
const
auth
=
store
.
state
.
auth
;
...
...
store/index.js
View file @
f9b24111
...
...
@@ -17,7 +17,6 @@ export const actions = {
}
catch
(
e
)
{
// 请求出错,删除认证信息
commit
(
'auth/logout'
)
console
.
log
(
e
)
}
}
}
...
...
store/userProfile.js
View file @
f9b24111
...
...
@@ -3,27 +3,21 @@ const defaultUser = {
nickName
:
null
,
avatar
:
null
}
export
const
state
=
()
=>
defaultUser
export
const
state
=
()
=>
({
...
defaultUser
})
export
const
mutations
=
{
setUser
(
state
,
user
)
{
if
(
user
.
userId
){
Object
.
assign
(
state
,
{
userId
:
user
.
userId
,
})
}
if
(
user
.
userAvatar
){
Object
.
assign
(
state
,
{
avatar
:
user
.
userAvatar
,
})
}
if
(
user
.
nickName
){
Object
.
assign
(
state
,
{
nickName
:
user
.
nickName
})
}
Object
.
assign
(
state
,
{
userId
:
user
.
userId
,
nickName
:
user
.
nickName
,
avatar
:
user
.
userAvatar
})
},
removeUser
(
state
)
{
Object
.
assign
(
state
,
defaultUser
)
Object
.
assign
(
state
,
{
...
defaultUser
})
}
}
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