1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<template>
<v-content style="margin-top: 20%">
<v-container fluid fill-height>
<v-layout align-center justify-center>
<v-flex>
<div class="v-card-profile">
<v-avatar
slot="offset"
class="mx-auto d-block"
size="130"
>
<img src="https://demos.creative-tim.com/vue-material-dashboard/img/marc.aba54d65.jpg">
</v-avatar>
<v-card-text class="text-xs-center">
<h6 class="category text-gray font-weight-thin mb-9"></h6>
<h4 class="card-title" v-text="userName"></h4>
<!-- <p class="card-description font-weight-light">Don't be scared of the truth because we need to-->
<!-- restart the human foundation in truth And I love you like Kanye loves Kanye I love Rick-->
<!-- Owens’ bed design but the back is...</p>-->
<!-- <v-btn-->
<!-- color="success"-->
<!-- round-->
<!-- class="font-weight-light"-->
<!-- >Follow-->
<!-- </v-btn>-->
</v-card-text>
</div>
</v-flex>
</v-layout>
</v-container>
</v-content>
</template>
<script>
export default {
name: 'Mine',
methods: {
getUrlKey(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null)
return unescape(r[2]);
return null;
},
getUserInfo() {
this.$axios({
method: 'get',
url: '/sso/getUser?ticket=' + this.ticketStr,
}).then((response) => {
//这里使用了ES6的语法
this.userName = response.data.data.ddUserInfo.username //请求成功返回的数据
})
}
},
mounted() {
this.ticketStr = this.getUrlKey("ticketStr");
this.getUserInfo();
},
data: () => ({
userName: ''
})
}
</script>