1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- let base_url = 'https://denettestapi.piaoquantv.com/denet'
- // 获取红包任务详情
- export function getPostDetail() {
- return new Promise(function (resolve, reject) {
- let _url = `${base_url}/post/getDetail`
- fetch(_url, {
- method: 'POST', // or 'PUT'
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- "baseInfo": {
- "appVersionCode": 0,
- "clientTimestamp": 0,
- "loginUid": 0,
- "requestId": "string",
- "token": "string"
- },
- "params": {
- "postId": "05b2f99bbcfa461db3b053df61ca7ae5"
- }
- }),
- })
- .then(response => response.json())
- .then(data => {
- resolve(data);
- })
- .catch((error) => {
- reject(error);
- });
- })
- }
- // 领取红包任务
- export function getRedPacket() {
- return new Promise(function (resolve, reject) {
- let _url = `${base_url}/post/luckdrop/receiveLuckdrop`
- fetch(_url, {
- method: 'POST', // or 'PUT'
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- "baseInfo": {
- "appVersionCode": 0,
- "clientTimestamp": 0,
- "loginUid": 0,
- "requestId": "string",
- "token": "d2ef1b74d4dec5338938a58b7fe783360612b8a5"
- },
- "params": {
- "postId": "05b2f99bbcfa461db3b053df61ca7ae5"
- }
- }),
- })
- .then(response => response.json())
- .then(data => {
- resolve(data);
- })
- .catch((error) => {
- reject(error);
- });
- })
- }
- // 完成红包任务
- export function finishRedPacket() {
- return new Promise(function (resolve, reject) {
- let _url = `${base_url}/post/luckdrop/finishLuckdrop`
- fetch(_url, {
- method: 'POST', // or 'PUT'
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- "baseInfo": {
- "appVersionCode": 0,
- "clientTimestamp": 0,
- "loginUid": 0,
- "requestId": "string",
- "token": "string"
- },
- "params": {
- "postId": "05b2f99bbcfa461db3b053df61ca7ae5"
- }
- }),
- })
- .then(response => response.json())
- .then(data => {
- resolve(data);
- })
- .catch((error) => {
- reject(error);
- });
- })
- }
|