Authored by htoooth

fix

{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:01:25","_id":"0KGu42ESbnFJy8JC"}
{"name":"tao.huang","message":"签到成功 {\"result\":\"签到成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 17:08:24\"}","createdAt":"2018-11-30 17:08:37","_id":"2E5oFB84rfHKtkkC"}
{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:03:12","_id":"2qzoyn803BSxrkgX"}
{"name":"tao.huang","message":"签到成功 {\"result\":\"签到成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 17:02:52\"}","createdAt":"2018-11-30 17:03:05","_id":"32UE9GlvyVo6HpqM"}
{"name":"tao.huang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:00:09","_id":"DMD1WWrMHALHkWxd"}
{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 16:53:55","_id":"HsQgMGfOjKnrOlu7"}
{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:04:28","_id":"Jgni7kdySFc91cWg"}
{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:01:22","_id":"QCZ7f0RfpNE9P769"}
{"name":"jam.wang","message":"签到成功 {\"result\":\"签到成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 17:12:20\"}","createdAt":"2018-11-30 17:12:33","_id":"SJs6uh8TsmEhLQ4w"}
{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:05:23","_id":"Strs5cYPHOacUyR9"}
{"name":"tao.huang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 16:56:08","_id":"VTnIpb1kzKzz2NpL"}
{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:10:19","_id":"XQInAsMGcqVLVk8d"}
{"name":"tao.huang","message":"签到成功 {\"result\":\"签到成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 17:01:43\"}","createdAt":"2018-11-30 17:01:56","_id":"YXWSU8WOn9S8dc0A"}
{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:10:40","_id":"Zs0sCF9d0OxllEuG"}
{"name":"tao.huang","message":"签到成功 {\"result\":\"签到成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 17:00:15\"}","createdAt":"2018-11-30 17:00:28","_id":"a9seczSVGvcVKKz3"}
{"name":"tao.huang","message":"签到成功 {\"result\":\"签到成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 16:41:55\"}","createdAt":"2018-11-30 16:42:07","_id":"bVhX5ufMGgcQr8j1"}
{"name":"tao.huang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:00:20","_id":"efnBVkMFts1AVDCG"}
{"name":"tao.huang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 16:59:40","_id":"jbFO2up4HgWeceWg"}
{"name":"tao.huang","message":"签出成功 {\"result\":\"签出成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 16:42:27\"}","createdAt":"2018-11-30 16:42:40","_id":"m6ElrOjciJHbJ5GP"}
{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:09:15","_id":"rqXh9UgVVUS6a7PH"}
{"name":"jam.wang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:01:25","_id":"sUJ0k2tR1o6aMILP"}
{"name":"tao.huang","message":"签到成功 {\"result\":\"签到成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 17:00:30\"}","createdAt":"2018-11-30 17:00:43","_id":"tter1UT1hLQhEkuK"}
{"name":"tao.huang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:02:16","_id":"uZhrqBfR7egIv4S4"}
{"name":"tao.huang","message":"用户名,密码或设备id 错误,请改正","createdAt":"2018-11-30 17:02:13","_id":"w4k8LrrZo2qnvevh"}
{"name":"tao.huang","message":"签到成功 {\"result\":\"签到成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 17:00:27\"}","createdAt":"2018-11-30 17:00:39","_id":"yGurlS9KYm1eqweS"}
{"name":"jam.wang","message":"签到成功 {\"result\":\"签到成功\",\"msg\":\"如因工作原因迟到或早退请提交相应流程,签到(签退)时间:2018-11-30 17:24:54\"}","createdAt":"2018-11-30 17:25:07","_id":"fWSX0oPr2hlEV81Y"}
... ...
{"name":"tao.huang","password":"huangtao3.1415926","udid":"868233033762392","_id":"jiZcM7rqzJI1nlIE","autoAm":1,"autoCheckin":1,"autoCheckout":1}
{"name":"tao.huang","password":"Huangtao2","udid":"868233033762392","_id":"jiZcM7rqzJI1nlIE","autoAm":1,"autoCheckin":1,"autoCheckout":1,"device":"android"}
{"name":"jam.wang","password":"Wang1234","udid":"7683D66E-3D76-4DD7-83B7-A89D83FF7937","_id":"jiZcM7rqzJI1nlIF","autoAm":1,"autoCheckin":1,"autoCheckout":1,"device":"iPhone"}
... ...
... ... @@ -61,6 +61,7 @@ class UserModel extends Model {
loginid: doc.name,
password: doc.password,
udid: doc.udid,
clienttype: doc.device
})
})
})
... ... @@ -80,6 +81,7 @@ class UserModel extends Model {
loginid: u.name,
password: u.password,
udid: u.udid,
clienttype: u.device
}
})
... ... @@ -102,6 +104,7 @@ class UserModel extends Model {
loginid: u.name,
password: u.password,
udid: u.udid,
clienttype: u.device
}
})
... ...
... ... @@ -4,14 +4,31 @@ const END_POINT = 'http://holiday-api.leanapp.cn/api/v1/work'
async function getWorkday(date) {
return new Promise(function(resolve, reject) {
request.get(END_POINT, {qs: {date}, json:true}, function(err, res, body) {
if (err) {
reject(err)
return
}
// request.get(END_POINT, {qs: {date}, json:true}, function(err, res, body) {
// if (err) {
// reject(err)
// return
// }
// resolve(body)
// })
const now = new Date();
const n = now.getDay();
resolve(body)
})
if ([0, 1].includes(n)) {
return resolve({
data: {
shouldWork: 'N'
}
});
}
return resolve({
data: {
shouldWork: 'Y'
}
});
})
}
... ...
const _ = require('lodash');
const data = {
"method": "login",
"isneedmoulds": 1,
"client": 1,
"clientver": "6.5.38",
"clientos": "NMF26X",
"clientosver": "7.1.1",
// "isneedmoulds": 1,
// "client": 1,
// "clientver": "6.5.38",
// "clientos": "NMF26X",
// "clientosver": "7.1.1",
// "clienttype": "iPhone",
"clienttype": "android",
"language": "en",
"country": "US",
"relogin": 1
// "relogin": 1
}
async function login(session, params) {
return new Promise(function(resolve, reject) {
session.post('/client.do', {
form: Object.assign({}, data, params),
form: _.merge({}, data, params),
json: true,
}, function(err, res, body) {
if (err) {
... ...