Nigeria has convicted nearly 400 Islamist militants following mass trials held this week in the capital ​Abuja, the country's Attorney General said late on Friday.