Commit 4ccf58bceb873f4abd428f9627fbc8e1d4efc51d
1 parent
4909ad5d
Exists in
master
【工具】GM工具
Showing
2 changed files
with
120 additions
and
3 deletions
Show diff stats
src/components/PlayerEdit.vue
src/components/PlayerQuery.vue
1 | 1 | <template> |
2 | - <h1>玩家查询</h1> | |
3 | -</template> | |
4 | 2 | \ No newline at end of file |
3 | + | |
4 | + <div class="container-fluid mt-1"> | |
5 | + <div class="card"> | |
6 | + <div class="row"> | |
7 | + <div class="col-1">选择服务器</div> | |
8 | + <div class="col-2"> | |
9 | + <el-select v-model="serverselected" placeholder="选择服务器" size="default"> | |
10 | + <el-option v-for="item in servers" :key="item.value" :label="item.value" :value="item.value"> | |
11 | + </el-option> | |
12 | + </el-select> | |
13 | + </div> | |
14 | + <div class="col-1">玩家唯一ID</div> | |
15 | + <div class="col-2"> | |
16 | + <el-input v-model="puid" placeholder="玩家唯一ID" size="default"></el-input> | |
17 | + </div> | |
18 | + </div> | |
19 | + </div> | |
20 | + </div> | |
21 | + | |
22 | + <div class="container-fluid mt-1"> | |
23 | + <div class="card"> | |
24 | + <el-row> | |
25 | + <el-col :span="1" v-for="(text, index) of this.listPlayerQuery"> | |
26 | + <button type="button" class="btn btn-info btn-block" :value=text @click="onPlayerQuery($event)">{{ text | |
27 | + }}</button> | |
28 | + </el-col> | |
29 | + </el-row> | |
30 | + <el-input type="textarea" :rows="50" placeholder="查询结果" v-model="textPlayerQueryResult"> | |
31 | + </el-input> | |
32 | + </div> | |
33 | + </div> | |
34 | + | |
35 | + <div id="output"> | |
36 | + <!-- <el-button round type="primary" class="btn-block" v-on:click="ontest">测试</el-button> --> | |
37 | + <!-- 选择的服务器是: {{ serverselected }} puid: {{ puid }} --> | |
38 | + </div> | |
39 | +</template> | |
40 | + | |
41 | +<script> | |
42 | +import axios from 'axios'; | |
43 | +import moment from 'moment'; | |
44 | +export default { | |
45 | + name: 'HelloWorld', | |
46 | + props: { | |
47 | + msg: String | |
48 | + }, | |
49 | + data() { | |
50 | + return { | |
51 | + servers: [{ | |
52 | + value: '本机', | |
53 | + }, { | |
54 | + value: '内网测试服', | |
55 | + }, { | |
56 | + value: '审核服', | |
57 | + }, { | |
58 | + value: '正式服', | |
59 | + }], | |
60 | + serversDict: { | |
61 | + '本机': 'http://localhost:9002/api/gm/action', | |
62 | + '内网测试服': 'http://172.10.10.18:9002/api/gm/action', | |
63 | + '审核服': 'http://152.136.44.171:40002/api/gm/action', | |
64 | + '正式服': 'http://47.93.188.168:40002/api/gm/action', | |
65 | + }, | |
66 | + serverselected: '本机', | |
67 | + puid: '1215485', | |
68 | + | |
69 | + listPlayerQuery: [ | |
70 | + "基础数据", | |
71 | + "临时数据", | |
72 | + "杂项数据", | |
73 | + "邮件数据", | |
74 | + "背包数据", | |
75 | + "建筑数据", | |
76 | + "棋盘数据", | |
77 | + "支付数据", | |
78 | + "活动数据", | |
79 | + "订单数据", | |
80 | + "buff数据", | |
81 | + "商城数据", | |
82 | + "任务数据", | |
83 | + "卡牌数据", | |
84 | + "TopMini", | |
85 | + "副本数据", | |
86 | + ], | |
87 | + textPlayerQueryResult: '', | |
88 | + | |
89 | + } | |
90 | + }, | |
91 | + mounted: function () { | |
92 | + }, | |
93 | + methods: { | |
94 | + OnPop(body, title) { | |
95 | + this.$alert(body, title, { | |
96 | + confirmButtonText: '确定', | |
97 | + }); | |
98 | + }, | |
99 | + onGmPost: function (data) { | |
100 | + data.Uid = this.puid | |
101 | + axios.post(this.serversDict[this.serverselected], data) | |
102 | + .then((response) => { | |
103 | + console.log(response); | |
104 | + let rsp = response.data; | |
105 | + if (rsp.Action == "玩家数据查询") { | |
106 | + this.textPlayerQueryResult = rsp.Result | |
107 | + } | |
108 | + }) | |
109 | + .catch(function (error) { | |
110 | + console.log(error); | |
111 | + }); | |
112 | + }, | |
113 | + onPlayerQuery(event) { | |
114 | + let v = event.srcElement.value | |
115 | + this.onGmPost({ | |
116 | + Action: '玩家数据查询', | |
117 | + Args: [v] | |
118 | + }) | |
119 | + }, | |
120 | + } | |
121 | +} | |
122 | +</script> | ... | ... |