{{this.$cookie.get('username')}}
{{this.$cookie.get('username')}}
@@ -46,7 +46,6 @@ export default {
signOut(){
this.$cookie.delete('username');
// deletecookie
- var that=this;
axios({
method: 'get',
// 请求的地址
@@ -62,9 +61,16 @@ export default {
type: 'success',
offset: 50
});
- setTimeout(()=>{
+ if(this.$route.path!=='/home'){
+ setTimeout(()=>{
+ this.$router.push({
+ path:'/home'
+ })
+ },800)
+ }else {
window.location.reload();
- },800)
+ }
+
}else{
diff --git a/src/components/User/UserInfoPage.vue b/src/components/User/UserInfoPage.vue
index ebaa944..249f18a 100644
--- a/src/components/User/UserInfoPage.vue
+++ b/src/components/User/UserInfoPage.vue
@@ -11,18 +11,18 @@
-
+
-
-
-
{{username}}
+
+
+ {{username}}
{{username}}
Lv.1
-
你是 HelloGitHub 社区的第 {{userId}} 位用户,于 {{creatTime}} 加入。
+
你是 HelloGitHub 社区的第 {{userId}} 位用户,于 {{creatTime}} 加入。
已分享
{{projectNum}}
@@ -37,6 +37,13 @@
点贡献值。
+
+
+
+
+
+
+
@@ -71,6 +78,15 @@
+
+
+ 总文章: {{Object.keys(article).length}} 篇
+
+
+
+
+
+
@@ -99,6 +115,7 @@ export default {
projectList:[],
commentList:[],
like:[],
+ article:[],
}
},
mounted() {
@@ -147,9 +164,12 @@ export default {
username:this.$route.query.name
}
}).then(function (res) {
+ // console.log(res);
that.projectList=JSON.parse(res.data.project);
that.commentList=JSON.parse(res.data.comment);
that.like=JSON.parse(res.data.like)
+ that.article=JSON.parse(res.data.article);
+ console.log(Object.keys(that.article).length);
});
},
}