<template>
	<view>
<!-- 		<button @click="zhuce">注册ylht</button>
		<button @click="success">成功</button>
		<button @click="fail">失败</button>
		<button @click="huidiao">回调</button> -->
		<web-view src="https://test-api-open.chinaums.com/v1/visual-ai/face/garden-collect?authorization=OPEN-FORM-PARAM&appId=10037e6f6394f6e70163a6782676007d&timestamp=20240327172152&nonce=fd86f7c639f1485d9fc4331ba7e44b1e&content=%7B%22bizData%22%3A%224786A5744684ED70944768AF26F617BF56FDAE71B75AFDB562520EAB03FA6629AB14FAEF395F2DDA1A38341F9072DCFE8B270CECFE9A0298C6C8202233000EC2CB528048547DB2F0%22%2C%22notifyUrl%22%3A%22http%3A%2F%2F121.36.73.159%2Flnst%2Flrxx%2Freturn%22%2C%22redirectUrl%22%3A%22https%3A%2F%2Fwww.ccsckj.com%2F%22%2C%22type%22%3A%22action%22%2C%22usrId%22%3A%2212003170800100000019%22%7D&signature=pki99Qs5X0fRq0Bn5eitJ1TkIFx2v3wvDU0D8ptFYG0%3D"></web-view>
	</view>
</template>

<script>
	import jsTools from "uni_modules/leven-js-tools/index.js"
	export default {
		name: "my-file",
		data() {
			return {
				zczm: [],
				zczmList: [],
				limit: 5,
			};
		},
		watch: {

		},
		mounted() {

		},
		methods: {
			huidiao() {
				let url = "https://test-api-open.chinaums.com/v1/visual-ai/faceliveness/detect"
				let appKey = '5a735c9a42d1401da0e39516f2b3bef7'
				let desKey = 'A5D37C3D8502D503CC7B1EB62CEF4B79'
				let authorization = "OPEN-FORM-PARAM"
				let appId = "10037e6f6394f6e70163a6782676007d"
				let timestamp = '20240325153744'
				// let nonce = new Date().getTime()
				let nonce = '20240325153744'
				let content = ''
				// {
				// 	returnUrl: 'https://www.ccsckj.com/',
				// 	type: 'action'
				// }
				// Base64_Encode(HmacSHA256(appId + timestamp + nonce + SHA256_HEX(content), AppKey))
				let signature = uni.$lv.encrypt.base64Encode(uni.$lv.encrypt.hmacSha256(appId + timestamp + nonce + uni.$lv
					.encrypt.sha256(content), appKey))

				uni.request({
					url: url + '?authorization=' + authorization + "&appId=" + appId + "&timestamp=" + timestamp +
						"&nonce=" + nonce + "&content=" + content + "&signature=" + signature,
					method: 'GET',
				}).then(res => {
					console.log(res);
				})



			},
			zhuce() {
				// todo 3DES
				let result = uni.$lv.encrypt.hmacSha256("abcdefg123456这是一条加密字符串7892345",
					"u$DCc!tjdYn%wP!hE3Ya%qVCWKUX9p4N");
				result = uni.$lv.encrypt.sha256("abcdefg123456这是一条加密字符串7892345");
				result = uni.$lv.encrypt.base64Encode("KNGT^$Sat#je5VX9Hdp3Y@kLUTegwg82这是一条加密字符串");
				result = uni.$lv.validate.isWechat();
				uni.$lv.func.toast(result);
			},
			success() {
				uni.navigateTo({
					url: '/pages/living/success'
				})

			},
			fail() {
				uni.navigateTo({
					url: '/pages/living/fail'
				})
			},


		}
	}
</script>

<style>

</style>