File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed
Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change 66 </el-card >
77 <el-card class =" item" >
88 <div slot =" header" class =" clearfix" ><i class =" el-icon-user" /> Tool Bar</div >
9- <el-button type =" primary" >Edit</el-button >
9+ <el-button v-if = " ismine " type =" primary" >Edit</el-button >
1010 <el-button @click =" $router.go(-1);" >Back</el-button >
1111 </el-card >
1212 </div >
1313 <div id =" info" >
14- <el-card shadow =" never" >
15- <div slot =" header" class =" clearfix" ><i class =" el-icon-user" /> User Name</div >
16- {{username}}
17- </el-card >
14+ <el-row :gutter =" 20" >
15+ <el-col :span =" 18" >
16+ <el-card shadow =" never" >
17+ <div slot =" header" class =" clearfix" ><i class =" el-icon-user" /> User Name</div >
18+ {{username}}
19+ </el-card >
20+ </el-col >
21+ <el-col :span =" 6" >
22+ <el-card shadow =" never" >
23+ <div slot =" header" class =" clearfix" ><i class =" el-icon-user" /> User ID</div >
24+ {{userid}}
25+ </el-card >
26+ </el-col >
27+ </el-row >
1828 <el-card shadow =" never" class =" item" >
1929 <div slot =" header" class =" clearfix" ><i class =" el-icon-message" /> Email</div >
2030 {{email}}
@@ -56,11 +66,13 @@ export default {
5666 data () {
5767 return {
5868 username: ' -' ,
69+ userid: ' -' ,
5970 email: ' -' ,
6071 introduction: null ,
6172 solved: ' -' ,
6273 submit: ' -' ,
63- rate: ' -'
74+ rate: ' -' ,
75+ ismine: false
6476 };
6577 },
6678 methods: {
@@ -70,6 +82,7 @@ export default {
7082 .then (res => {
7183 let data = res .data .res ;
7284 this .username = data .username ;
85+ this .userid = data .id ;
7386 this .email = data .email ;
7487 this .introduction = data .introduction ;
7588 this .solved = data .solved ;
@@ -80,6 +93,9 @@ export default {
8093 this .rate = (this .solved * 100.0 ) / this .submit ;
8194 this .rate = this .rate .toFixed (2 );
8295 }
96+ if (this .userid == String (this .$store .state .user .userid )) {
97+ this .ismine = true ;
98+ }
8399 })
84100 .catch (err => {
85101 if (err .request .status === 404 ) {
You can’t perform that action at this time.
0 commit comments