Get Current User Id in Lightning

You need to call the $A.get("$SObjectType.CurrentUser.Id"), to get the User Id in the Lightning JS Controller.

var userId = $A.get("$SObjectType.CurrentUser.Id");
Console.log(userId);