BEIJING—President Xi Jinping, battling a persistent downturn in China’s economy, is trying to gird his rule by demanding absolute loyalty from the Communist Party in an effort to stifle simmering dissent.

In recent weeks, Mr. Xi has put members of the ruling party on notice. He summoned senior officials from across China to warn them about “major risks” to the world’s No. 2 economy, reminding them to shoulder responsibility for solving problems. His administration issued a slew of new party directives demanding “unity and...