소스 검색

mobile api

tanlie 1 개월 전
부모
커밋
0291c2e7ec

+ 1 - 1
wishing-platform/platform-service/platform-service-mobile/pom.xml

@@ -60,7 +60,7 @@
         </dependency>
     </dependencies>
     <build>
-        <finalName>wishing-h5</finalName>
+        <finalName>wishing-mobile</finalName>
         <resources>
             <resource>
                 <directory>src/main/java</directory>

+ 1 - 0
wishing-platform/platform-service/platform-service-mobile/src/main/java/cn/qinys/platform/mobile/service/WishTreeServiceImpl.java

@@ -65,6 +65,7 @@ public class WishTreeServiceImpl implements WishTreeService {
         // 按距离排序,限制返回数量
         return result.stream()
                 .sorted(Comparator.comparingInt(WishingTreeListResp::getDistance))
+                .filter(it -> it.getDistance() <= req.getMaxDistance())
                 .limit(req.getLimit())
                 .collect(Collectors.toList());
     }

+ 6 - 5
wishing-tree-h5/src/views/HomeView.vue

@@ -36,11 +36,10 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, onUnmounted } from 'vue'
-import { useRouter } from 'vue-router'
-import { showDialog } from 'vant'
-import { useLocationStore } from '@/stores/location'
-import { fetchNearbyTrees } from '@/api/tree'
+import {onMounted, onUnmounted, ref} from 'vue'
+import {useRouter} from 'vue-router'
+import {useLocationStore} from '@/stores/location'
+import {fetchNearbyTrees} from '@/api/tree'
 import TreeCard from '@/components/TreeCard.vue'
 
 const router = useRouter()
@@ -62,6 +61,8 @@ async function loadTrees() {
     )
     nearby.value = result
     finished.value = true
+  } catch {
+    finished.value = true // 请求失败后停止,不再重试
   } finally {
     loading.value = false
     refreshing.value = false

+ 1 - 1
wishing-tree-h5/vite.config.ts

@@ -1,7 +1,7 @@
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import Components from 'unplugin-vue-components/vite'
-import { VantResolver } from '@vant/auto-import-resolver'
+import { VantResolver } from '@van/tauto-import-resolver'
 import { fileURLToPath, URL } from 'node:url'
 
 export default defineConfig({

BIN
wishing-tree-h5/wish.zip