소스 검색

refactor(reportProblems): 移除列表与详情的接口JSON调试弹窗

删除问题答复列表与详情页中的接口原始 JSON 调试入口、弹窗及相关状态样式,保留原有业务展示与请求流程。

Made-with: Cursor
haifeng.zhang 1 일 전
부모
커밋
86548bd557
3개의 변경된 파일4개의 추가작업 그리고 160개의 파일을 삭제
  1. 2 2
      src/api/questionReqort/types.ts
  2. 0 69
      src/subPages/pages/reportProblems/detail.vue
  3. 2 89
      src/subPages/pages/reportProblems/index.vue

+ 2 - 2
src/api/questionReqort/types.ts

@@ -51,9 +51,9 @@ export interface AddQuestionReportDataReq {
 /** 上报问题列表req */
 export interface PageQuestionReportDataReq extends PageReq {
   /**
-   * 登录 token
+   * 联系人(与“问题上报-您的姓名”一致)
    */
-  token: string
+  contactPerson: string
   /**
    * 问题标题
    */

+ 0 - 69
src/subPages/pages/reportProblems/detail.vue

@@ -14,8 +14,6 @@ import { computed, ref } from 'vue';
 
 
 const questDetail = ref<QuestionDetailRes>()
-const showRawJsonPopup = ref(false)
-const detailReqParams = ref<{ id: string } | null>(null)
 
 const statusText = computed(() => {
   const status = questDetail.value?.status
@@ -33,20 +31,8 @@ const personListText = computed(() => {
     .join('、')
 })
 
-const detailRawJson = computed(() => {
-  if (!questDetail.value) return '{}'
-  return JSON.stringify(questDetail.value, null, 2)
-})
-
-const detailReqParamsJson = computed(() => {
-  if (!detailReqParams.value) return '{}'
-  return JSON.stringify(detailReqParams.value, null, 2)
-})
-
 const loadDetail = async (id: string) => {
   questDetail.value = undefined
-  showRawJsonPopup.value = false
-  detailReqParams.value = { id }
   const { data } = await getQuestionReportDetail(id)
   questDetail.value = data
 }
@@ -60,9 +46,6 @@ onLoad(async (option) => {
 
 <template>
   <view class="p-[20px]">
-    <view class="mb-[8px]">
-      <van-button size="small" plain type="primary" @click="showRawJsonPopup = true">查看接口原始JSON</van-button>
-    </view>
     <view class="form-item">
       <view class="label">类型:</view>
       <view class="flex value">
@@ -113,24 +96,6 @@ onLoad(async (option) => {
       <view class="value" v-if="questDetail?.questionAnswer">{{ questDetail?.questionAnswer }}</view>
       <view class="value text-[#e3e3e3]" v-else>暂无</view>
     </view>
-
-    <van-popup
-      v-model:show="showRawJsonPopup"
-      round
-      position="bottom"
-      :style="{ height: '75%' }"
-    >
-      <view class="json-popup">
-        <view class="json-title">请求参数</view>
-        <scroll-view scroll-y class="json-scroll json-scroll--small">
-          <text class="json-text">{{ detailReqParamsJson }}</text>
-        </scroll-view>
-        <view class="json-title">详情接口完整JSON</view>
-        <scroll-view scroll-y class="json-scroll">
-          <text class="json-text">{{ detailRawJson }}</text>
-        </scroll-view>
-      </view>
-    </van-popup>
   </view>
 </template>
 
@@ -147,38 +112,4 @@ onLoad(async (option) => {
     word-break: break-all;
   }
 }
-
-.json-popup {
-  height: 100%;
-  display: flex;
-  flex-direction: column;
-  padding: 12px;
-}
-
-.json-title {
-  font-size: 16px;
-  font-weight: 500;
-  margin-bottom: 10px;
-}
-
-.json-scroll {
-  flex: 1;
-  overflow: hidden;
-  background: #f7f8fa;
-  border-radius: 8px;
-  padding: 12px;
-}
-
-.json-scroll--small {
-  flex: 0 0 auto;
-  max-height: 120px;
-  margin-bottom: 10px;
-}
-
-.json-text {
-  white-space: pre-wrap;
-  word-break: break-all;
-  font-size: 13px;
-  line-height: 20px;
-}
 </style>

+ 2 - 89
src/subPages/pages/reportProblems/index.vue

@@ -1,16 +1,13 @@
 <script lang="ts" setup>
 import { addQuestionReportData,REPORTDATA, getQuestionTypeList, pageQuestionReportData,getPerson } from '@/api/questionReqort'
 import { AddQuestionReportDataReq, PageQuestionReportDataReq, QuestionListRes, QuestionType, QuestionTypeListRes } from '@/api/questionReqort/types'
-import type { ApiResponse, PageResp } from '@/api/types'
-import type { AuthTokenChannelSnapshot } from '@/utils/request/requestHandler'
 import { getCachedWecomVisitorProfile, getWecomInternalUser } from '@/api/wecom'
-import { computed, onMounted, ref, watch } from 'vue'
+import { onMounted, ref, watch } from 'vue'
 import GridAddress from '@/components/address/gridAddress/index.vue'
 import { showNotify } from 'vant'
 import dayjs from 'dayjs';
 import { onLoad } from '@dcloudio/uni-app'
 import useUserState from '@/store/userState'
-import { getAuthTokenChannelSnapshot, resolveUserAuthToken } from '@/utils/request/requestHandler'
 
 const active = ref(0)
 const userState = useUserState()
@@ -230,29 +227,6 @@ const listLoadVersion = ref(0)
 /** 合并并发 init,避免 watch 与重复进入导致多次 reset/请求交错 */
 let listInitPromise: Promise<void> | null = null
 
-/** 列表接口调试:最近一次请求参数与完整响应 */
-const showListRawJsonPopup = ref(false)
-const listLastReqParams = ref<PageQuestionReportDataReq | null>(null)
-const listLastApiResponse = ref<ApiResponse<PageResp<QuestionListRes>> | null>(null)
-
-const listReqParamsJson = computed(() => {
-  if (!listLastReqParams.value) return '{}'
-  return JSON.stringify(listLastReqParams.value, null, 2)
-})
-
-const listApiRawJson = computed(() => {
-  if (!listLastApiResponse.value) return '{}'
-  return JSON.stringify(listLastApiResponse.value, null, 2)
-})
-
-/** 最近一次列表请求时的 token 各渠道快照(脱敏,用于弹窗诊断) */
-const listLastTokenDiag = ref<AuthTokenChannelSnapshot | null>(null)
-
-const listTokenDiagJson = computed(() => {
-  if (!listLastTokenDiag.value) return '{}'
-  return JSON.stringify(listLastTokenDiag.value, null, 2)
-})
-
 const resetQuestionList = () => {
   list.value = []
   pageInfo.value.pageNumber = 1
@@ -270,18 +244,14 @@ const questList = async () => {
   loading.value = true
   try {
     const currentPage = pageInfo.value.pageNumber
-    listLastTokenDiag.value = getAuthTokenChannelSnapshot()
-    const effectiveToken = resolveUserAuthToken()
     const reqParams: PageQuestionReportDataReq = {
       pageNumber: currentPage,
       pageSize: pageInfo.value.pageSize,
-      token: effectiveToken,
+      contactPerson: formData.value.contactPerson || '',
     }
     const res = await pageQuestionReportData(reqParams)
     if (requestVersion !== listLoadVersion.value) return
 
-    listLastReqParams.value = reqParams
-    listLastApiResponse.value = res
     const records = res.data.records || []
 
     list.value = currentPage === 1 ? records : list.value.concat(records)
@@ -410,9 +380,6 @@ watch(active, async (value) => {
     </van-tab>
     <van-tab title="问题答复">
       <view class="tab-container">
-        <view class="mb-[8px]">
-          <van-button size="small" plain type="primary" @click="showListRawJsonPopup = true">查看接口原始JSON</van-button>
-        </view>
         <van-list
           v-model:loading="loading"
           :finished="finished"
@@ -439,27 +406,6 @@ watch(active, async (value) => {
             </view>
           </view>
         </van-list>
-        <van-popup
-          v-model:show="showListRawJsonPopup"
-          round
-          position="bottom"
-          :style="{ height: '75%' }"
-        >
-          <view class="json-popup">
-            <view class="json-title">请求参数</view>
-            <scroll-view scroll-y class="json-scroll json-scroll--small">
-              <text class="json-text">{{ listReqParamsJson }}</text>
-            </scroll-view>
-            <view class="json-title">token 渠道诊断(明文)</view>
-            <scroll-view scroll-y class="json-scroll json-scroll--small">
-              <text class="json-text">{{ listTokenDiagJson }}</text>
-            </scroll-view>
-            <view class="json-title">列表接口完整JSON</view>
-            <scroll-view scroll-y class="json-scroll">
-              <text class="json-text">{{ listApiRawJson }}</text>
-            </scroll-view>
-          </view>
-        </van-popup>
       </view>
     </van-tab>
   </van-tabs>
@@ -525,37 +471,4 @@ watch(active, async (value) => {
   }
 }
 
-.json-popup {
-  height: 100%;
-  display: flex;
-  flex-direction: column;
-  padding: 12px;
-}
-
-.json-title {
-  font-size: 16px;
-  font-weight: 500;
-  margin-bottom: 10px;
-}
-
-.json-scroll {
-  flex: 1;
-  overflow: hidden;
-  background: #f7f8fa;
-  border-radius: 8px;
-  padding: 12px;
-}
-
-.json-scroll--small {
-  flex: 0 0 auto;
-  max-height: 120px;
-  margin-bottom: 10px;
-}
-
-.json-text {
-  white-space: pre-wrap;
-  word-break: break-all;
-  font-size: 13px;
-  line-height: 20px;
-}
 </style>