|
@@ -87,11 +87,9 @@ function handleRequest(){
|
|
|
const request = magicJS.request;
|
|
const request = magicJS.request;
|
|
|
if (LOGIN_REGEX.test(request.url) && request.headers.hasOwnProperty('savedata') == false) {
|
|
if (LOGIN_REGEX.test(request.url) && request.headers.hasOwnProperty('savedata') == false) {
|
|
|
let hisBody = magicJS.read(LOGIN_BODY_KEY, 'default');
|
|
let hisBody = magicJS.read(LOGIN_BODY_KEY, 'default');
|
|
|
- hisBody = null;
|
|
|
|
|
if (hisBody != request.body) {
|
|
if (hisBody != request.body) {
|
|
|
magicJS.write(LOGIN_BODY_KEY, request.body, 'default');
|
|
magicJS.write(LOGIN_BODY_KEY, request.body, 'default');
|
|
|
let reqParams = magicJS.parseQueryStr(request.body);
|
|
let reqParams = magicJS.parseQueryStr(request.body);
|
|
|
- magicJS.log(JSON.stringify(reqParams));
|
|
|
|
|
let username = reqParams.u_name;
|
|
let username = reqParams.u_name;
|
|
|
let usertoken = reqParams.u_token;
|
|
let usertoken = reqParams.u_token;
|
|
|
if(username && usertoken){
|
|
if(username && usertoken){
|
|
@@ -178,6 +176,8 @@ function getUserInfo(){
|
|
|
let username = magicJS.read(USERNAME_KEY, 'default');
|
|
let username = magicJS.read(USERNAME_KEY, 'default');
|
|
|
let body = `action=get_user_info&username=${username}&c_devid=${devicedId}&isAjaxInvoke=true`;
|
|
let body = `action=get_user_info&username=${username}&c_devid=${devicedId}&isAjaxInvoke=true`;
|
|
|
if (!!cookie && !!body) {
|
|
if (!!cookie && !!body) {
|
|
|
|
|
+ checkin_options.referer = 'https://apph5.manmanbuy.com/renwu/index.aspx?m_from=my_daka';
|
|
|
|
|
+ checkin_options.url = 'https://apph5.manmanbuy.com/renwu/index.aspx';
|
|
|
checkin_options.headers['cookie'] = cookie;
|
|
checkin_options.headers['cookie'] = cookie;
|
|
|
checkin_options.body = body;
|
|
checkin_options.body = body;
|
|
|
magicJS.post(checkin_options, (err, resp, data) => {
|
|
magicJS.post(checkin_options, (err, resp, data) => {
|
|
@@ -186,6 +186,7 @@ function getUserInfo(){
|
|
|
magicJS.log(`获取用户信息失败,http请求异常:${err}`);
|
|
magicJS.log(`获取用户信息失败,http请求异常:${err}`);
|
|
|
} else {
|
|
} else {
|
|
|
try {
|
|
try {
|
|
|
|
|
+ magicJS.log(data);
|
|
|
let obj = JSON.parse(data);
|
|
let obj = JSON.parse(data);
|
|
|
if (obj['code'] == 1) {
|
|
if (obj['code'] == 1) {
|
|
|
retData = obj;
|
|
retData = obj;
|
|
@@ -209,6 +210,7 @@ function checkIn(){
|
|
|
let username = magicJS.read(USERNAME_KEY, 'default');
|
|
let username = magicJS.read(USERNAME_KEY, 'default');
|
|
|
let body = `action=checkin&username=${username}&c_devid=${devicedId}&isAjaxInvoke=true`;
|
|
let body = `action=checkin&username=${username}&c_devid=${devicedId}&isAjaxInvoke=true`;
|
|
|
if (!!cookie && !!body) {
|
|
if (!!cookie && !!body) {
|
|
|
|
|
+ checkin_options.url = 'https://apph5.manmanbuy.com/renwu/index.aspx?m_from=my_daka';
|
|
|
checkin_options.headers['cookie'] = cookie;
|
|
checkin_options.headers['cookie'] = cookie;
|
|
|
checkin_options.body = body;
|
|
checkin_options.body = body;
|
|
|
magicJS.post(checkin_options, (err, resp, data) => {
|
|
magicJS.post(checkin_options, (err, resp, data) => {
|