CodeGuide icon indicating copy to clipboard operation
CodeGuide copied to clipboard

浏览器指纹Promise同步返回

Open fuzhengwei opened this issue 2 years ago • 2 comments

<script>

util = {
	test: function(){
		return new Promise( resolve => {    
			new Fingerprint2().get(function(result, components){             
				let value = result.toUpperCase();
				let token = value.substring(value.length - 6).toUpperCase();
		   
				resolve(token);
			});
		})
	},
	test02:async function(){
		const result = await util.test();
		alert(result);
		console.log(result);
	}
}

util.test02();
console.log('end');

//alert(tmMenu.token());
</script>

fuzhengwei avatar Mar 29 '22 10:03 fuzhengwei

util.test02().then(function(t){
		console.info(t);
	})

fuzhengwei avatar Mar 29 '22 10:03 fuzhengwei

https://dashboard.fingerprint.com/onboarding

fuzhengwei avatar Sep 13 '22 09:09 fuzhengwei