chen.cheng 8 miesięcy temu
rodzic
commit
a596de333f

+ 2 - 0
.env.dev

@@ -1,3 +1,5 @@
 //.env.dev
 
 VITE_BASE_URL=http://172.192.10.105:30016/api
+
+VITE_IMG_CDN=http://aiot.xt.wenhq.top:8083/

+ 10 - 0
src/api/device.js

@@ -0,0 +1,10 @@
+import {post} from "@/util/request/index.js";
+import {Page} from "@/common/consts/CommonConst";
+
+export const getDeviceList = async ({page = Page.page, size = Page.size, ...params}) => {
+  return await post('/device/getDeviceList', {
+    page,
+    size,
+    ...params
+  });
+}

+ 2 - 1
src/common/config.js

@@ -1,3 +1,4 @@
 export default {
-    baseUrl: import.meta.env.VITE_BASE_URL
+  baseUrl: import.meta.env.VITE_BASE_URL,
+  imgCdn: import.meta.env.VITE_IMG_CDN
 }

+ 14 - 0
src/common/consts/CommonConst.js

@@ -0,0 +1,14 @@
+export const Page = {
+  page: 1,
+  size: 10,
+}
+export const Rules = {
+  domainPort: /^[https|http]+:\/\/[^/]+\//
+}
+
+export const valueToConst = (cnst, value) => {
+  const key = Object.keys(cnst).find((key) => {
+    return cnst[key].value === value
+  })
+  return key ? cnst[key] : {}
+}

+ 28 - 24
src/common/consts/DeviceConst.js

@@ -1,26 +1,30 @@
 export const DeviceState = {
-    ALL: {
-        value: "",
-        label: '全部'
-    },
-    // 未激活
-    UNACTIVATED: {
-        value: 1,
-        label: '未激活'
-    },
-    // 未知
-    // UNKNOWN: {
-    //     value: 2,
-    //     label: '未知'
-    // },
-    // 离线
-    OFFLINE: {
-        value: 3,
-        label: '离线'
-    },
-    // 在线
-    ONLINE: {
-        value: 4,
-        label: '在线'
-    }
+  ALL: {
+    value: "",
+    label: '全部'
+  },
+  // 未激活
+  UNACTIVATED: {
+    value: 1,
+    label: '未激活',
+    color: '#979aa3'
+  },
+  // 未知
+  UNKNOWN: {
+    value: 2,
+    label: '未知',
+    color: '#979aa3'
+  },
+  // 离线
+  OFFLINE: {
+    value: 3,
+    label: '离线',
+    color: '#f95f5e'
+  },
+  // 在线
+  ONLINE: {
+    value: 4,
+    label: '在线',
+    color: '#52c41a'
+  }
 };

+ 161 - 153
src/manifest.json

