The State Legislature shifted legal authority from the secretary of state to a Republican attorney general, and enacted election measures it said would stop fraud.