Skip to content

Commit a9a48fb

Browse files
committed
fix:修正product版问题
1 parent 342612f commit a9a48fb

File tree

6 files changed

+33
-23
lines changed

6 files changed

+33
-23
lines changed

app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"expo": {
33
"name": "MeshTalk",
44
"slug": "MeshTalk",
5-
"version": "1.1.3",
5+
"version": "1.1.5",
66
"orientation": "portrait",
77
"icon": "./assets/icon.png",
88
"userInterfaceStyle": "light",

src/app/_layout.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import * as Sentry from "@sentry/react-native";
22
import { isRunningInExpoGo } from "expo";
33
import { Stack, useNavigationContainerRef } from "expo-router";
44
import React, { useEffect } from "react";
5-
import { View } from "react-native";
5+
import { ActivityIndicator, View } from "react-native";
66
import { GestureHandlerRootView } from "react-native-gesture-handler";
77
import { ModalProvider, modalRef } from "react-native-ma-modal";
88
import { useSafeAreaInsets } from "react-native-safe-area-context";
99

1010
import useAppStore from "../store/useAppStore";
1111
import useDeviceStore from "../store/useDeviceStore";
12+
import { Colors } from "../config";
1213

1314
const routingInstrumentation = new Sentry.ReactNavigationInstrumentation();
1415
// SENTRY_AUTH_TOKEN 已存入eas环境变量中
@@ -45,7 +46,11 @@ const App: React.FC<object> = () => {
4546
}, [insets]);
4647

4748
if (!isReady) {
48-
return <View style={{ flex: 1 }} />;
49+
return (
50+
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
51+
<ActivityIndicator animating color={Colors.theme} />
52+
</View>
53+
);
4954
}
5055

5156
return (

src/app/welcome/index.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ const Guide: React.FC<object> = () => {
4040
<ScrollView contentContainerStyle={styles.guide_main}>
4141
<Text style={styles.guide_title}>欢迎来到MeshTalk</Text>
4242
<View style={{ height: 450, marginVertical: 25 }}>
43-
<FlatList
44-
data={recommend}
45-
showsHorizontalScrollIndicator={false}
46-
horizontal
47-
renderItem={({ item }) => {
48-
return <ServerCard server={item} />;
49-
}}
50-
/>
43+
{recommend.length > 0 ? (
44+
<FlatList
45+
data={recommend}
46+
showsHorizontalScrollIndicator={false}
47+
horizontal
48+
renderItem={({ item }) => {
49+
return <ServerCard server={item} />;
50+
}}
51+
/>
52+
) : null}
5153
</View>
5254
<Button
5355
text="寻找更多的实例"

src/components/Screen/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { ErrorBoundary, Error } from "@components";
21
import { Stack, router } from "expo-router";
32
import React from "react";
43
import { View, Text } from "react-native";
54

65
import { Colors } from "../../config";
6+
import Error from "../Error";
7+
import { ErrorBoundary } from "../ErrorBoundary";
78

89
interface ScreenProps {
910
headerShown?: boolean;

src/store/useLoginStore.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { router } from "expo-router";
22
import { Platform } from "react-native";
3-
import { Toast } from "react-native-ma-modal";
3+
import { Loading, Toast } from "react-native-ma-modal";
44
import { create } from "zustand";
55

66
import { AppInterface } from "../config/interface";
@@ -23,6 +23,7 @@ const useLoginStore = create<LoginStoreState>((set, get) => ({
2323
},
2424
onPressLogin: async () => {
2525
if (get().path.length > 0) {
26+
Loading.show();
2627
const { data, ok } = await getAppConfig("https://" + get().path);
2728
if (data && ok) {
2829
set({ loginData: data });
@@ -42,6 +43,7 @@ const useLoginStore = create<LoginStoreState>((set, get) => ({
4243
} else {
4344
Toast.show("请检查网络设置");
4445
}
46+
Loading.hide();
4547
} else {
4648
Toast.show("请输入应用实例地址");
4749
}

src/utils/request.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ import { AxiosRequestConfig } from "axios";
55
import { Response } from "../config/interface";
66

77
const api = create({
8-
timeout: 30000,
8+
timeout: 15000,
99
baseURL: "",
1010
});
1111

1212
api.addRequestTransform((request) => {
1313
// console.log(Stores.appStore.token);
1414

1515
console.log("\n===================请求拦截器=================");
16-
console.log(`请求地址:${request.url}`);
17-
console.log(`请求方式:${request.method}`);
16+
console.log(`请求地址:${request?.url}`);
17+
console.log(`请求方式:${request?.method}`);
1818
console.log("请求参数:");
19-
console.log(request.data);
20-
console.log(request.params);
21-
console.log(request.headers);
19+
console.log(request?.data);
20+
console.log(request?.params);
21+
console.log(request?.headers);
2222
console.log("============================================\n");
2323
});
2424

2525
api.addResponseTransform((response) => {
2626
console.log("\n===================响应拦截器=================");
2727
console.log(`返回`);
28-
console.dir(response);
29-
console.log(`返回状态:${response.status}`);
28+
console.log(response);
29+
console.log(`返回状态:${response?.status}`);
3030
// console.log('返回数据:', response.data);
3131
console.log("============================================\n");
3232
});
@@ -50,7 +50,7 @@ const get = <T>(
5050
url,
5151
data: params,
5252
},
53-
message: "request fail" + response.originalError,
53+
message: "request fail" + response?.originalError,
5454
});
5555
}
5656
return response;
@@ -80,7 +80,7 @@ const post = <T>(
8080
url,
8181
data,
8282
},
83-
message: "request fail" + response.originalError,
83+
message: "request fail" + response?.originalError,
8484
});
8585
}
8686
return response;

0 commit comments

Comments
 (0)