PlayerQuery.vue
3.02 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<template>
<div class="container-fluid mt-1">
<div class="card">
<div class="row">
<div class="col-1">选择服务器</div>
<div class="col-2">
<el-select v-model="serverselected" placeholder="选择服务器" size="default">
<el-option v-for="item in servers" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
<div class="col-1">玩家唯一ID</div>
<div class="col-2">
<el-input v-model="puid" placeholder="玩家唯一ID" size="default"></el-input>
</div>
</div>
</div>
</div>
<div class="container-fluid mt-1">
<div class="card">
<el-row>
<el-col :span="1" v-for="(text, index) of this.listPlayerQuery">
<button type="button" class="btn btn-info btn-block" :value=text @click="onPlayerQuery($event)">{{ text
}}</button>
</el-col>
</el-row>
<el-input type="textarea" :rows="50" placeholder="查询结果" v-model="textPlayerQueryResult">
</el-input>
</div>
</div>
</template>
<script>
import axios from 'axios';
import moment from 'moment';
export default {
name: 'HelloWorld',
props: {
msg: String
},
data() {
return {
servers: [{
value: '本机',
}, {
value: '内网测试服',
}, {
value: '审核服',
}, {
value: '正式服',
}],
serversDict: {
'本机': 'http://localhost:9002/api/gm/action',
'内网测试服': 'http://172.10.10.18:9002/api/gm/action',
'审核服': 'http://152.136.44.171:40002/api/gm/action',
'正式服': 'http://47.93.188.168:40002/api/gm/action',
},
serverselected: '本机',
puid: '1215485',
listPlayerQuery: [
"基础数据",
"临时数据",
"杂项数据",
"邮件数据",
"背包数据",
"建筑数据",
"棋盘数据",
"支付数据",
"活动数据",
"订单数据",
"buff数据",
"商城数据",
"任务数据",
"卡牌数据",
"TopMini",
"副本数据",
],
textPlayerQueryResult: '',
}
},
mounted: function () {
console.log('1');
console.log(this.$gvEnv);
console.log('2');
},
methods: {
OnPop(body, title) {
this.$alert(body, title, {
confirmButtonText: '确定',
});
},
onGmPost: function (data) {
data.Uid = this.puid
axios.post(this.serversDict[this.serverselected], data)
.then((response) => {
console.log(response);
let rsp = response.data;
if (rsp.Action == "玩家数据查询") {
this.textPlayerQueryResult = rsp.Result
}
})
.catch(function (error) {
console.log(error);
});
},
onPlayerQuery(event) {
let v = event.srcElement.value
this.onGmPost({
Action: '玩家数据查询',
Args: [v]
})
},
}
}
</script>