The Constitution is pretty cut and dry on this. Looking at the section you quote:
The only unconstitutional part could be that a Governor could veto it. The Constitution is pretty clear that if Illinois wanted to award electoral votes to the Democratic nominee, even if the Republicans won it, they are constitutionally empowered to do so.
I am fairly sure that in the early years of the Republic, the legislature actually did allocate electoral votes, but the practice quickly died out.
Re: the original question, it is completely constitutional, per the Constitution, for the Legislature to award electoral votes based on the national popular vote. There is no requirement that the popular vote within the state be a criteria for electoral college vote allocation. The Electoral College, in fact, was constructed to empower small states and to help smaller regions to have an impact on the Presidency.
(I don't support this and believe the electoral college a work of genius. But there you have it).