li.shaoyi 2 роки тому
батько
коміт
c20ef45cc0

+ 178 - 189
public/manifest.json

@@ -1,298 +1,287 @@
 {
-    "@platforms": [
-        "android",
-        "iPhone",
-        "iPad"
-    ],
-    "id": "H5E4A9458",
+    "@platforms" : [ "android", "iPhone", "iPad" ],
+    "id" : "H5E4A9458",
     /*应用的标识*/
-    "name": "铁合金掌上行",
+    "name" : "铁合金掌上行",
     /*应用名称,程序桌面图标名称*/
-    "version": {
-        "name": "1.0.0",
+    "version" : {
+        "name" : "1.0.0",
         /*应用版本名称*/
-        "code": 100000
+        "code" : 100000
     },
-    "description": "",
+    "description" : "",
     /*应用描述信息*/
-    "icons": {
-        "72": "icon.png"
+    "icons" : {
+        "72" : "icon.png"
     },
-    "launch_path": "index.html",
+    "launch_path" : "index.html",
     /*应用的入口页面,默认为根目录下的index.html;支持网络地址,必须以http://或https://开头*/
-    "developer": {
-        "name": "",
+    "developer" : {
+        "name" : "",
         /*开发者名称*/
-        "email": "",
+        "email" : "",
         /*开发者邮箱地址*/
-        "url": "" /*开发者个人主页地址*/
+        "url" : "" /*开发者个人主页地址*/
     },
-    "permissions": {
-        "Accelerometer": {
-            "description": "访问加速度感应器"
+    "permissions" : {
+        "Accelerometer" : {
+            "description" : "访问加速度感应器"
         },
-        "Audio": {
-            "description": "访问麦克风"
+        "Audio" : {
+            "description" : "访问麦克风"
         },
-        "Cache": {
-            "description": "管理应用缓存"
+        "Cache" : {
+            "description" : "管理应用缓存"
         },
-        "Camera": {
-            "description": "访问摄像头"
+        "Camera" : {
+            "description" : "访问摄像头"
         },
-        "Console": {
-            "description": "跟踪调试输出日志"
+        "Console" : {
+            "description" : "跟踪调试输出日志"
         },
-        "Device": {
-            "description": "访问设备信息"
+        "Device" : {
+            "description" : "访问设备信息"
         },
-        "Downloader": {
-            "description": "文件下载管理"
+        "Downloader" : {
+            "description" : "文件下载管理"
         },
-        "Events": {
-            "description": "应用扩展事件"
+        "Events" : {
+            "description" : "应用扩展事件"
         },
-        "File": {
-            "description": "访问本地文件系统"
+        "File" : {
+            "description" : "访问本地文件系统"
         },
-        "Gallery": {
-            "description": "访问系统相册"
+        "Gallery" : {
+            "description" : "访问系统相册"
         },
-        "Invocation": {
-            "description": "使用Native.js能力"
+        "Invocation" : {
+            "description" : "使用Native.js能力"
         },
-        "Orientation": {
-            "description": "访问方向感应器"
+        "Orientation" : {
+            "description" : "访问方向感应器"
         },
-        "Proximity": {
-            "description": "访问距离感应器"
+        "Proximity" : {
+            "description" : "访问距离感应器"
         },
-        "Storage": {
-            "description": "管理应用本地数据"
+        "Storage" : {
+            "description" : "管理应用本地数据"
         },
-        "Uploader": {
-            "description": "管理文件上传任务"
+        "Uploader" : {
+            "description" : "管理文件上传任务"
         },
-        "Runtime": {
-            "description": "访问运行期环境"
+        "Runtime" : {
+            "description" : "访问运行期环境"
         },
-        "XMLHttpRequest": {
-            "description": "跨域网络访问"
+        "XMLHttpRequest" : {
+            "description" : "跨域网络访问"
         },
-        "Zip": {
-            "description": "文件压缩与解压缩"
+        "Zip" : {
+            "description" : "文件压缩与解压缩"
         },
-        "Barcode": {
-            "description": "管理二维码扫描插件"
+        "Barcode" : {
+            "description" : "管理二维码扫描插件"
         },
-        "Webview": {
-            "description": "窗口管理"
+        "Webview" : {
+            "description" : "窗口管理"
         },
-        "NativeUI": {
-            "description": "原生UI控件"
+        "NativeUI" : {
+            "description" : "原生UI控件"
         },
-        "Navigator": {
-            "description": "浏览器信息"
+        "Navigator" : {
+            "description" : "浏览器信息"
         },
-        "NativeObj": {
-            "description": "原生对象"
+        "NativeObj" : {
+            "description" : "原生对象"
         }
     },
-    "plus": {
-        "modules": {
-            "Barcode": {},
-            "Camera": {},
-            "Gallery": {}
+    "plus" : {
+        "modules" : {
+            "Barcode" : {},
+            "Camera" : {},
+            "Gallery" : {}
         },
-        "statusbar": {
-            "immersed": true /*沉浸式状态栏。*/
+        "statusbar" : {
+            "immersed" : true /*沉浸式状态栏。*/
         },
-        "splashscreen": {
-            "autoclose": true,
+        "splashscreen" : {
+            "autoclose" : true,
             /*是否自动关闭程序启动界面,true表示应用加载应用入口页面后自动关闭;false则需调plus.navigator.closeSplashscreen()关闭*/
-            "waiting": true /*是否在程序启动界面显示等待雪花,true表示显示,false表示不显示。*/
+            "waiting" : true /*是否在程序启动界面显示等待雪花,true表示显示,false表示不显示。*/
         },
-        "popGesture": "close",
+        "popGesture" : "close",
         /*设置应用默认侧滑返回关闭Webview窗口,"none"为无侧滑返回功能,"hide"为侧滑隐藏Webview窗口。参考http://ask.dcloud.net.cn/article/102*/
-        "runmode": "normal",
+        "runmode" : "liberate",
         /*应用的首次启动运行模式,可取liberate或normal,liberate模式在第一次启动时将解压应用资源(Android平台File API才可正常访问_www目录)*/
-        "signature": "Sk9JTiBVUyBtYWlsdG86aHIyMDEzQGRjbG91ZC5pbw==",
+        "signature" : "Sk9JTiBVUyBtYWlsdG86aHIyMDEzQGRjbG91ZC5pbw==",
         /*可选,保留给应用签名,暂不使用*/
-        "distribute": {
-            "apple": {
-                "appid": "",
+        "distribute" : {
+            "apple" : {
+                "appid" : "",
                 /*iOS应用标识,苹果开发网站申请的appid,如io.dcloud.HelloH5*/
-                "mobileprovision": "",
+                "mobileprovision" : "",
                 /*iOS应用打包配置文件*/
-                "password": "",
+                "password" : "",
                 /*iOS应用打包个人证书导入密码*/
-                "p12": "",
+                "p12" : "",
                 /*iOS应用打包个人证书,打包配置文件关联的个人证书*/
-                "devices": "universal",
+                "devices" : "universal",
                 /*iOS应用支持的设备类型,可取值iphone/ipad/universal*/
-                "frameworks": [] /*调用Native.js调用原生Objective-c API需要引用的FrameWork,如需调用GameCenter,则添加"GameKit.framework"*/
+                "frameworks" : [] /*调用Native.js调用原生Objective-c API需要引用的FrameWork,如需调用GameCenter,则添加"GameKit.framework"*/
             },
-            "google": {
-                "packagename": "",
+            "google" : {
+                "packagename" : "",
                 /*Android应用包名,如io.dcloud.HelloH5*/
-                "keystore": "",
+                "keystore" : "",
                 /*Android应用打包使用的密钥库文件*/
-                "password": "",
+                "password" : "",
                 /*Android应用打包使用密钥库中证书的密码*/
-                "aliasname": "",
+                "aliasname" : "",
                 /*Android应用打包使用密钥库中证书的别名*/
-                "permissions": [],
-                "abiFilters": [
-                    "armeabi-v7a",
-                    "arm64-v8a"
-                ],
-                "autoSdkPermissions": false,
-                "minSdkVersion": 29
+                "permissions" : [],
+                "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
+                "autoSdkPermissions" : false,
+                "minSdkVersion" : 29
             },
             /*使用Native.js调用原生安卓API需要使用到的系统权限*/
-            "orientation": [
-                "portrait-primary"
-            ],
+            "orientation" : [ "portrait-primary" ],
             /*应用支持的方向,portrait-primary:竖屏正方向;portrait-secondary:竖屏反方向;landscape-primary:横屏正方向;landscape-secondary:横屏反方向*/
-            "icons": {
-                "ios": {
-                    "prerendered": true,
+            "icons" : {
+                "ios" : {
+                    "prerendered" : true,
                     /*应用图标是否已经高亮处理,在iOS6及以下设备上有效*/
-                    "auto": "",
+                    "auto" : "",
                     /*应用图标,分辨率:512x512,用于自动生成各种尺寸程序图标*/
-                    "iphone": {
-                        "normal": "",
+                    "iphone" : {
+                        "normal" : "",
                         /*iPhone3/3GS程序图标,分辨率:57x57*/
-                        "retina": "",
+                        "retina" : "",
                         /*iPhone4程序图标,分辨率:114x114*/
-                        "retina7": "",
+                        "retina7" : "",
                         /*iPhone4S/5/6程序图标,分辨率:120x120*/
-                        "retina8": "",
+                        "retina8" : "",
                         /*iPhone6 Plus程序图标,分辨率:180x180*/
-                        "spotlight-normal": "",
+                        "spotlight-normal" : "",
                         /*iPhone3/3GS Spotlight搜索程序图标,分辨率:29x29*/
-                        "spotlight-retina": "",
+                        "spotlight-retina" : "",
                         /*iPhone4 Spotlight搜索程序图标,分辨率:58x58*/
-                        "spotlight-retina7": "",
+                        "spotlight-retina7" : "",
                         /*iPhone4S/5/6 Spotlight搜索程序图标,分辨率:80x80*/
-                        "settings-normal": "",
+                        "settings-normal" : "",
                         /*iPhone4设置页面程序图标,分辨率:29x29*/
-                        "settings-retina": "",
+                        "settings-retina" : "",
                         /*iPhone4S/5/6设置页面程序图标,分辨率:58x58*/
-                        "settings-retina8": "", /*iPhone6Plus设置页面程序图标,分辨率:87x87*/
-                        "app@2x": "unpackage/res/icons/120x120.png",
-                        "app@3x": "unpackage/res/icons/180x180.png",
-                        "notification@2x": "unpackage/res/icons/40x40.png",
-                        "notification@3x": "unpackage/res/icons/60x60.png",
-                        "settings@2x": "unpackage/res/icons/58x58.png",
-                        "settings@3x": "unpackage/res/icons/87x87.png",
-                        "spotlight@2x": "unpackage/res/icons/80x80.png",
-                        "spotlight@3x": "unpackage/res/icons/120x120.png"
+                        "settings-retina8" : "", /*iPhone6Plus设置页面程序图标,分辨率:87x87*/
+                        "app@2x" : "unpackage/res/icons/120x120.png",
+                        "app@3x" : "unpackage/res/icons/180x180.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "notification@3x" : "unpackage/res/icons/60x60.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "settings@3x" : "unpackage/res/icons/87x87.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png",
+                        "spotlight@3x" : "unpackage/res/icons/120x120.png"
                     },
-                    "ipad": {
-                        "normal": "",
+                    "ipad" : {
+                        "normal" : "",
                         /*iPad普通屏幕程序图标,分辨率:72x72*/
-                        "retina": "",
+                        "retina" : "",
                         /*iPad高分屏程序图标,分辨率:144x144*/
-                        "normal7": "",
+                        "normal7" : "",
                         /*iPad iOS7程序图标,分辨率:76x76*/
-                        "retina7": "",
+                        "retina7" : "",
                         /*iPad iOS7高分屏程序图标,分辨率:152x152*/
-                        "spotlight-normal": "",
+                        "spotlight-normal" : "",
                         /*iPad Spotlight搜索程序图标,分辨率:50x50*/
-                        "spotlight-retina": "",
+                        "spotlight-retina" : "",
                         /*iPad高分屏Spotlight搜索程序图标,分辨率:100x100*/
-                        "spotlight-normal7": "",
+                        "spotlight-normal7" : "",
                         /*iPad iOS7 Spotlight搜索程序图标,分辨率:40x40*/
-                        "spotlight-retina7": "",
+                        "spotlight-retina7" : "",
                         /*iPad iOS7高分屏Spotlight搜索程序图标,分辨率:80x80*/
-                        "settings-normal": "",
+                        "settings-normal" : "",
                         /*iPad设置页面程序图标,分辨率:29x29*/
-                        "settings-retina": "", /*iPad高分屏设置页面程序图标,分辨率:58x58*/
-                        "app": "unpackage/res/icons/76x76.png",
-                        "app@2x": "unpackage/res/icons/152x152.png",
-                        "notification": "unpackage/res/icons/20x20.png",
-                        "notification@2x": "unpackage/res/icons/40x40.png",
-                        "proapp@2x": "unpackage/res/icons/167x167.png",
-                        "settings": "unpackage/res/icons/29x29.png",
-                        "settings@2x": "unpackage/res/icons/58x58.png",
-                        "spotlight": "unpackage/res/icons/40x40.png",
-                        "spotlight@2x": "unpackage/res/icons/80x80.png"
+                        "settings-retina" : "", /*iPad高分屏设置页面程序图标,分辨率:58x58*/
+                        "app" : "unpackage/res/icons/76x76.png",
+                        "app@2x" : "unpackage/res/icons/152x152.png",
+                        "notification" : "unpackage/res/icons/20x20.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "proapp@2x" : "unpackage/res/icons/167x167.png",
+                        "settings" : "unpackage/res/icons/29x29.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "spotlight" : "unpackage/res/icons/40x40.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png"
                     },
-                    "appstore": "unpackage/res/icons/1024x1024.png"
+                    "appstore" : "unpackage/res/icons/1024x1024.png"
                 },
-                "android": {
-                    "mdpi": "",
+                "android" : {
+                    "mdpi" : "",
                     /*普通屏程序图标,分辨率:48x48*/
-                    "ldpi": "",
+                    "ldpi" : "",
                     /*大屏程序图标,分辨率:48x48*/
-                    "hdpi": "unpackage/res/icons/72x72.png",
+                    "hdpi" : "unpackage/res/icons/72x72.png",
                     /*高分屏程序图标,分辨率:72x72*/
-                    "xhdpi": "unpackage/res/icons/96x96.png",
+                    "xhdpi" : "unpackage/res/icons/96x96.png",
                     /*720P高分屏程序图标,分辨率:96x96*/
-                    "xxhdpi": "unpackage/res/icons/144x144.png", /*1080P 高分屏程序图标,分辨率:144x144*/
-                    "xxxhdpi": "unpackage/res/icons/192x192.png"
+                    "xxhdpi" : "unpackage/res/icons/144x144.png", /*1080P 高分屏程序图标,分辨率:144x144*/
+                    "xxxhdpi" : "unpackage/res/icons/192x192.png"
                 }
             },
-            "splashscreen": {
-                "ios": {
-                    "iphone": {
-                        "default": "",
+            "splashscreen" : {
+                "ios" : {
+                    "iphone" : {
+                        "default" : "",
                         /*iPhone3启动图片选,分辨率:320x480*/
-                        "retina35": "",
+                        "retina35" : "",
                         /*3.5英寸设备(iPhone4)启动图片,分辨率:640x960*/
-                        "retina40": "",
+                        "retina40" : "",
                         /*4.0 英寸设备(iPhone5/iPhone5s)启动图片,分辨率:640x1136*/
-                        "retina47": "",
+                        "retina47" : "",
                         /*4.7 英寸设备(iPhone6)启动图片,分辨率:750x1334*/
-                        "retina55": "",
+                        "retina55" : "",
                         /*5.5 英寸设备(iPhone6 Plus)启动图片,分辨率:1242x2208*/
-                        "retina55l": "" /*5.5 英寸设备(iPhone6 Plus)横屏启动图片,分辨率:2208x1242*/
+                        "retina55l" : "" /*5.5 英寸设备(iPhone6 Plus)横屏启动图片,分辨率:2208x1242*/
                     },
-                    "ipad": {
-                        "portrait": "",
+                    "ipad" : {
+                        "portrait" : "",
                         /*iPad竖屏启动图片,分辨率:768x1004*/
-                        "portrait-retina": "",
+                        "portrait-retina" : "",
                         /*iPad高分屏竖屏图片,分辨率:1536x2008*/
-                        "landscape": "",
+                        "landscape" : "",
                         /*iPad横屏启动图片,分辨率:1024x748*/
-                        "landscape-retina": "",
+                        "landscape-retina" : "",
                         /*iPad高分屏横屏启动图片,分辨率:2048x1496*/
-                        "portrait7": "",
+                        "portrait7" : "",
                         /*iPad iOS7竖屏启动图片,分辨率:768x1024*/
-                        "portrait-retina7": "",
+                        "portrait-retina7" : "",
                         /*iPad iOS7高分屏竖屏图片,分辨率:1536x2048*/
-                        "landscape7": "",
+                        "landscape7" : "",
                         /*iPad iOS7横屏启动图片,分辨率:1024x768*/
-                        "landscape-retina7": "" /*iPad iOS7高分屏横屏启动图片,分辨率:2048x1536*/
+                        "landscape-retina7" : "" /*iPad iOS7高分屏横屏启动图片,分辨率:2048x1536*/
                     },
-                    "storyboard": "../ios/CustomStoryborad.zip"
+                    "storyboard" : "../ios/CustomStoryborad.zip"
                 },
-                "android": {
-                    "mdpi": "",
+                "android" : {
+                    "mdpi" : "",
                     /*普通屏启动图片,分辨率:240x282*/
-                    "ldpi": "",
+                    "ldpi" : "",
                     /*大屏启动图片,分辨率:320x442*/
-                    "hdpi": "../src/packages/mobile/assets/images/boot-480p.png",
+                    "hdpi" : "../src/packages/mobile/assets/images/boot-480p.png",
                     /*高分屏启动图片,分辨率:480x762*/
-                    "xhdpi": "../src/packages/mobile/assets/images/boot-720p.png",
+                    "xhdpi" : "../src/packages/mobile/assets/images/boot-720p.png",
                     /*720P高分屏启动图片,分辨率:720x1242*/
-                    "xxhdpi": "../src/packages/mobile/assets/images/boot-1080p.png" /*1080P高分屏启动图片,分辨率:1080x1882*/
+                    "xxhdpi" : "../src/packages/mobile/assets/images/boot-1080p.png" /*1080P高分屏启动图片,分辨率:1080x1882*/
                 },
-                "androidStyle": "default",
-                "iosStyle": "storyboard",
-                "useOriginalMsgbox": true
+                "androidStyle" : "default",
+                "iosStyle" : "storyboard",
+                "useOriginalMsgbox" : true
             },
-            "plugins": {
-                "ad": {},
-                "geolocation": {}
+            "plugins" : {
+                "ad" : {},
+                "geolocation" : {}
             },
-            "ios": {
-                "dSYMs": false
+            "ios" : {
+                "dSYMs" : false
             }
         }
     },
-    "screenOrientation": [
-        "portrait-primary"
-    ]
-}
+    "screenOrientation" : [ "portrait-primary" ]
+}

+ 2 - 2
src/packages/mobile/views/credit/signin/index.vue

@@ -86,7 +86,7 @@
                         <Button type="primary" round @click="toPurchase">去完成</Button>
                     </div>
                 </dd>
-                <dd class="list-item">
+                <!-- <dd class="list-item">
                     <div class="list-item__title">
                         <div class="title-icon">
                             <img src="@mobile/assets/icons/goods.png" />
@@ -99,7 +99,7 @@
                     <div class="list-item__button">
                         <Button type="primary" round @click="toSupplyDemand">去完成</Button>
                     </div>
-                </dd>
+                </dd> -->
             </dl>
         </div>
         <app-register-code v-model:show="showQRCode" :text="userAccount.refernum" />

+ 6 - 6
src/packages/mobile/views/home/index.vue

@@ -46,12 +46,12 @@ const tabList: Tabbar[] = [
     icon: 'icon-purchase',
     activeIcon: 'icon-purchase-active',
   },
-  {
-    name: 'supplyDemand',
-    label: '供求',
-    icon: 'icon-supply-demand',
-    activeIcon: 'icon-supply-demand-active',
-  },
+  // {
+  //   name: 'supplyDemand',
+  //   label: '供求',
+  //   icon: 'icon-supply-demand',
+  //   activeIcon: 'icon-supply-demand-active',
+  // },
   {
     name: 'mine',
     label: '我的',

+ 5 - 5
src/packages/mobile/views/mine/wareorder/list/components/holdlb/index.vue

@@ -26,7 +26,7 @@
                         </table>
                     </div>
                     <div class="section-item__btnbar">
-                        <Button size="small" round @click="listing(item)">挂牌</Button>
+                        <!-- <Button size="small" round @click="listing(item)">挂牌</Button> -->
                         <Button size="small" round @click="pickup(item)">提货</Button>
                     </div>
                 </li>
@@ -64,10 +64,10 @@ const pickup = (item: Model.HoldLBRsp) => {
     openComponent('pickup')
 }
 
-const listing = (item: Model.HoldLBRsp) => {
-    selectedRow.value = item
-    openComponent('listing')
-}
+// const listing = (item: Model.HoldLBRsp) => {
+//     selectedRow.value = item
+//     openComponent('listing')
+// }
 
 const onRefresh = (finish: () => void) => {
     /// 查询未完成

+ 73 - 27
src/services/http/index@next.ts

@@ -4,10 +4,33 @@ import axios, { AxiosRequestConfig, Method } from 'axios'
 //import cryptojs from 'crypto-js'
 //import { addPending, removePending } from './pending'
 import { loginStore } from '@/stores'
-import { HttpParams, CommonParams, HttpResponse, Payload, ResultCode } from './interface'
 import { useDataTable } from '@/hooks/datatable'
 import service from '@/services'
 
+/**
+ * Http 通用响应对象
+ */
+export interface CommonResult<T = unknown> {
+    code: ResultCode;
+    msg: string;
+    total: number;
+    data: T;
+}
+
+/**
+ * Http 响应结果状态码
+ */
+export enum ResultCode {
+    Success = 200, //成功
+    Error = 101, //发生错误
+    Fail = 102, //失败
+    Warning = 103, //非法请求
+    Unauthorized = 201, //授权失败
+    ParameterError = 202, //参数错误
+    InvalidToken = 203, //令牌无效
+    InvalidSign = 204, //签名无效
+}
+
 const httpService = new (class {
     private axiosInstance = axios.create({
         timeout: 30000,
@@ -90,8 +113,8 @@ const httpService = new (class {
         })
     }
 
-    httpRequest = async <T extends object>(url: string, method: Method, payload?: unknown, errMsg?: string) => {
-        const res = await this.commonRequest<HttpResponse<T>>(url, method, payload, errMsg)
+    httpRequest = async <T>(url: string, method: Method, payload?: unknown, errMsg?: string) => {
+        const res = await this.commonRequest<CommonResult<T>>(url, method, payload, errMsg)
 
         switch (res.code) {
             case ResultCode.InvalidToken:
@@ -112,42 +135,65 @@ function queryLoginData(params: Model.LoginQueryReq) {
 }
 
 interface RequestOptions<TParams, TResponse> {
-    params: {
+    params?: {
         page?: number; // 当前页码
         pagesize?: number; // 每页条数
     } & TParams;
-    pagination?: boolean; // 数据是否使用分页
+    localPagination?: boolean;
     delay?: number;
     onSuccess?: (res: TResponse) => void;
     onError?: (err: string) => void;
     onFinally?: () => void;
 }
 
-function useRequest<TParams extends object, TResponse extends HttpResponse<TResponse>>(request: (params: TParams) => Promise<TResponse>, options: RequestOptions<TParams, TResponse>) {
-    const { params, pagination, onSuccess, onError, onFinally } = options
-    const { dataList, filters, total, pageIndex, pageSize, pageCount } = useDataTable<TResponse['data']>({
-        pageSize: params.page,
-        pageIndex: params.pagesize,
-    })
+function useRequest<TParams extends object, TResponse>(request: (params: TParams) => Promise<TResponse>, options?: RequestOptions<TParams, TResponse>) {
+    const { params, localPagination, onSuccess, onError, onFinally } = options ?? {}
+
+    type Result = TResponse extends CommonResult ? TResponse['data'] : TResponse // 获取返回值的类型
+    type ResultType = Result extends (infer U)[] ? U : Result // 如果 U 是数组,取 U 的类型
 
+    const { dataList, filters, total, pageIndex, pageSize, pageCount } = useDataTable<ResultType>({
+        pagination: localPagination,
+        pageSize: params?.page,
+        pageIndex: params?.pagesize,
+    })
+    const data = ref<ResultType>()
     const loading = ref(false)
-    const data = ref<TResponse['data']>()
+
+    // 判断对象是否通用响应对象
+    const isCommonResult = (obj: unknown): obj is CommonResult => {
+        if (obj instanceof Object) {
+            return 'code' in obj && 'data' in obj
+        }
+        return false
+    }
 
     // 异步函数
     const runAsync = async (payload: Partial<TParams> = {}) => {
         try {
             loading.value = true
-            if (pagination) {
+            if (params && params.page && params.pagesize) {
                 params.page = pageIndex.value
                 params.pagesize = pageIndex.value
             }
-            const res = await request({ ...params, ...payload })
-            total.value = res.total
-            if (Array.isArray(res.data)) {
-                dataList.value = res.data
+
+            const res = await request({ ...params, ...payload } as TParams)
+
+            if (isCommonResult(res)) {
+                total.value = res.total
+                if (Array.isArray(res.data)) {
+                    dataList.value = res.data
+                } else {
+                    data.value = res.data as ResultType
+                }
             } else {
-                data.value = res.data
+                if (Array.isArray(res)) {
+                    dataList.value = res
+                } else {
+                    data.value = res as ResultType
+                }
             }
+
             return res
         } finally {
             loading.value = false
@@ -188,15 +234,15 @@ function useRequest<TParams extends object, TResponse extends HttpResponse<TResp
     }
 }
 
-// const { run, data, dataList } = useRequest(queryLoginData, {
-//     params: {
-//         loginID: 0,
-//     },
-//     onSuccess: (res) => {
-//         console.log(res)
-//         dataList.value = res.data
-//     },
-// })
+const { run, data, dataList } = useRequest(queryLoginData, {
+    params: {
+        loginID: 0,
+    },
+    onSuccess: (res) => {
+        console.log(res)
+        dataList.value = res.data
+    },
+})
 
 /**
  * 获取服务配置地址

+ 1 - 0
src/services/index.ts

@@ -37,6 +37,7 @@ export default new (class {
 
     /**
      * 自动初始化,若断网或其它原因导致初始化失败,需手动初始化
+     * IOS上架审核可能会遇到网络权限的情况,应用可能会在未授权网络权限的情况下发起请求,导致请求等待时间过长,最终审核被拒
      */
     //private onload = this.init()