2019-03-04 11:00:26 卢浮宫 版权声明:本文为站长原创文章,转载请写明出处
private static void doDataAuth(RequestEventArgs e, IParameter pAuthType) { string authType = pAuthType.Value.ToString(); if (authType.Equals("device")) { string data = Util.memeryStreamToString(e.Request.Body), send; string pin = getPinByData(data); string inout = getInOutByData(data); string time = getDatetimeByData(data); bool copsOK = checkEmpAuth_rtm(pin,inout,time); if (copsOK) { //reader 2,4 =》lock 1 出门 inout 值 1 //reader 1,3 =》lock 2 进门 inout 值 0 string openCmd = ""; if (inout.Equals("0")) openCmd = "1 2 1 1"; else openCmd = "1 1 1 1"; send = "AUTH=SUCCESS\r\n" + data + "CONTROL DEVICE " + openCmd; } else { send = "AUTH=FAILED\r\n" + data; } Core.writeBack(e, send); } else Core.writeBack(e, "OK");}