EnvVersion: ‘develop’, // Development version

EnvVersion: ‘trial’, // Trial version

EnvVersion: ‘release’, // Official version

Core code:

console.log('envVersion',__wxConfig.envVersion);
Copy the code

__wxconfig. envVersion indicates the applets version of the user

Print result:

If it is a development version it will be: envVersion Develop

Example of a wrapper function:

function version(){ console.log('envVersion', __wxConfig.envVersion); let version = __wxConfig.envVersion; Switch (version) {case 'develop': return 'https:// test environment domain '; break; Case 'trial': return 'https:// Trial environment domain name '; break; Case 'release': return 'https:// '; break; Default: return 'https:// test environment domain name '; }} // call version();Copy the code