@@ -1,165 +1,173 @@
 {
-    "name" : "UviewPlus",
-    "appid" : "__UNI__B40A6DC",
-    "description" : "多平台快速开发的UI框架",
-    "versionName" : "3.1.52",
-    "versionCode" : 1,
-    "transformPx" : false,
-    "app-plus" : {
-        "optimization" : {
-            "subPackages" : true
-        },
-        "safearea" : {
-            "bottom" : {
-                "offset" : "none"
-            }
-        },
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
-            "waiting" : true,
-            "autoclose" : true,
-            "delay" : 0
-        },
-        "usingComponents" : true,
-        "nvueCompiler" : "uni-app",
-        "compilerVersion" : 3,
-        "modules" : {
-            "Webview-x5" : {}
-        },
-        "distribute" : {
-            "android" : {
-                "permissions" : [
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
-                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-                ],
-                "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
-                "minSdkVersion" : 21
-            },
-            "ios" : {
-                "idfa" : false,
-                "dSYMs" : false
-            },
-            "sdkConfigs" : {
-                "ad" : {}
-            },
-            "icons" : {
-                "android" : {
-                    "hdpi" : "unpackage/res/icons/72x72.png",
-                    "xhdpi" : "unpackage/res/icons/96x96.png",
-                    "xxhdpi" : "unpackage/res/icons/144x144.png",
-                    "xxxhdpi" : "unpackage/res/icons/192x192.png"
-                },
-                "ios" : {
-                    "appstore" : "unpackage/res/icons/1024x1024.png",
-                    "ipad" : {
-                        "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"
-                    },
-                    "iphone" : {
-                        "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"
-                    }
-                }
-            }
-        }
+  "name": "UviewPlus",
+  "appid": "__UNI__B40A6DC",
+  "description": "多平台快速开发的UI框架",
+  "versionName": "3.1.52",
+  "versionCode": 1,
+  "transformPx": false,
+  "app-plus": {
+    "optimization": {
+      "subPackages": true
     },
-    "quickapp" : {},
-    "mp-weixin" : {
-        "appid" : "wxf385eefdd03327fd",
-        "setting" : {
-            "urlCheck" : false,
-            "es6" : true,
-            "minified" : true,
-            "postcss" : false
-        },
-        "optimization" : {
-            "subPackages" : true
-        },
-        "mergeVirtualHostAttributes" : true,
-        "lazyCodeLoading" : "requiredComponents",
-        "usingComponents" : true
+    "safearea": {
+      "bottom": {
+        "offset": "none"
+      }
     },
-    "mp-alipay" : {
-        "usingComponents" : true,
-        "component2" : true
+    "splashscreen": {
+      "alwaysShowBeforeRender": true,
+      "waiting": true,
+      "autoclose": true,
+      "delay": 0
     },
-    "mp-qq" : {
-        "optimization" : {
-            "subPackages" : true
+    "usingComponents": true,
+    "nvueCompiler": "uni-app",
+    "compilerVersion": 3,
+    "modules": {
+      "Webview-x5": {}
+    },
+    "distribute": {
+      "android": {
+        "permissions": [
+          "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+          "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+          "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
+          "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+          "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+          "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+          "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+          "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
+          "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+          "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+          "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
+          "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+          "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+          "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+          "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+          "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+          "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
+          "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+          "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
+          "<uses-feature android:name=\"android.hardware.camera\"/>",
+          "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
+          "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+        ],
+        "abiFilters": [
+          "armeabi-v7a",
+          "arm64-v8a"
+        ],
+        "minSdkVersion": 21
+      },
+      "ios": {
+        "idfa": false,
+        "dSYMs": false
+      },
+      "sdkConfigs": {
+        "ad": {}
+      },
+      "icons": {
+        "android": {
+          "hdpi": "unpackage/res/icons/72x72.png",
+          "xhdpi": "unpackage/res/icons/96x96.png",
+          "xxhdpi": "unpackage/res/icons/144x144.png",
+          "xxxhdpi": "unpackage/res/icons/192x192.png"
         },
-        "appid" : "123",
-        "setting" : {
-            "minified" : true,
-            "urlCheck" : false
+        "ios": {
+          "appstore": "unpackage/res/icons/1024x1024.png",
+          "ipad": {
+            "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"
+          },
+          "iphone": {
+            "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"
+          }
         }
+      }
+    }
+  },
+  "quickapp": {},
+  "mp-weixin": {
+    "appid": "wxf385eefdd03327fd",
+    "setting": {
+      "urlCheck": false,
+      "es6": true,
+      "minified": true,
+      "postcss": false
     },
-    "mp-baidu" : {
-        "usingComponents" : true,
-        "appid" : ""
+    "optimization": {
+      "subPackages": true
     },
-    "mp-toutiao" : {
-        "usingComponents" : true,
-        "mergeVirtualHostAttributes" : true,
-        "appid" : ""
+    "permission": {
+      "scope.userLocation": {
+        "desc": "你的位置信息将用于小程序位置接口的效果展示"
+      }
     },
-    "h5" : {
-        "template" : "",
-        "router" : {
-            "mode" : "hash",
-            "base" : "./"
-        },
-        "optimization" : {
-            "treeShaking" : {
-                "enable" : false
-            }
-        },
-        "title" : "uview-plus",
-        "sdkConfigs" : {
-            "maps" : {
-                "qqmap" : {
-                    "key" : ""
-                }
-            }
-        },
-        "domain" : "",
-        "devServer" : {
-            "https" : false,
-            "port" : 5273
+    "mergeVirtualHostAttributes": true,
+    "lazyCodeLoading": "requiredComponents",
+    "usingComponents": true
+  },
+  "mp-alipay": {
+    "usingComponents": true,
+    "component2": true
+  },
+  "mp-qq": {
+    "optimization": {
+      "subPackages": true
+    },
+    "appid": "123",
+    "setting": {
+      "minified": true,
+      "urlCheck": false
+    }
+  },
+  "mp-baidu": {
+    "usingComponents": true,
+    "appid": ""
+  },
+  "mp-toutiao": {
+    "usingComponents": true,
+    "mergeVirtualHostAttributes": true,
+    "appid": ""
+  },
+  "h5": {
+    "template": "",
+    "router": {
+      "mode": "hash",
+      "base": "./"
+    },
+    "optimization": {
+      "treeShaking": {
+        "enable": false
+      }
+    },
+    "title": "uview-plus",
+    "sdkConfigs": {
+      "maps": {
+        "qqmap": {
+          "key": ""
         }
+      }
     },
-    "vueVersion" : "3",
-    "locale" : "auto"
+    "domain": "",
+    "devServer": {
+      "https": false,
+      "port": 5273
+    }
+  },
+  "vueVersion": "3",
+  "locale": "auto"
 }

+ 0 - 1
src/pages/login/index.vue

@@ -115,7 +115,6 @@ function submit() {
       uni.$u.toast('校验失败')
     }
   }).catch((e) => {
-    debugger
     // 处理验证错误
     uni.$u.toast('校验失败')
   });

+ 59 - 21
src/pages/workbenchsub/device/list.vue

@@ -5,45 +5,59 @@
       <view class="u-page__tag-item" v-for="(item, index) in DeviceState" :key="index">
         <up-tag
             :text="item.label"
-            :plain="selectTag === item.label"
+            :plain="selectTag === item.value"
             :plainFill="true"
             bgColor="#007aff"
             :name="item.value"
-            @click="()=>radioClick(item.label)"
+            @click="()=>radioClick(item)"
         >
         </up-tag>
       </view>
     </view>
     <view class="u-page-list" style="padding-bottom: 100rpx">
-      <up-list>
+      <up-list @scrolltolower="scrolltolower">
         <up-list-item
             v-for="(item, index) in indexList"
-            :key="index"
+            :key="item.id"
         >
           <view class="item-content">
-            <u--image
+            <up-image
                 :showLoading="true"
-                src="https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png"
+                :src="getDevImg(item.devImg)"
                 width="160rpx"
                 height="150rpx"
-            />
+                :lazy-load="true"
+            >
+              <template #error>
+                <view style="font-size: 24rpx;">加载失败</view>
+              </template>
+            </up-image>
             <view class="content-info">
               <view>
-                <up-text :lines="1" text="设备名称: 机箱" size="24rpx"/>
-                <up-tag text="标签" plain size="mini" bgColor="red" class="tag-stat"></up-tag>
+                <up-text :lines="1" :text="`设备名称: ${formatTxt(item.deviceNickname)}`" size="24rpx"/>
+                <up-tag :text="item.statusName" plain size="mini" :bgColor="valueToConst(DeviceState,item.status).color"
+                        class="tag-stat"></up-tag>
                 <up-text text="详情>" color="#007aff" style="flex:none;width: auto"
                          @click="()=>onDetailClick(item)"></up-text>
               </view>
               <view>
-                <up-text :lines="1" text="设备编码:44010200492000000002" size="24rpx"/>
+                <up-text :lines="1" :text="`设备编码:${formatTxt(item.name)}`" size="24rpx"/>
 
               </view>
               <view>
-                <up-text :lines="1" text="上线时间:2023-01-14 16:34:23" size="24rpx"/>
+                <up-text :lines="1" :text="`上线时间:${formatTxt(item.lastOnlineTime)}`" size="24rpx"/>
               </view>
             </view>
           </view>
         </up-list-item>
+        <up-loading-icon v-if="loading" text="加载中" textSize="12"></up-loading-icon>
+        <up-text
+            v-if="!loadmoreFlag" text="已经到底了" style="justify-content: center;"
+            size="24rpx"
+            color="gray"
+        >
+
+        </up-text>
       </up-list>
     </view>
   </view>
@@ -52,26 +66,50 @@
 <script setup lang="ts">
 import {ref} from "vue"
 import {DeviceState} from '@/common/consts/DeviceConst.js'
+import {valueToConst} from '@/common/consts/CommonConst.js'
 import {onLoad} from '@dcloudio/uni-app';
-import {navigateTo} from '@/util/index.js'
+import {formatTxt, getDevImg, navigateTo,} from '@/util/index.js'
+import {getDeviceList} from "@/api/device.js";
 
+const page = ref(1)
 onLoad(() => {
+  page.value = 1
+  loading.value = true;
   loadmore();
 });
 let searchValue = ref("")
-let indexList = ref([
-  {}
-])
-let selectTag = ref(DeviceState.ALL.label)
+let indexList = ref([])
+let selectTag = ref(DeviceState.ALL.value)
+let loadmoreFlag = ref(true)
+let loading = ref(false)
 
-function radioClick(label) {
-  selectTag.value = label
+function radioClick(item) {
+  selectTag.value = item.value
 }
 
-const loadmore = () => {
-  for (let i = 0; i < 10; i++) {
-    indexList.value.push({});
+
+const loadmore = async () => {
+  const {records} = await getDeviceList({
+    page: page.value,
+    deviceNickName: searchValue.value,
+    deviceState: selectTag.value,
+  })
+  if (records && records.length > 0) {
+    indexList.value = indexList.value.concat(records)
+    page.value += 1
+    if (records.length < 10) {
+      loadmoreFlag.value = false;
+    }
+  } else {
+    loadmoreFlag.value = false;
   }
+  loading.value = false;
+};
+
+const scrolltolower = () => {
+  if (!loadmoreFlag.value) return;
+  loading.value = true;
+  loadmore();
 };
 const onDetailClick = (item) => {
   navigateTo({

+ 0 - 1
src/pages/workbenchsub/workorder/submit.vue

@@ -273,7 +273,6 @@ const submit = () => {
       uni.$u.toast('校验失败')
     }
   }).catch((e) => {
-    debugger
     // 处理验证错误
     uni.$u.toast('校验失败')
   });

BIN
src/static/aiot/default.png


+ 86 - 63
src/util/index.js

@@ -1,106 +1,129 @@
 import {route} from '@/uni_modules/uview-plus';
+import {Rules} from "@/common/consts/CommonConst";
+import config from "@/common/config";
+import defaultImg from "@/static/aiot/default.png";
 
 const weekdays = [
-    '星期日',
-    '星期一',
-    '星期二',
-    '星期三',
-    '星期四',
-    '星期五',
-    '星期六',
+  '星期日',
+  '星期一',
+  '星期二',
+  '星期三',
+  '星期四',
+  '星期五',
+  '星期六',
 ]
 
 
 export function formatWeekday(index) {
-    return weekdays[index]
+  return weekdays[index]
 }
 
 export function navigateTo({url = "", param = {}}) {
-    route({
-        url,
-        params: param,
-    })
+  route({
+    url,
+    params: param,
+  })
 }
 
 export function reLaunch({url = "", param = {}}) {
-    route({
-        type: 'reLaunch',
-        url,
-        params: param,
-    })
+  route({
+    type: 'reLaunch',
+    url,
+    params: param,
+  })
 }
 
 
 export const getStorageObj = (key) => {
-    const json = uni.getStorageSync(key);
-    if (!json) {
-        return null;
-    }
-    return JSON.parse(json);
+  const json = uni.getStorageSync(key);
+  if (!json) {
+    return null;
+  }
+  return JSON.parse(json);
 };
 export const getUserInfo = () => {
-    const userInfo = getStorageObj(storageKey.USER_INFO);
-    if (!userInfo) {
-        return null;
-    }
-    return userInfo;
+  const userInfo = getStorageObj(storageKey.USER_INFO);
+  if (!userInfo) {
+    return null;
+  }
+  return userInfo;
 };
 export const setUserInfo = (userInfo) => {
-    setStorageObj(storageKey.USER_INFO, userInfo);
+  setStorageObj(storageKey.USER_INFO, userInfo);
 };
 
 export const setStorageObj = (key, value) => {
-    const json = JSON.stringify(value);
-    uni.setStorageSync(key, json);
+  const json = JSON.stringify(value);
+  uni.setStorageSync(key, json);
 };
 
 export const exit = () => {
-    uni.clearStorageSync();
+  uni.clearStorageSync();
 };
 export const getToken = () => {
-    const token = getStorageObj(storageKey.TOKEN);
-    if (!token) {
-        return null;
-    }
-    return token;
+  const token = getStorageObj(storageKey.TOKEN);
+  if (!token) {
+    return null;
+  }
+  return token;
 };
 
 export const setToken = (token) => {
-    setStorageObj(storageKey.TOKEN, token);
+  setStorageObj(storageKey.TOKEN, token);
 };
 export const authLogin = (callback) => {
-    const user = getUserInfo();
-    if (!user) {
-        uni.navigateTo({
-            url: '/pasb/pages/login/index',
-        });
-        return;
-    }
-    callback(user);
+  const user = getUserInfo();
+  if (!user) {
+    uni.navigateTo({
+      url: '/pasb/pages/login/index',
+    });
+    return;
+  }
+  callback(user);
 };
 export const storageKey = {
-    USER_INFO: 'userInfo',
-    TOKEN: 'token',
-    regtheme: 'regtheme',
-    regmeet: 'regmeet',
+  USER_INFO: 'userInfo',
+  TOKEN: 'token',
+  regtheme: 'regtheme',
+  regmeet: 'regmeet',
 };
 
 export const reloadPage = () => {
-    let pages = getCurrentPages();  //获取当前页面
-    let beforePage = pages[pages.length - 2];  //获取上一个页面的实例
-    //1、调用上一个页面onLoad
-    if (beforePage) {
-        beforePage.onLoad();
-        uni.navigateBack({
-            delta: 1,
-        });
-    }
-    reLaunch({
-        url: '/pages/workbench/index',
-    })
+  let pages = getCurrentPages();  //获取当前页面
+  let beforePage = pages[pages.length - 2];  //获取上一个页面的实例
+  //1、调用上一个页面onLoad
+  if (beforePage) {
+    beforePage.onLoad();
+    uni.navigateBack({
+      delta: 1,
+    });
+  }
+  reLaunch({
+    url: '/pages/workbench/index',
+  })
 }
 
 export const DateFormat = {
-    YYYYMMDD: 'YYYY-MM-DD',
-    YYYYMMDDHHMMSS: 'YYYY-MM-DD HH:mm:ss',
+  YYYYMMDD: 'YYYY-MM-DD',
+  YYYYMMDDHHMMSS: 'YYYY-MM-DD HH:mm:ss',
+}
+
+export const getDevImg = (devImg) => {
+  if (!devImg) {
+    return "";
+  }
+  const parse = JSON.parse(devImg);
+  if (parse.length > 0) {
+    const url = parse[0].url;
+    return url.replace(Rules.domainPort, config.imgCdn);
+  } else {
+    return defaultImg;
+  }
+};
+
+export const formatTxt = (txt) => {
+  if (!txt) {
+    return "--";
+  }
+  return txt;
 }

+ 2 - 0
src/util/request/index.js

@@ -37,10 +37,12 @@ export const post = async (url, data, header = {}) => {
     })
 }
 export const get = async (url, params, header = {}) => {
+    const token = getToken();
     return await http.get(url, {
         params,
         header: {
             'Content-Type': 'application/json',
+            'Authorization': token ? `bearer ${token}` : '',
             ...header,
         },
     })

Plik diff jest za duży
+ 0 - 0
stats.html


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików