Commit 1c48cdec08332b35e7ce7f348bedce47a11eaf8f
1 parent
93ab05b7
Exists in
master
【工具】GM工具
Showing
3 changed files
with
58 additions
and
7 deletions
Show diff stats
package.json
src/components/PlayerEdit.vue
| 1 | 1 | <template> |
| 2 | + | |
| 2 | 3 | <div class="container-fluid mt-1"> |
| 4 | + <div class="card"> | |
| 5 | + <div class="row"> | |
| 6 | + <div class="col-1">选择服务器</div> | |
| 7 | + <div class="col-2"> | |
| 8 | + <el-select v-model="serverselected" placeholder="选择服务器"> | |
| 9 | + <el-option v-for="item in servers" :key="item.value" :label="item.label" :value="item.value"> | |
| 10 | + </el-option> | |
| 11 | + </el-select> | |
| 12 | + </div> | |
| 13 | + <div class="col-1">玩家唯一ID</div> | |
| 14 | + <div class="col-2"> | |
| 15 | + <el-input v-model="puid" placeholder="玩家唯一ID"></el-input> | |
| 16 | + </div> | |
| 17 | + </div> | |
| 18 | + <el-button round type="primary" class="btn-block" v-on:click="ontest">测试</el-button> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + <!-- <div class="container-fluid mt-1"> | |
| 3 | 25 | <div class="container-fluid mt-1"> |
| 4 | 26 | <div class="row bg-white"> |
| 5 | 27 | <div class="col-2 p-3 bg-primary text-white">选择服务器</div> |
| ... | ... | @@ -37,16 +59,15 @@ |
| 37 | 59 | <div class="col-3 p-3 bg-dark text-white"></div> |
| 38 | 60 | </div> |
| 39 | 61 | </div> |
| 62 | + </div> --> | |
| 40 | 63 | |
| 41 | - | |
| 42 | - | |
| 43 | - </div> | |
| 44 | 64 | <div id="output"> |
| 45 | - 选择的网站是: {{ serveradd }} | |
| 65 | + 选择的网站是: {{ serverselected }} puid: {{ puid }} | |
| 46 | 66 | </div> |
| 47 | 67 | </template> |
| 48 | 68 | |
| 49 | 69 | <script> |
| 70 | +import axios from 'axios'; | |
| 50 | 71 | export default { |
| 51 | 72 | name: 'HelloWorld', |
| 52 | 73 | props: { |
| ... | ... | @@ -54,9 +75,29 @@ export default { |
| 54 | 75 | }, |
| 55 | 76 | data() { |
| 56 | 77 | return { |
| 57 | - serveradd: '', | |
| 58 | - puid: 0, | |
| 78 | + servers: [{ | |
| 79 | + value: 'http://localhost:9002/api/gm/action', | |
| 80 | + label: '本机' | |
| 81 | + }, { | |
| 82 | + value: 'http://172.10.10.18:9002/api/gm/action', | |
| 83 | + label: '内网测试服' | |
| 84 | + }, { | |
| 85 | + value: 'http://152.136.44.171:40002/api/gm/action', | |
| 86 | + label: '审核服' | |
| 87 | + }], | |
| 88 | + serverselected: '', | |
| 89 | + input1: '', | |
| 90 | + puid: '', | |
| 59 | 91 | } |
| 92 | + }, | |
| 93 | + methods: { | |
| 94 | + ontest: function (event) { | |
| 95 | + axios.get("http://localhost:9002/api/gm/action").then((response) => { | |
| 96 | + console.log(response.data) | |
| 97 | + }) | |
| 98 | + // let response = await axios.get('http://www.baidu.com/') | |
| 99 | + // message.value = response.data | |
| 100 | + }, | |
| 60 | 101 | } |
| 61 | 102 | } |
| 62 | 103 | </script> | ... | ... |
src/main.js
| ... | ... | @@ -4,4 +4,12 @@ import './index.css' |
| 4 | 4 | import 'bootstrap' |
| 5 | 5 | import 'bootstrap/dist/css/bootstrap.min.css' |
| 6 | 6 | |
| 7 | -createApp(App).mount('#app') | |
| 7 | +import ElementPlus from 'element-plus' | |
| 8 | +import 'element-plus/dist/index.css' | |
| 9 | + | |
| 10 | +const app = createApp(App) | |
| 11 | + | |
| 12 | +// app.use(ElementPlus) | |
| 13 | +app.use(ElementPlus, { size: 'small', zIndex: 3000 }) | |
| 14 | + | |
| 15 | +app.mount('#app') | ... | ... |