Commit 07c85ada7068294c1af22c18c7ec2f3b3b016068

Authored by 王家文
1 parent 4ccf58bc
Exists in master

【工具】GM工具

src/App.vue
... ... @@ -10,15 +10,6 @@
10 10 <li class="nav-item">
11 11 <a class="nav-link" href="#/playerquery">玩家查询</a>
12 12 </li>
13   - <li class="nav-item">
14   - <a class="nav-link" href="#/mail">邮件</a>
15   - </li>
16   - <li class="nav-item">
17   - <a class="nav-link" href="#/server">服务器</a>
18   - </li>
19   - <li class="nav-item">
20   - <a class="nav-link" href="#/other">其他</a>
21   - </li>
22 13 </ul>
23 14 </nav>
24 15  
... ... @@ -30,15 +21,9 @@ import { ref, computed } from &#39;vue&#39;
30 21 import NotFound from './components/NotFound.vue'
31 22 import Home from './components/PlayerEdit.vue'
32 23 import PlayerQuery from './components/PlayerQuery.vue'
33   -import Mail from './components/Mail.vue'
34   -import Server from './components/Server.vue'
35   -import Other from './components/Other.vue'
36 24 const routes = {
37 25 '/': Home,
38 26 '/playerquery': PlayerQuery,
39   - '/mail': Mail,
40   - '/server': Server,
41   - '/other': Other,
42 27 }
43 28 const currentPath = ref(window.location.hash)
44 29 window.addEventListener('hashchange', () => {
... ...
src/AppProd.vue 0 → 100644
... ... @@ -0,0 +1,50 @@
  1 +<template>
  2 +
  3 + <nav class="navbar navbar-expand-sm bg-primary navbar-dark">
  4 + <a class="navbar-brand" href="#">梦幻合合合</a>
  5 +
  6 + <ul class="navbar-nav">
  7 + <li class="nav-item">
  8 + <a class="nav-link" href="#">玩家修改</a>
  9 + </li>
  10 + <li class="nav-item">
  11 + <a class="nav-link" href="#/playerquery">玩家查询</a>
  12 + </li>
  13 + <li class="nav-item">
  14 + <a class="nav-link" href="#/mailsend">邮件发送</a>
  15 + </li>
  16 + <li class="nav-item">
  17 + <a class="nav-link" href="#/server">服务器</a>
  18 + </li>
  19 + <li class="nav-item">
  20 + <a class="nav-link" href="#/other">其他</a>
  21 + </li>
  22 + </ul>
  23 + </nav>
  24 +
  25 + <component :is="currentView" />
  26 +</template>
  27 +
  28 +<script setup>
  29 +import { ref, computed } from 'vue'
  30 +import NotFound from './components/NotFound.vue'
  31 +import Home from './components/PlayerEdit.vue'
  32 +import PlayerQuery from './components/PlayerQuery.vue'
  33 +import MailSend from './components/MailSend.vue'
  34 +import Server from './components/Server.vue'
  35 +import Other from './components/Other.vue'
  36 +const routes = {
  37 + '/': Home,
  38 + '/playerquery': PlayerQuery,
  39 + '/mailsend': MailSend,
  40 + '/server': Server,
  41 + '/other': Other,
  42 +}
  43 +const currentPath = ref(window.location.hash)
  44 +window.addEventListener('hashchange', () => {
  45 + currentPath.value = window.location.hash
  46 +})
  47 +const currentView = computed(() => {
  48 + return routes[currentPath.value.slice(1) || '/'] || NotFound
  49 +})
  50 +</script>
... ...
src/components/Mail.vue
... ... @@ -1,3 +0,0 @@
1   -<template>
2   - <h1>邮件</h1>
3   -</template>
4 0 \ No newline at end of file
src/components/MailSend.vue 0 → 100644
... ... @@ -0,0 +1,116 @@
  1 +<template>
  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="选择服务器" size="default">
  9 + <el-option v-for="item in servers" :key="item.value" :label="item.value" :value="item.value">
  10 + </el-option>
  11 + </el-select>
  12 + </div>
  13 + </div>
  14 + </div>
  15 + </div>
  16 +
  17 + <div class="container-fluid mt-1">
  18 + <div class="card">
  19 + <el-row>
  20 + <el-col :span="1" v-for="(text, index) of this.listPlayerQuery">
  21 + <button type="button" class="btn btn-info btn-block" :value=text @click="onPlayerQuery($event)">{{ text
  22 + }}</button>
  23 + </el-col>
  24 + </el-row>
  25 + <el-input type="textarea" :rows="50" placeholder="查询结果" v-model="textPlayerQueryResult">
  26 + </el-input>
  27 + </div>
  28 + </div>
  29 +
  30 +</template>
  31 +
  32 +<script>
  33 +import axios from 'axios';
  34 +import moment from 'moment';
  35 +export default {
  36 + name: 'HelloWorld',
  37 + props: {
  38 + msg: String
  39 + },
  40 + data() {
  41 + return {
  42 + servers: [{
  43 + value: '本机',
  44 + }, {
  45 + value: '内网测试服',
  46 + }, {
  47 + value: '审核服',
  48 + }, {
  49 + value: '正式服',
  50 + }],
  51 + serversDict: {
  52 + '本机': 'http://localhost:9002/api/gm/action',
  53 + '内网测试服': 'http://172.10.10.18:9002/api/gm/action',
  54 + '审核服': 'http://152.136.44.171:40002/api/gm/action',
  55 + '正式服': 'http://47.93.188.168:40002/api/gm/action',
  56 + },
  57 + serverselected: '本机',
  58 + puid: '1215485',
  59 +
  60 + listPlayerQuery: [
  61 + "基础数据",
  62 + "临时数据",
  63 + "杂项数据",
  64 + "邮件数据",
  65 + "背包数据",
  66 + "建筑数据",
  67 + "棋盘数据",
  68 + "支付数据",
  69 + "活动数据",
  70 + "订单数据",
  71 + "buff数据",
  72 + "商城数据",
  73 + "任务数据",
  74 + "卡牌数据",
  75 + "TopMini",
  76 + "副本数据",
  77 + ],
  78 + textPlayerQueryResult: '',
  79 +
  80 + }
  81 + },
  82 + mounted: function () {
  83 + console.log('1');
  84 + console.log(this.$gvEnv);
  85 + console.log('2');
  86 + },
  87 + methods: {
  88 + OnPop(body, title) {
  89 + this.$alert(body, title, {
  90 + confirmButtonText: '确定',
  91 + });
  92 + },
  93 + onGmPost: function (data) {
  94 + data.Uid = this.puid
  95 + axios.post(this.serversDict[this.serverselected], data)
  96 + .then((response) => {
  97 + console.log(response);
  98 + let rsp = response.data;
  99 + if (rsp.Action == "玩家数据查询") {
  100 + this.textPlayerQueryResult = rsp.Result
  101 + }
  102 + })
  103 + .catch(function (error) {
  104 + console.log(error);
  105 + });
  106 + },
  107 + onPlayerQuery(event) {
  108 + let v = event.srcElement.value
  109 + this.onGmPost({
  110 + Action: '玩家数据查询',
  111 + Args: [v]
  112 + })
  113 + },
  114 + }
  115 +}
  116 +</script>
... ...
src/components/PlayerEdit.vue
... ... @@ -255,10 +255,6 @@
255 255 </div>
256 256 </div>
257 257  
258   - <div id="output">
259   - <!-- <el-button round type="primary" class="btn-block" v-on:click="ontest">测试</el-button> -->
260   - <!-- 选择的服务器是: {{ serverselected }} puid: {{ puid }} -->
261   - </div>
262 258 </template>
263 259  
264 260 <script>
... ...
src/components/PlayerQuery.vue
... ... @@ -31,10 +31,6 @@
31 31 </div>
32 32 </div>
33 33  
34   - <div id="output">
35   - <!-- <el-button round type="primary" class="btn-block" v-on:click="ontest">测试</el-button> -->
36   - <!-- 选择的服务器是: {{ serverselected }} puid: {{ puid }} -->
37   - </div>
38 34 </template>
39 35  
40 36 <script>
... ... @@ -88,6 +84,9 @@ export default {
88 84 }
89 85 },
90 86 mounted: function () {
  87 + console.log('1');
  88 + console.log(this.$gvEnv);
  89 + console.log('2');
91 90 },
92 91 methods: {
93 92 OnPop(body, title) {
... ...
src/main.js
1 1 import { createApp } from 'vue'
2 2 import App from './App.vue'
  3 +import AppProd from './AppProd.vue'
3 4 import './index.css'
4 5 import 'bootstrap'
5 6 import 'bootstrap/dist/css/bootstrap.min.css'
... ... @@ -7,7 +8,14 @@ import &#39;bootstrap/dist/css/bootstrap.min.css&#39;
7 8 import ElementPlus from 'element-plus'
8 9 import 'element-plus/dist/index.css'
9 10  
10   -const app = createApp(App)
  11 +var app = createApp(App)
  12 +
  13 +// app.config.globalProperties.$gvEnv = 'dev';
  14 +app.config.globalProperties.$gvEnv = 'prod';
  15 +
  16 +if (app.config.globalProperties.$gvEnv == "prod"){
  17 + app = createApp(AppProd)
  18 +}
11 19  
12 20 // app.use(ElementPlus)
13 21 app.use(ElementPlus, { size: 'small', zIndex: 3000 })
... ...