예제 #1
0
        public object FaceRegistration()
        {
            try
            {
                var user = CurrentUserView;
                if (user == null)
                {
                    throw new Exception("获取用户信息失败!");
                }
                var http = HttpContext.Current;
                var form = http.Request.Form;

                string image  = form["image"];
                string source = RoleType.Supplier.ToString();
                using (ClientSiteClientProxy proxy = new ClientSiteClientProxy(ProxyEx(user)))
                {
                    var userFaceResult = proxy.AddAIUserFaceInfo(user.UserId, image, source);

                    if (userFaceResult.Flag == EResultFlag.Success && userFaceResult.Data == 1)
                    {
                        return(APIResult.GetSuccessResult(MsgCode.Success, "操作成功!"));
                    }
                    else
                    {
                        return(APIResult.GetErrorResult(MsgCode.CommonError, "操作失败!"));
                    }
                }
            }
            catch
            {
                return(APIResult.GetErrorResult(MsgCode.UserInfoError, "获取用户信息错误!"));
            }
        }