mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-14 02:00:37 +08:00
Update script
This commit is contained in:
parent
ffff73bbd8
commit
efdd56a82c
@ -1,52 +1,52 @@
|
|||||||
const url = $request.url;
|
const url = $request.url;
|
||||||
const newHeaders = {
|
const newHeaders = {
|
||||||
"Crack": "KS",
|
Crack: 'KS',
|
||||||
"Access-Control-Allow-Origin": "*",
|
'Access-Control-Allow-Origin': '*',
|
||||||
"Access-Control-Allow-Headers": "*",
|
'Access-Control-Allow-Headers': '*',
|
||||||
"Access-Control-Allow-Method": "*",
|
'Access-Control-Allow-Method': '*',
|
||||||
"Access-Control-Allow-Credentials": "true"
|
'Access-Control-Allow-Credentials': 'true'
|
||||||
};
|
};
|
||||||
let obj = {};
|
let obj = {};
|
||||||
|
|
||||||
if (url.includes('/admin/service/registration/validateDevice')) {
|
if (url.includes('/admin/service/registration/validateDevice')) {
|
||||||
obj = {
|
obj = {
|
||||||
"cacheExpirationDays": 365,
|
'cacheExpirationDays': 365,
|
||||||
"message": "Device Valid",
|
'message': 'Device Valid',
|
||||||
"resultCode": "GOOD"
|
'resultCode': 'GOOD'
|
||||||
};
|
};
|
||||||
} else if (url.includes('/admin/service/appstore/register')) {
|
} else if (url.includes('/admin/service/appstore/register')) {
|
||||||
obj = {
|
obj = {
|
||||||
"featId":"",
|
featId: '',
|
||||||
"registered":true,
|
registered: true,
|
||||||
"expDate":"2099-01-01",
|
expDate: '2099-01-01',
|
||||||
"key":""
|
key: ''
|
||||||
};
|
};
|
||||||
} else if (url.includes('/admin/service/registration/validate')) {
|
} else if (url.includes('/admin/service/registration/validate')) {
|
||||||
obj = {
|
obj = {
|
||||||
"featId":"",
|
featId: '',
|
||||||
"registered":true,
|
registered: true,
|
||||||
"expDate":"2099-01-01",
|
expDate: '2099-01-01',
|
||||||
"key":""
|
key: ''
|
||||||
};
|
};
|
||||||
} else if (url.includes('/admin/service/registration/getStatus')){
|
} else if (url.includes('/admin/service/registration/getStatus')) {
|
||||||
obj = {
|
obj = {
|
||||||
"planType":"Sukka",
|
planType: 'Sukka',
|
||||||
"deviceStatus":"",
|
deviceStatus: '',
|
||||||
"subscriptions":[]
|
subscriptions: []
|
||||||
};
|
};
|
||||||
} else if (url.includes('/admin/service/supporter/retrievekey')){
|
} else if (url.includes('/admin/service/supporter/retrievekey')) {
|
||||||
obj = {
|
obj = {
|
||||||
"Success":false,
|
Success: false,
|
||||||
"ErrorMessage":"Supporter not found"
|
ErrorMessage: 'Supporter not found'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const newBody = JSON.stringify(obj);
|
const newBody = JSON.stringify(obj);
|
||||||
|
|
||||||
const myResponse = {
|
const myResponse = {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: newHeaders, // Optional.
|
headers: newHeaders,
|
||||||
body: newBody // Optional.
|
body: newBody
|
||||||
};
|
};
|
||||||
|
|
||||||
$done(myResponse);
|
$done(myResponse);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
let body = $response.body
|
let body = $response.body;
|
||||||
body=JSON.parse(body)
|
body = JSON.parse(body);
|
||||||
body['response']['user']['is_premium']=true
|
body['response']['user']['is_premium'] = true;
|
||||||
body=JSON.stringify(body)
|
body = JSON.stringify(body);
|
||||||
$done({body})
|
|
||||||
|
$done({ body })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user