Commit a98b4e5b14171e3c0a83a9a45d8296718feb01b1

Authored by 王家文
1 parent f8e6ddfb
Exists in master

【工具】GM工具

Showing 1 changed file with 61 additions and 47 deletions   Show diff stats
src/components/PlayerEdit.vue
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <div class="col-1">选择服务器</div> 6 <div class="col-1">选择服务器</div>
7 <div class="col-2"> 7 <div class="col-2">
8 <el-select v-model="serverselected" placeholder="选择服务器"> 8 <el-select v-model="serverselected" placeholder="选择服务器">
9 - <el-option v-for="item in servers" :key="item.value" :label="item.label" :value="item.value"> 9 + <el-option v-for="item in servers" :key="item.value" :label="item.value" :value="item.value">
10 </el-option> 10 </el-option>
11 </el-select> 11 </el-select>
12 </div> 12 </div>
@@ -15,53 +15,44 @@ @@ -15,53 +15,44 @@
15 <el-input v-model="puid" placeholder="玩家唯一ID"></el-input> 15 <el-input v-model="puid" placeholder="玩家唯一ID"></el-input>
16 </div> 16 </div>
17 </div> 17 </div>
18 - <el-button round type="primary" class="btn-block" v-on:click="ontest">测试</el-button>  
19 </div> 18 </div>
20 </div> 19 </div>
21 20
22 -  
23 -  
24 - <!-- <div class="container-fluid mt-1">  
25 - <div class="container-fluid mt-1">  
26 - <div class="row bg-white">  
27 - <div class="col-2 p-3 bg-primary text-white">选择服务器</div>  
28 - <div class="col-3 p-3 bg-primary text-white">  
29 - <select v-model="serveradd" name="server">  
30 - <option value="http://localhost:9002/api/gm/action">本机</option>  
31 - <option value="http://localhost:9002/api/gm/action">内网测试服</option>  
32 - <option value="http://localhost:9002/api/gm/action">审核服</option>  
33 - </select>  
34 - </div>  
35 - <div class="col-2 p-3 bg-info text-white">玩家唯一ID</div>  
36 - <div class="col-3 p-3 bg-info text-white">  
37 - <input v-model="puid" placeholder="玩家唯一ID......">  
38 - </div>  
39 - </div>  
40 - </div>  
41 -  
42 - <div class="container-fluid mt-1"> 21 + <div class="container-fluid mt-1">
  22 + <div class="card">
43 <div class="row"> 23 <div class="row">
44 - <div class="col-3 card">  
45 - <div class="card-body">  
46 - <div class="d-grid">  
47 - <button type="button" class="btn btn-primary btn-block mt-1">货币添加</button>  
48 - </div>  
49 - <div class="d-grid">  
50 - <button type="button" class="btn btn-primary btn-block mt-1">货币添加</button>  
51 - </div>  
52 - <div class="d-grid">  
53 - <button type="button" class="btn btn-primary btn-block mt-1">货币添加</button>  
54 - </div> 24 + <div class="col-3">
  25 + <div class="card">
  26 + <el-form ref="form" :model="formAddMoney" label-width="80px">
  27 + <el-form-item label="货币类型">
  28 + <el-select v-model="formAddMoney.tp" placeholder="请选择货币类型">
  29 + <el-option label="金币" value="2"></el-option>
  30 + <el-option label="钻石" value="3"></el-option>
  31 + <el-option label="体力" value="4"></el-option>
  32 + <el-option label="经验值" value="1"></el-option>
  33 + </el-select>
  34 + </el-form-item>
  35 + <el-form-item label="添加值">
  36 + <el-input v-model="formAddMoney.count"></el-input>
  37 + </el-form-item>
  38 + <el-form-item>
  39 + <el-button type="primary" @click="onAddMoney">货币添加</el-button>
  40 + </el-form-item>
  41 + </el-form>
55 </div> 42 </div>
56 </div> 43 </div>
57 - <div class="col-3 p-3 bg-primary text-white">选择服务器</div>  
58 - <div class="col-3 p-3 bg-dark text-white"></div>  
59 - <div class="col-3 p-3 bg-dark text-white"></div> 44 + <div class="col-3">
  45 + </div>
  46 + <div class="col-3"></div>
  47 + <div class="col-3">
  48 + </div>
60 </div> 49 </div>
61 </div> 50 </div>
62 - </div> --> 51 + </div>
  52 +
63 53
64 <div id="output"> 54 <div id="output">
  55 + <el-button round type="primary" class="btn-block" v-on:click="ontest">测试</el-button>
65 选择的网站是: {{ serverselected }} puid: {{ puid }} 56 选择的网站是: {{ serverselected }} puid: {{ puid }}
66 </div> 57 </div>
67 </template> 58 </template>
@@ -76,25 +67,42 @@ export default { @@ -76,25 +67,42 @@ export default {
76 data() { 67 data() {
77 return { 68 return {
78 servers: [{ 69 servers: [{
79 - value: 'http://localhost:9002/api/gm/action',  
80 - label: '本机' 70 + value: '本机',
81 }, { 71 }, {
82 - value: 'http://172.10.10.18:9002/api/gm/action',  
83 - label: '内网测试服' 72 + value: '内网测试服',
84 }, { 73 }, {
85 - value: 'http://152.136.44.171:40002/api/gm/action',  
86 - label: '审核服' 74 + value: '审核服',
87 }], 75 }],
88 - serverselected: '', 76 + serversDict: {
  77 + '本机': 'http://localhost:9002/api/gm/action',
  78 + '内网测试服': 'http://172.10.10.18:9002/api/gm/action',
  79 + '审核服': 'http://152.136.44.171:40002/api/gm/action',
  80 + },
  81 + serverselected: '本机',
89 input1: '', 82 input1: '',
90 puid: '', 83 puid: '',
  84 +
  85 + formAddMoney: {
  86 + tp: '',
  87 + count: 0,
  88 + }
91 } 89 }
92 }, 90 },
93 methods: { 91 methods: {
  92 + onGmPost: function (data) {
  93 + data.Uid = this.puid
  94 + axios.post(this.serversDict[this.serverselected], data)
  95 + .then(function (response) {
  96 + console.log(response);
  97 + })
  98 + .catch(function (error) {
  99 + console.log(error);
  100 + });
  101 + },
94 ontest: function (event) { 102 ontest: function (event) {
95 axios.post(this.serverselected, { 103 axios.post(this.serverselected, {
96 - Action: '服务器操作',  
97 - Args: ["服务器信息"] 104 + Action: '服务器操作',
  105 + Args: ["服务器信息"]
98 }) 106 })
99 .then(function (response) { 107 .then(function (response) {
100 console.log(response); 108 console.log(response);
@@ -103,6 +111,12 @@ export default { @@ -103,6 +111,12 @@ export default {
103 console.log(error); 111 console.log(error);
104 }); 112 });
105 }, 113 },
  114 + onAddMoney() {
  115 + this.onGmPost({
  116 + Action: '玩家数据修改',
  117 + Args: ["货币添加",this.formAddMoney.tp,this.formAddMoney.count]
  118 + })
  119 + },
106 } 120 }
107 } 121 }
108 </script> 122 </script>