Commit 3676e06a by zeven

优化刷脸速度

parent ad605e78
android @ 5f31a7fb
Subproject commit 6fc469027cd79cc658acbe06d1a70214859ea480 Subproject commit 5f31a7fbeaf021a75cb2a2bba458032c8ebc5f5d
{ {
"name": "zm-face-counter", "name": "zm-face-counter",
"version": "1.3.12", "version": "1.3.15",
"private": true, "private": true,
"scripts": { "scripts": {
"android": "react-native run-android", "android": "react-native run-android",
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
"test": "jest", "test": "jest",
"lint": "eslint --ext .js index.js src", "lint": "eslint --ext .js index.js src",
"apk": "cd android && ./gradlew app:assembleRelease && cp ./app/build/outputs/apk/release/app-release.apk ../fcounter.apk", "apk": "cd android && ./gradlew app:assembleRelease && cp ./app/build/outputs/apk/release/app-release.apk ../fcounter.apk",
"android-staging": "code-push release-react ZmFaceCounter-android android -t '1.0.0' --des '1.3.12'", "android-staging": "code-push release-react ZmFaceCounter-android android -t '1.0.0' --des '1.3.15'",
"android-product": "code-push promote ZmFaceCounter-android Staging Production --des '1.3.12'", "android-product": "code-push promote ZmFaceCounter-android Staging Production --des '1.3.15'",
"android-history": "code-push deployment history ZmFaceCounter-android Production", "android-history": "code-push deployment history ZmFaceCounter-android Production",
"android-rollback": "code-push rollback ZmFaceCounter-android Production" "android-rollback": "code-push rollback ZmFaceCounter-android Production"
}, },
......
...@@ -70,6 +70,15 @@ class FacePage extends Component { ...@@ -70,6 +70,15 @@ class FacePage extends Component {
// 微信刷脸失败,启动支付宝刷脸 // 微信刷脸失败,启动支付宝刷脸
this.init = true; this.init = true;
this.setState({faceType: 'alipay'}); this.setState({faceType: 'alipay'});
} else {
const getAuth = async () => {
const auth = await this.authinfo();
if (!this.rawinfo) this.rawinfo = {};
if (auth) this.rawinfo = auth;
};
getAuth();
clearInterval(this.rawinfoInterval);
this.rawinfoInterval = setInterval(getAuth, 30 * 60 * 60 * 1000);
} }
} }
const setting = await AutoClick.isSettingsOn(); const setting = await AutoClick.isSettingsOn();
...@@ -465,7 +474,7 @@ class FacePage extends Component { ...@@ -465,7 +474,7 @@ class FacePage extends Component {
const tipText = '正在人脸识别,请看向屏幕,靠中间站稳'; const tipText = '正在人脸识别,请看向屏幕,靠中间站稳';
Speech.speak(tipText); Speech.speak(tipText);
// this.setState({tip: tipText, tipsModal: true}); // this.setState({tip: tipText, tipsModal: true});
let auth = (await this.authinfo()) || {}; let auth = this.rawinfo;
if ( if (
auth.return_code === 'SUCCESS' || auth.return_code === 'SUCCESS' ||
(auth.code === 1 && auth.data.bizCode === '0000') (auth.code === 1 && auth.data.bizCode === '0000')
...@@ -740,7 +749,7 @@ class FacePage extends Component { ...@@ -740,7 +749,7 @@ class FacePage extends Component {
}; };
wxFacepay = async () => { wxFacepay = async () => {
const {data} = (await this.authinfo()) || {}; const {data} = this.rawinfo;
const auth = data; const auth = data;
let params = null; let params = null;
if (auth.bizCode === '0000') { if (auth.bizCode === '0000') {
......
...@@ -67,6 +67,15 @@ class VerticalPage extends Component { ...@@ -67,6 +67,15 @@ class VerticalPage extends Component {
// 微信刷脸失败,启动支付宝刷脸 // 微信刷脸失败,启动支付宝刷脸
this.init = true; this.init = true;
this.setState({faceType: 'alipay'}); this.setState({faceType: 'alipay'});
} else {
const getAuth = async () => {
const auth = await this.authinfo();
if (!this.rawinfo) this.rawinfo = {};
if (auth) this.rawinfo = auth;
};
getAuth();
clearInterval(this.rawinfoInterval);
this.rawinfoInterval = setInterval(getAuth, 30 * 60 * 60 * 1000);
} }
} }
this.initSetting(); this.initSetting();
...@@ -257,7 +266,7 @@ class VerticalPage extends Component { ...@@ -257,7 +266,7 @@ class VerticalPage extends Component {
this.props.speak('请先扫描商品条码,再刷脸支付', true); this.props.speak('请先扫描商品条码,再刷脸支付', true);
return; return;
} }
const auth = (await this.authinfo()) || {}; const auth = this.rawinfo;
let params = null; let params = null;
if (auth.bizCode === '0000') { if (auth.bizCode === '0000') {
// 随行付支付 // 随行付支付
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment