ipanel-rnapp-ajb-base 1.0.28 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,33 +13,35 @@ import { updateHomedToken } from "../../../utils/common";
|
|
|
13
13
|
import px from "../../../utils/scaleSize";
|
|
14
14
|
// import TvAlbumScreen from './TvAlbumScreen';
|
|
15
15
|
|
|
16
|
-
const { storage
|
|
16
|
+
const { storage } = global.base;
|
|
17
17
|
|
|
18
18
|
// 扫码获取到结果后的回调函数
|
|
19
19
|
let scanCodeCallback;
|
|
20
20
|
|
|
21
21
|
function HomedLoginIndex(props) {
|
|
22
|
-
const { navigation } = props;
|
|
22
|
+
const { navigation, route } = props;
|
|
23
23
|
const [isCheckingLogin, setIsCheckingLogin] = useState(true);
|
|
24
24
|
const { updateAddrFromNetwork } = global.base.hooks.useAddress();
|
|
25
25
|
|
|
26
26
|
useEffect(() => {
|
|
27
27
|
(async () => {
|
|
28
|
+
// 登录homed
|
|
28
29
|
await updateHomedToken();
|
|
29
30
|
const homedAccessToken = await storage.get("homedAccessToken");
|
|
30
31
|
|
|
31
32
|
if (homedAccessToken) {
|
|
32
33
|
// 已登录,自动跳转回去
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const backParams = {
|
|
35
|
+
loginResult: "success",
|
|
36
|
+
};
|
|
37
|
+
if (route.params?.redirectScreenName) {
|
|
38
|
+
navigation.navigate(route.params.redirectScreenName, backParams);
|
|
36
39
|
} else {
|
|
37
|
-
navigation.goBack();
|
|
40
|
+
navigation.goBack(backParams);
|
|
38
41
|
}
|
|
39
42
|
} else {
|
|
40
43
|
setIsCheckingLogin(false);
|
|
41
44
|
}
|
|
42
|
-
|
|
43
45
|
// // 临时测试时放开,不要让页面跳回去
|
|
44
46
|
// setIsCheckingLogin(false);
|
|
45
47
|
})();
|
|
@@ -93,10 +95,13 @@ function HomedLoginIndex(props) {
|
|
|
93
95
|
await storage.set("homedLoginResult", homedLoginResult);
|
|
94
96
|
global.toast.showToast("登录成功");
|
|
95
97
|
// 登录成功后跳转回目标页面
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
const backParams = {
|
|
99
|
+
loginResult: "success",
|
|
100
|
+
};
|
|
101
|
+
if (route.params?.redirectScreenName) {
|
|
102
|
+
navigation.navigate(route.params.redirectScreenName, backParams);
|
|
98
103
|
} else {
|
|
99
|
-
navigation.goBack();
|
|
104
|
+
navigation.goBack(backParams);
|
|
100
105
|
}
|
|
101
106
|
} else {
|
|
102
107
|
global.toast.showToast("登录失败:" + homedLoginResult.message);
|