Example #1
0
        public IHttpActionResult GetIdentity()
        {
            string      token       = Request.Headers.Authorization.Parameter;
            JwtAuthUtil jwtAuthUtil = new JwtAuthUtil();
            string      identity    = jwtAuthUtil.GetIdentity(token);

            if (identity == "0")
            {
                return(Ok(new
                {
                    result = true,
                    message = "顧客"
                }));
            }
            else if (identity == "1")
            {
                return(Ok(new
                {
                    result = true,
                    message = "餐車"
                }));
            }
            return(Ok(new
            {
                result = false,
                message = "其他"
            }));
        }