Upvote:1
China requires you do apply for a visa from your country of residence unless you apply at the airport for a temporary visa and are allowed to do so according to those rules.
Just beware that the rules for applying for visa at the arrival airport in China is fairly new and the rules changes frequently so it can be an adventure to do so, as part of my job I run a service that helps people traveling in China so we have a fair bit of experience and comments surrounding this and the results are very varied.
To be safe make sure you have the proper valid visa before arriving in China and if you need apply for one do so from your home country