Xiao_123 1 hónapja
szülő
commit
c02a6c59ed

+ 1 - 0
src/api/infra/apiAccessLog/index.ts

@@ -14,6 +14,7 @@ export interface ApiAccessLogVO {
   userAgent: string
   operateModule: string
   operateName: string
+  userNickName: string
   operateType: number
   beginTime: Date
   endTime: Date

+ 2 - 3
src/views/infra/apiAccessLog/ApiAccessLogDetail.vue

@@ -10,9 +10,8 @@
       <el-descriptions-item label="应用名">
         {{ detailData.applicationName }}
       </el-descriptions-item>
-      <el-descriptions-item label="用户信息">
-        {{ detailData.userId }}
-        <dict-tag :type="DICT_TYPE.USER_TYPE" :value="detailData.userType" />
+      <el-descriptions-item label="操作用户">
+        {{ detailData.userNickName || '游客' }}
       </el-descriptions-item>
       <el-descriptions-item label="用户 IP">
         {{ detailData.userIp }}

+ 23 - 60
src/views/infra/apiAccessLog/index.vue

@@ -9,39 +9,6 @@
       :inline="true"
       label-width="68px"
     >
-      <el-form-item label="用户编号" prop="userId">
-        <el-input
-          v-model="queryParams.userId"
-          placeholder="请输入用户编号"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item label="用户类型" prop="userType">
-        <el-select
-          v-model="queryParams.userType"
-          placeholder="请选择用户类型"
-          clearable
-          class="!w-240px"
-        >
-          <el-option
-            v-for="dict in getIntDictOptions(DICT_TYPE.USER_TYPE)"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="应用名" prop="applicationName">
-        <el-input
-          v-model="queryParams.applicationName"
-          placeholder="请输入应用名"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
       <el-form-item label="请求时间" prop="beginTime">
         <el-date-picker
           v-model="queryParams.beginTime"
@@ -53,15 +20,6 @@
           class="!w-240px"
         />
       </el-form-item>
-      <el-form-item label="执行时长" prop="duration">
-        <el-input
-          v-model="queryParams.duration"
-          placeholder="请输入执行时长"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
       <el-form-item label="结果码" prop="resultCode">
         <el-input
           v-model="queryParams.resultCode"
@@ -90,36 +48,41 @@
   <!-- 列表 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list">
-      <el-table-column label="日志编号" align="center" prop="id" width="100" fix="right" />
-      <el-table-column label="用户编号" align="center" prop="userId" />
-      <el-table-column label="用户类型" align="center" prop="userType">
+      <!-- <el-table-column label="日志编号" align="center" prop="id" width="100" fix="right" /> -->
+      <el-table-column label="操作用户" align="center" prop="userNickName">
+        <template #default="scope">{{ scope.row.userNickName || '游客' }}</template>
+      </el-table-column>
+      <el-table-column label="操作名" align="center" prop="operateName" width="180" />
+      <el-table-column label="操作模块" align="center" prop="operateModule" width="180" />
+      <!-- <el-table-column label="用户类型" align="center" prop="userType">
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType" />
         </template>
-      </el-table-column>
-      <el-table-column label="应用名" align="center" prop="applicationName" width="150" />
-      <el-table-column label="请求方法" align="center" prop="requestMethod" width="80" />
-      <el-table-column label="请求地址" align="center" prop="requestUrl" width="500" />
-      <el-table-column label="请求时间" align="center" prop="beginTime" width="180">
+      </el-table-column> -->
+      <!-- <el-table-column label="应用名" align="center" prop="applicationName" width="150" /> -->
+      <!-- <el-table-column label="请求方法" align="center" prop="requestMethod" width="80" /> -->
+      <el-table-column label="操作类型" align="center" prop="operateType">
         <template #default="scope">
-          <span>{{ formatDate(scope.row.beginTime) }}</span>
+          <dict-tag :type="DICT_TYPE.INFRA_OPERATE_TYPE" :value="scope.row.operateType" />
         </template>
       </el-table-column>
-      <el-table-column label="执行时长" align="center" prop="duration" width="180">
-        <template #default="scope"> {{ scope.row.duration }} ms </template>
-      </el-table-column>
       <el-table-column label="操作结果" align="center" prop="status">
         <template #default="scope">
-          {{ scope.row.resultCode === 0 ? '成功' : '失败(' + scope.row.resultMsg + ')' }}
+          <span :style="{'color': scope.row.resultCode === 0 ? '#67c23a' : '#f56c6c'}">
+            {{ scope.row.resultCode === 0 ? '成功' : '失败(' + scope.row.resultMsg + ')' }}
+          </span>
         </template>
       </el-table-column>
-      <el-table-column label="操作模块" align="center" prop="operateModule" width="180" />
-      <el-table-column label="操作名" align="center" prop="operateName" width="180" />
-      <el-table-column label="操作类型" align="center" prop="operateType">
+      <el-table-column label="结果码" align="center" prop="resultCode" />
+      <el-table-column label="请求时间" align="center" prop="beginTime" width="180">
         <template #default="scope">
-          <dict-tag :type="DICT_TYPE.INFRA_OPERATE_TYPE" :value="scope.row.operateType" />
+          <span>{{ formatDate(scope.row.beginTime) }}</span>
         </template>
       </el-table-column>
+      <!-- <el-table-column label="请求地址" align="center" prop="requestUrl" width="500" /> -->
+      <!-- <el-table-column label="执行时长" align="center" prop="duration" width="180">
+        <template #default="scope"> {{ scope.row.duration }} ms </template>
+      </el-table-column> -->
       <el-table-column label="操作" align="center" fixed="right" width="60">
         <template #default="scope">
           <el-button
@@ -128,7 +91,7 @@
             @click="openDetail(scope.row)"
             v-hasPermi="['infra:api-access-log:query']"
           >
-            详
+            详
           </el-button>
         </template>
       </el-table-column>