public commonresponse declarationSign([FromBody] declarationsignrequest input) { if (input == null) { return(new commonresponse { status = responseStatus.requesterror }); } var accinfo = highlevel.GetInfoByToken(Request.Headers); if (accinfo.status != responseStatus.ok) { return(accinfo); } if (!savePic(input.sign_pic, picType.declaration_sign, accinfo.Identity, accinfo.businessType)) { return new commonresponse { status = responseStatus.fileprocesserror } } ; return(new commonresponse { status = responseStatus.ok }); }
public commonresponse declarationSign([FromBody] declarationsignrequest input) { if (input == null) { return(new commonresponse { status = responseStatus.requesterror }); } var identity = string.Empty; var btype = businessType.basicinfo; try { var htoken = Request.Headers["token"].First(); if (string.IsNullOrEmpty(htoken)) { return(new commonresponse { status = responseStatus.tokenerror }); } var found = false; foreach (var a in tokens) { if (a.Token == htoken) { identity = a.idinfo.Identity; btype = a.idinfo.businessType; found = true; break; } } if (!found) { var redisdb = highlevel.redis.GetDatabase(); var cacheidinfo = redisdb.StringGet(htoken); if (cacheidinfo == "nil") { return(new commonresponse { status = responseStatus.tokenerror }); } var ci = JsonConvert.DeserializeObject <idinfo>(cacheidinfo); identity = ci.Identity; btype = ci.businessType; } } catch (Exception ex) { return(new commonresponse { status = responseStatus.tokenerror }); } // if (string.IsNullOrEmpty(input.id_back)) // { // return new commonresponse { status = responseStatus.imageerror }; // } if (!savePic(input.sign_pic, picType.declaration_sign, identity, btype)) { return new commonresponse { status = responseStatus.fileprocesserror } } ; return(new commonresponse { status = responseStatus.ok }); }