Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 7a63ccc

Browse files
author
soliury
committed
fix bugs about camera
1 parent 8adce33 commit 7a63ccc

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/layouts/Login.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,20 @@ const {height, width} = Dimensions.get('window');
1818

1919
class Login extends Component {
2020
_onLoginPress() {
21-
if (this.props.ui.checkTokenPending) return;
22-
this.props.router.toQRCode();
21+
const {ui, router, actions} = this.props;
22+
if (ui.checkTokenPending) return;
23+
Camera.checkDeviceAuthorizationStatus()
24+
.then((isAuth)=> {
25+
if (isAuth) {
26+
router.toQRCode();
27+
}
28+
else {
29+
actions.toast('请在设置中开启Noder对相机的访问');
30+
}
31+
})
32+
.catch((err)=> {
33+
actions.toast('获取相机访问权错误');
34+
});
2335
}
2436

2537

0 commit comments

Comments
 (0)