瀏覽代碼

删除玩家

huwei 2 周之前
父節點
當前提交
5a5126e6fa

+ 3 - 2
server/internal/admin/gm_services/player.go

@@ -14,6 +14,7 @@ import (
 	"gadmin/utility/character"
 	"gadmin/utility/player"
 	"gadmin/utility/serializer"
+	"gadmin/utility/token"
 	"leafstalk/covenant/msg"
 	"os"
 	"strconv"
@@ -24,7 +25,7 @@ import (
 )
 
 func DeleteUserAccount(ctx *gin.Context, playerID int64) (err error) {
-	/*if playerID == 0 {
+	if playerID == 0 {
 		return errNoUser
 	}
 
@@ -61,7 +62,7 @@ func DeleteUserAccount(ctx *gin.Context, playerID int64) (err error) {
 		MsgID: msgs.MsgId,
 		Data:  resp,
 	}
-	*/
+
 	return
 }
 

+ 4 - 4
server/internal/admin/server/router.go

@@ -118,8 +118,8 @@ func NewEngine() *gin.Engine {
 			//auth.POST("userAccount/compatibilityTestVerify", api.CompatibilityTestVerify)
 			//auth.POST("userAccount/compatibilityTestMigrate", api.CompatibilityTestMigrate)
 			//auth.GET("playerMaterial/equipments", api.PlayerEquipments) // 玩家装备列表
-			auth.GET("playerAttr/get", api.PlayerAttrGet) // 获取指定玩家属性
-			//auth.GET("playerAttr/getAll", api.PlayerAttrGetAll)         // 获取指定玩家属性
+			auth.GET("playerAttr/get", api.PlayerAttrGet)       // 获取指定玩家属性
+			auth.GET("playerAttr/getAll", api.PlayerAttrGetAll) // 获取指定玩家属性
 
 			//auth.GET("order/userStatistics", api.OrderUserStatistics) // 获取指定玩家订单统计
 			//auth.GET("signin/count", api.SigninCount)                 // 获取指定玩家当月签到次数
@@ -265,8 +265,8 @@ func NewEngine() *gin.Engine {
 			//gm.POST("upgrade_role", api.UpgradeRole)
 			//gm.GET("get_role_level", api.GetRoleLevel) // 角色等级查询
 			//gm.POST("update_el_rank", api.UpdatePlayerElRank)
-			//gm.POST("delete_player", api.DeletePlayer)
-			//gm.POST("delete_account", api.DeleteAccount)
+			gm.POST("delete_player", api.DeletePlayer)
+			gm.POST("delete_account", api.DeleteAccount)
 			//gm.POST("openAccount", api.OpenAccount)
 			//gm.POST("delRank", api.DelRank)
 			gm.GET("getServerDate", api.GetServerDate)

+ 0 - 1
web/src/router/router-guards.ts

@@ -39,7 +39,6 @@ export function createRouterGuards(router: Router) {
     }
 
     const token = storage.get(ACCESS_TOKEN);
-
     if (!token) {
       window.open(getBaseLoginUrl(), '_self');
       next(PageEnum.BASE_LOGIN);

+ 68 - 64
web/src/views/account/accountList/components/DelVerifyUserInfo.vue

@@ -17,7 +17,7 @@
 
           <n-descriptions-item label="昵称">
             <n-space>
-              <span class="default_text_value" type="info">{{ user.nickname }}</span>
+              <span class="default_text_value" type="info">{{ userInfo.nick }}</span>
             </n-space>
           </n-descriptions-item>
 
@@ -39,7 +39,7 @@
             </n-space>
           </n-descriptions-item>
 
-          <n-descriptions-item label="近90天登录">
+          <!--          <n-descriptions-item label="近90天登录">
             <n-space>
               <span class="default_text_value">{{ attr.loginCount ?? 0 }}次</span>
             </n-space>
@@ -55,8 +55,8 @@
             <n-space>
               <span class="default_text_value">{{ attr.onlineDuration ?? '' }}</span>
             </n-space>
-          </n-descriptions-item>
-      
+          </n-descriptions-item>-->
+
           <n-descriptions-item label="注册时间(当前服)">
             <n-space>
               <span class="default_text_value">{{ user.createtime }}</span>
@@ -67,7 +67,6 @@
               <span class="default_text_value">{{ attr.lastlogintick ?? '' }}</span>
             </n-space>
           </n-descriptions-item>
-          
         </n-descriptions>
       </template>
     </n-card>
@@ -86,7 +85,7 @@
         size="large"
         v-show="!showModifyBase"
       >
-        <n-descriptions-item label="玩家金币">
+        <n-descriptions-item label="玩家等级">
           <!--  --><!-- <template #label>玩家等级</template> -->
           <n-space>
             <span class="default_text_value">{{ userInfo.userLevel }}</span>
@@ -94,18 +93,18 @@
         </n-descriptions-item>
         <n-descriptions-item label="玩家金币">
           <n-space>
-            <span class="default_text_value">{{ userInfo.coin }}</span>
+            <span class="default_text_value">{{ materials.coin }}</span>
           </n-space>
         </n-descriptions-item>
         <n-descriptions-item label="玩家钻石">
           <n-space>
-            <span class="default_text_value">{{ userInfo.diamond }}</span>
+            <span class="default_text_value">{{ materials.diamond }}</span>
           </n-space>
         </n-descriptions-item>
       </n-descriptions>
     </n-card>
 
-    <n-card
+    <!--    <n-card
       :bordered="true"
       title="充值与消费 (消费数据统计时间从2022年9月1日开始)"
       class="proCard mt-2"
@@ -126,7 +125,7 @@
           </n-descriptions-item>
         </n-descriptions>
       </template>
-    </n-card>
+    </n-card>-->
   </div>
 </template>
 
@@ -137,20 +136,19 @@
   import { timestampToTime } from '@/utils/dateUtil';
   import {
     getPlayerAttr,
-    getSigninCount,
+    // getSigninCount,
     getUserAccountInfo,
-    orderStatistics,
+    // orderStatistics,
   } from '@/api/account/list';
   import { UtilsTool } from '@/utils/macd/UtilsTool';
   import { RetrofitGroupOptions } from '@/api/echarts/rechargeList';
   //import { useRouter } from 'vue-router';
   import { getServerName } from '@/utils/admin';
 
-
   const singleBan = reactive({
     ban: false,
   });
-  
+
   const paySwitch = reactive({
     pay: false,
   });
@@ -169,14 +167,12 @@
     userInfo: userInfoObj,
   });
 
-
   //const router = useRouter();
   const retrofitOptions = ref([]);
   const message = useMessage();
   const loading = ref(false);
   const showModifyBase = ref(false);
 
-
   let user = reactive({
     openid: '',
     nickname: '',
@@ -188,10 +184,10 @@
   let attr = reactive({
     lastlogintick: '',
     lastlogouttick: '',
-    location: '',
-    signinCount: 0,
-    advCount: 0,
-    onlineDuration: '',
+    // location: '',
+    // signinCount: 0,
+    // advCount: 0,
+    // onlineDuration: '',
     serverId: 0,
     accId: 0,
     openId: '',
@@ -210,11 +206,16 @@
     rechargeAmount: 0,
   });
 
+  const materials = reactive({
+    coin: 0,
+    diamond: 0,
+  });
 
   function loadBaseInfo() {
     new Promise((_resolve, _reject) => {
       getUserAccountInfo({ playerid: props.userId })
         .then((res) => {
+          console.log('getUserAccountInfo res::', res);
           // 用户信息
           // user.openid = res.openid;
           // user.nickname = res.nickname;
@@ -232,23 +233,27 @@
     new Promise((_resolve, _reject) => {
       getPlayerAttr({ playerid: props.userId })
         .then((res) => {
+          console.log('getPlayerAttr res::', res);
           // 属性
           attr.lastlogintick = res.lastlogintick > 0 ? timestampToTime(res.lastlogintick) : '';
           attr.lastlogouttick = res.lastlogouttick > 0 ? timestampToTime(res.lastlogouttick) : '';
-          if (res.location !== null && res.location !== '') {
-            attr.location = res.location.slice(0, -2);
-          }
+          // if (res.location !== null && res.location !== '') {
+          //   attr.location = res.location.slice(0, -2);
+          // }
 
-          attr.advCount = res.advCount;
-          attr.onlineDuration = res.onlineDuration;
+          // attr.advCount = res.advCount;
+          // attr.onlineDuration = res.onlineDuration;
           attr.accId = res.accId;
-          attr.serverId = res.serverId;
+          attr.serverId = res.line;
           attr.openId = res.openId;
           user.nickname = res.nickName;
           user.createtime = res.create_time > 0 ? timestampToTime(res.create_time) : '';
 
           paySwitch.pay = res.paySwitch == 1;
-          
+          const userMaterials = JSON.parse(res.materials);
+          console.log('userMaterials::', userMaterials);
+          materials.coin = userMaterials[3001];
+          materials.diamond = userMaterials[3002];
         })
         .catch((error) => {
           // message.error(error.toString());
@@ -256,41 +261,41 @@
         });
     });
 
-    new Promise((_resolve, _reject) => {
-      orderStatistics({ playerid: props.userId })
-        .then((res) => {
-          if (res.orderPlatform == 1) {
-            order.orderPlatform = '安卓';
-          } else {
-            order.orderPlatform = '苹果';
-          }
-
-          order.rechargeCount = res.rechargeCount;
-          order.rechargeDiamondCount = res.rechargeDiamondCount;
-          order.rechargeAmount = res.rechargeAmount;
-          order.firstChargeAt = res.firstChargeAt > 0 ? timestampToTime(res.firstChargeAt) : '';
-          order.lastChargeAt = res.lastChargeAt > 0 ? timestampToTime(res.lastChargeAt) : '';
-
-          order.consumptionCoinCount = UtilsTool.unitConversion(res.consumptionCoinCount);
-          order.consumptionDiamondCount = UtilsTool.unitConversion(res.consumptionDiamondCount);
-        })
-        .catch((error) => {
-          // message.error(error.toString());
-          console.log('error:' + error.toString());
-        });
-    });
-
-    new Promise((_resolve, _reject) => {
-      getSigninCount({ playerid: props.userId })
-        .then((res) => {
-          attr.signinCount = res.signinCount;
-          attr.loginCount = res.loginCount;
-        })
-        .catch((e: Error) => {
-          // message.error(e.message ?? '操作失败');
-          console.log('error:' + e.message);
-        });
-    });
+    // new Promise((_resolve, _reject) => {
+    //   orderStatistics({ playerid: props.userId })
+    //     .then((res) => {
+    //       if (res.orderPlatform == 1) {
+    //         order.orderPlatform = '安卓';
+    //       } else {
+    //         order.orderPlatform = '苹果';
+    //       }
+    //
+    //       order.rechargeCount = res.rechargeCount;
+    //       order.rechargeDiamondCount = res.rechargeDiamondCount;
+    //       order.rechargeAmount = res.rechargeAmount;
+    //       order.firstChargeAt = res.firstChargeAt > 0 ? timestampToTime(res.firstChargeAt) : '';
+    //       order.lastChargeAt = res.lastChargeAt > 0 ? timestampToTime(res.lastChargeAt) : '';
+    //
+    //       order.consumptionCoinCount = UtilsTool.unitConversion(res.consumptionCoinCount);
+    //       order.consumptionDiamondCount = UtilsTool.unitConversion(res.consumptionDiamondCount);
+    //     })
+    //     .catch((error) => {
+    //       // message.error(error.toString());
+    //       console.log('error:' + error.toString());
+    //     });
+    // });
+
+    // new Promise((_resolve, _reject) => {
+    //   getSigninCount({ playerid: props.userId })
+    //     .then((res) => {
+    //       attr.signinCount = res.signinCount;
+    //       attr.loginCount = res.loginCount;
+    //     })
+    //     .catch((e: Error) => {
+    //       // message.error(e.message ?? '操作失败');
+    //       console.log('error:' + e.message);
+    //     });
+    // });
   }
 
   watch(props, (_newVal, _oldVal) => {
@@ -298,7 +303,7 @@
   });
 
   onMounted(async () => {
-    console.log(props)
+    console.log(props);
     if (props.userId < 1) {
       console.log('传入用户信息不正确,props.userId:', props.userId);
       return;
@@ -320,7 +325,6 @@
         });
     });
   }
-
 </script>
 
 <style lang="less" scoped>

+ 86 - 91
web/src/views/account/accountList/components/DelVerifyUserInfos.vue

@@ -8,73 +8,71 @@
       :segmented="{ content: true }"
     >
       <n-skeleton v-if="loading" text :repeat="6" />
-        <template v-else>
-          <template v-for="item in attrs" >
-            <n-space vertical  size="medium" style="margin-bottom:15px" >
-              <n-descriptions label-placement="left" label-align="left" :column="4" size="large" class="n-space">
-            <n-descriptions-item>
-              <template #label>玩家ID</template>
-              <span class="default_text_value">{{ item.playerId }}</span>
-            </n-descriptions-item>
-            
-            <n-descriptions-item>
-              <template #label>玩家等级</template>
-              <span class="default_text_value">{{ item.level }}</span>
-            </n-descriptions-item>
-
-            <n-descriptions-item label="昵称">
-              <n-space>
-                <span class="default_text_value" type="info">{{ item.nickname }}</span>
-              </n-space>
-            </n-descriptions-item>
-
-            <n-descriptions-item label="openid">
-              <n-space>
-                <span class="default_text_value">{{ item.openId }}</span>
-              </n-space>
-            </n-descriptions-item>
-
-            <n-descriptions-item label="服务器">
-              <n-space>
-                <span class="default_text_value">{{ getServerName(item.serverId) }}</span>
-              </n-space>
-            </n-descriptions-item>
-
-            <n-descriptions-item label="账号ID">
-              <n-space>
-                <span class="default_text_value">{{ item.accId ?? '' }}</span>
-              </n-space>
-            </n-descriptions-item>
-        
-            <n-descriptions-item label="注册时间">
-              <n-space>
-                <span class="default_text_value">{{ item.createtime }}</span>
-              </n-space>
-            </n-descriptions-item>
-
-              </n-descriptions>
-            </n-space>  
-
-        </template>
-
+      <template v-else>
+        <template v-for="item in attrs">
+          <n-space vertical size="medium" style="margin-bottom: 15px">
+            <n-descriptions
+              label-placement="left"
+              label-align="left"
+              :column="4"
+              size="large"
+              class="n-space"
+            >
+              <n-descriptions-item>
+                <template #label>玩家ID</template>
+                <span class="default_text_value">{{ item.playerId }}</span>
+              </n-descriptions-item>
+
+              <n-descriptions-item>
+                <template #label>玩家等级</template>
+                <span class="default_text_value">{{ item.level }}</span>
+              </n-descriptions-item>
+
+              <n-descriptions-item label="昵称">
+                <n-space>
+                  <span class="default_text_value" type="info">{{ item.nickname }}</span>
+                </n-space>
+              </n-descriptions-item>
+
+              <n-descriptions-item label="openid">
+                <n-space>
+                  <span class="default_text_value">{{ item.openId }}</span>
+                </n-space>
+              </n-descriptions-item>
+
+              <n-descriptions-item label="服务器">
+                <n-space>
+                  <span class="default_text_value">{{ getServerName(item.serverId) }}</span>
+                </n-space>
+              </n-descriptions-item>
+
+              <n-descriptions-item label="账号ID">
+                <n-space>
+                  <span class="default_text_value">{{ item.accId ?? '' }}</span>
+                </n-space>
+              </n-descriptions-item>
+
+              <n-descriptions-item label="注册时间">
+                <n-space>
+                  <span class="default_text_value">{{ item.createtime }}</span>
+                </n-space>
+              </n-descriptions-item>
+            </n-descriptions>
+          </n-space>
         </template>
-
+      </template>
     </n-card>
   </div>
 </template>
 
 <script lang="ts" setup>
   import { onMounted, ref, watch } from 'vue';
-  import { timestampToTime,formatToDateTime } from '@/utils/dateUtil';
-  import {
-    getPlayerAttrAll,
-  } from '@/api/account/list';
+  import { timestampToTime, formatToDateTime } from '@/utils/dateUtil';
+  import { getPlayerAttrAll } from '@/api/account/list';
   import { RetrofitGroupOptions } from '@/api/echarts/rechargeList';
   //import { useRouter } from 'vue-router';
   import { getServerName } from '@/utils/admin';
-import { Ref } from 'vue';
-
-
+  import { Ref } from 'vue';
 
   interface Props {
     userId?: number;
@@ -84,7 +82,6 @@ import { Ref } from 'vue';
     userId: 0,
   });
 
-
   //const router = useRouter();
   const retrofitOptions = ref([]);
   const loading = ref(false);
@@ -92,9 +89,9 @@ import { Ref } from 'vue';
   interface attr {
     lastlogintick: string;
     lastlogouttick: string;
-    location: string;
-    advCount: number;
-    onlineDuration: string;
+    // location: string;
+    // advCount: number;
+    // onlineDuration: string;
     serverId: number;
     accId: number;
     openId: string;
@@ -106,35 +103,34 @@ import { Ref } from 'vue';
 
   const attrs: Ref<attr[]> = ref([]);
 
-
-
   function loadBaseInfo() {
-      getPlayerAttrAll({ accId: props.userId })
-        .then((res) => {
-          console.log('res::' + JSON.stringify(res));
-          for (let index = 0; index < res.length; index++) {
-            const r = res[index];
-            // 属性
-            attrs.value.push({
-              lastlogintick: r.lastlogintick > 0 ? timestampToTime(r.lastlogintick) : '',
-              lastlogouttick: r.lastlogouttick > 0 ? timestampToTime(r.lastlogouttick) : '',
-              location: r.location !== null && r.location !== '' ? r.location.slice(0, -2) : '',
-              advCount: r.advCount,
-              onlineDuration: r.onlineDuration,
-              accId: r.accId,
-              serverId: r.serverId,
-              openId: r.openId,
-              nickname: r.nickName,
-              createtime: r.create_time,
-              playerId:r.playerid,
-              level:r.level
-            })
-          } 
-        })
-        .catch((error) => {
-          // message.error(error.toString());
-          console.log('error:' + error.toString());
-        });
+    getPlayerAttrAll({ accId: props.userId })
+      .then((res) => {
+        console.log('res::' + JSON.stringify(res));
+        for (let index = 0; index < res.length; index++) {
+          const r = res[index];
+          console.log('r::', r);
+          // 属性
+          attrs.value.push({
+            lastlogintick: r.lastlogintick > 0 ? timestampToTime(r.lastlogintick) : '',
+            lastlogouttick: r.lastlogouttick > 0 ? timestampToTime(r.lastlogouttick) : '',
+            // location: r.location !== null && r.location !== '' ? r.location.slice(0, -2) : '',
+            // advCount: r.advCount,
+            // onlineDuration: r.onlineDuration,
+            accId: r.accId,
+            serverId: r.line,
+            openId: r.openId,
+            nickname: r.nickName,
+            createtime: r.create_time,
+            playerId: r.playerid,
+            level: r.level,
+          });
+        }
+      })
+      .catch((error) => {
+        // message.error(error.toString());
+        console.log('error:' + error.toString());
+      });
   }
 
   watch(props, (_newVal, _oldVal) => {
@@ -142,7 +138,7 @@ import { Ref } from 'vue';
   });
 
   onMounted(async () => {
-    console.log(props)
+    console.log(props);
     if (props.userId < 1) {
       console.log('传入用户信息不正确,props.userId:', props.userId);
       return;
@@ -164,7 +160,6 @@ import { Ref } from 'vue';
         });
     });
   }
-
 </script>
 
 <style lang="less" scoped>