“d67b9ced051dfc0cca377755f4acba1424ea297f”上不存在“python/paddle/git@gitcode.net:paddlepaddle/Paddle.git”
index.obj.js 569 字节
Newer Older
study夏羽's avatar
update  
study夏羽 已提交
1 2 3 4 5
// 开发文档: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
const uniCaptcha = require('uni-captcha')
const db = uniCloud.database();
const verifyCodes = db.collection('opendb-verify-codes')
module.exports = {
6 7 8 9 10 11
	async getImageCaptcha({scene}) {
		let {deviceId} = this.getClientInfo();
		let res = await verifyCodes.where({scene,deviceId,state:0}).limit(1).get()
		console.log("res: " + JSON.stringify(res));
		let action = res.data.length?'refresh':'create'
		console.log(action);
study夏羽's avatar
update  
study夏羽 已提交
12
		return await uniCaptcha[action]({
13 14 15
			scene,
			width:100,
			height:44
study夏羽's avatar
update  
study夏羽 已提交
16 17 18
		})
	}
}