激励广告对接
This commit is contained in:
11
uniCloud-aliyun/cloudfunctions/gl-ad/gl-ad.param.json
Normal file
11
uniCloud-aliyun/cloudfunctions/gl-ad/gl-ad.param.json
Normal file
@@ -0,0 +1,11 @@
|
||||
// 本文件中的json内容将在云函数【运行】时作为参数传给云函数。
|
||||
// 配置教程参考:https://uniapp.dcloud.net.cn/uniCloud/quickstart?id=runparam
|
||||
{
|
||||
adpid: '1428308887',
|
||||
platform: 'android',
|
||||
provider: 'sigmob',
|
||||
trans_id: '892aed71-f840-11ec-adc8-00163e349e98',
|
||||
user_id: '',
|
||||
extra: '',
|
||||
sign: '51658e78da481dfd38aa0bd16b6d09863df8808facd22f7bbc7392afafe2391f'
|
||||
}
|
||||
@@ -1,7 +1,33 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
const crypto = require('crypto');
|
||||
|
||||
exports.main = async (event, context) => {
|
||||
//event为客户端上传的参数
|
||||
console.log('event : ', event)
|
||||
console.log('event : ', event)
|
||||
|
||||
const {
|
||||
path,
|
||||
queryStringParameters
|
||||
} = event;
|
||||
|
||||
const data = {
|
||||
adpid: event.adpid,
|
||||
platform: event.platform,
|
||||
provider: event.provider,
|
||||
trans_id: event.trans_id,
|
||||
sign: event.sign,
|
||||
user_id: event.user_id,
|
||||
extra: event.extra,
|
||||
}
|
||||
|
||||
const secret = '892aed71-f840-11ec-adc8-00163e349e98';// uniad 后台开通激励视频回调后生成的 Security key
|
||||
const trans_id = event.trans_id;
|
||||
const sign2 = crypto.createHash('sha256').update(`${secret}:${trans_id}`).digest('hex');
|
||||
|
||||
if (event.sign !== sign2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//返回数据给客户端
|
||||
return event
|
||||
|
||||
3
uniCloud-aliyun/cloudfunctions/uniAdCallback/config.js
Normal file
3
uniCloud-aliyun/cloudfunctions/uniAdCallback/config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
n<EFBFBD><EFBFBD>_<EFBFBD><EFBFBD>M<EFBFBD>a<EFBFBD>8<EFBFBD><EFBFBD>Cfԃ<EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD>|<EFBFBD><EFBFBD>˕W<EFBFBD>]<EFBFBD>N驚<EFBFBD>'<27><19><><EFBFBD><EFBFBD><EFBFBD><<3C>E<EFBFBD><45><EFBFBD>ژ<EFBFBD><DA98><EFBFBD><EFBFBD>o<EFBFBD>}<7D><>Vz
|
||||
ՌW<07><><EFBFBD>J9<4A>\Ǚ<><C799>_<EFBFBD><5F><EFBFBD>r8<72>B
|
||||
<EFBFBD><EFBFBD>}<15>Ql<51>k,<2C>k+KC-<2D><><16><>\<5C><><1E><><04><>sk<16><>q8<><38><EFBFBD>k<1B><><EFBFBD> <09><><EFBFBD><EFBFBD><EFBFBD><nK<6E>u<><05><03>2B<32>[颂<>M<EFBFBD>Rd/<2F>s<EFBFBD><73><EFBFBD> <09><><EFBFBD>XIa5<61>r<EFBFBD>:<3A>'<EFBFBD>&<EFBFBD>%<EFBFBD><EFBFBD><EFBFBD><EFBFBD>c<EFBFBD><EFBFBD>Y<EFBFBD>;oܮ9W<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD>t<EFBFBD><EFBFBD>w<EFBFBD>"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>{<EFBFBD>iZ(<EFBFBD><EFBFBD><EFBFBD><EFBFBD>o.L<EFBFBD>8<EFBFBD><EFBFBD>W<EFBFBD>Y<EFBFBD><EFBFBD><EFBFBD>^l(^x<EFBFBD><EFBFBD>^
|
||||
1
uniCloud-aliyun/cloudfunctions/uniAdCallback/encrypt
Normal file
1
uniCloud-aliyun/cloudfunctions/uniAdCallback/encrypt
Normal file
@@ -0,0 +1 @@
|
||||
n<EFBFBD><17>&W&<11><>c?<0E>jl<03>b<EFBFBD>-<2D><>q<>_<1A>>P<1D>S<EFBFBD><53>u<EFBFBD>H,<2C><15><>k>p
|
||||
BIN
uniCloud-aliyun/cloudfunctions/uniAdCallback/index.js
Normal file
BIN
uniCloud-aliyun/cloudfunctions/uniAdCallback/index.js
Normal file
Binary file not shown.
1
uniCloud-aliyun/cloudfunctions/uniAdCallback/x509.js
Normal file
1
uniCloud-aliyun/cloudfunctions/uniAdCallback/x509.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user