File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 2
2
<div class =" user-info" >
3
3
<div class =" user-name" >
4
4
<div class =" user-avatar" >
5
- <img src =" http://vueim-10073389.image.myqcloud.com//u/can/use/slash/sample1479377386 " class =" img" ></img >
5
+ <img v-bind: src =' url ' class =" img" ></img >
6
6
</div >
7
7
<div class =" user-nickname" >
8
- <span >An </span >
8
+ <span >{{username}} </span >
9
9
<i ></i >
10
10
</div >
11
11
</div >
46
46
</template>
47
47
48
48
<script>
49
+ import { getLoginId } from '../vuex/getters'
50
+ import settings from '../settings.js'
49
51
export default {
50
52
data: function() {
51
53
return {
54
+ url: '',
55
+ username: ''
52
56
}
53
57
},
54
58
methods: {
55
59
},
60
+ ready: function() {
61
+ this.$http.post(settings.server+'/getUserInfo', { username: this.loginId }).then((res) => {
62
+ let result = res.data.data.user
63
+ this.url = result.url
64
+ console.log(result)
65
+ this.username = result.username
66
+ })
67
+ },
68
+ vuex: {
69
+ getters: {
70
+ loginId: getLoginId
71
+ }
72
+ },
56
73
57
74
}
58
75
</script>
You can’t perform that action at this time.
0 commit comments