Mini Program - Problems Encountered in Face Verification startFacialRecognitionVerifyAndUploadVideo:fail:access denied

error - no permission

{"errno": 102, "errMsg": "startFacialRecognitionVerifyAndUploadVideo:fail:access denied"}

insert image description here

the code

import Taro, {
    
     Component } from '@tarojs/taro'

class Home extends Component {
    
    
	constructor(props) {
    
    
		super(props)
	}
	state = {
    
    
		result: 'cs ',
	}
	componentDidMount() {
    
    
		console.log('111111----', 111111)
		const that = this
		// Taro.startFacialRecognitionVerifyAndUploadVideo({
    
    
		Taro.startFacialRecognitionVerify({
    
    
			name: '测试名', // 真实姓名
			idCardNumber: '330xxx19xxxxxxxx', // 真实身份证号码
			success(res) {
    
    
				console.log('res--success--', res)
				that.setState({
    
    
					result: 'success',
				})
			},
			fail(res) {
    
    
				console.log('res--fail--', res)
				that.setState({
    
    
					result: 'fail',
				})
			},
			complete(res) {
    
    
				console.log('res--complete--', res)
				// that.setState({
    
    
				// 	result: 'complete',
				// })
			},
		})
	}
	componentWillUnmount() {
    
    }

	config = {
    
    
		navigationBarTitleText: '扫脸',
	}

	render() {
    
    
		return <View className='AI-Content'>测试{
    
    this.state.result}</View>
	}
}

solve

Open the face verification authority on each platform of WeChat public.
insert image description here
After submitting the information, it will be displayed 申请中→ waiting for review
insert image description here

【Replenish】

  • If after the face verification is enabled, the call to the API still reports an error {"errno": 102, "errMsg": "startFacialRecognitionVerifyAndUploadVideo:fail:access denied"}, check whether the called API is consistent with the opened API (I call it and Taro.startFacialRecognitionVerifyAndUploadVideo()it still reports an error, after checking the document, use Taro.startFacialRecognitionVerify()the call to be normal)
    insert image description here

  • If you have other questions, you can add the WeChat group and ask the staff
    insert image description here

Interface call normal page display

insert image description here

Guess you like

Origin blog.csdn.net/m0_53562074/article/details/132411573