uniapp applet development environment and production environment

uni development applet
Run to the development tool and upload process.env.NODE_ENV The value obtained is development, which has always been the development environment.
Using uni to publish and upload to the WeChat public platform is the generation environment.
In HBuilderX, the code compiled by clicking "Run" is the development environment , click "Release" to compile the code is the production environment

	let url;
	if (process.env.NODE_ENV === 'development') {
		url = 'http://127.0.0.1:3000/ceshi' //测试
	} else {
		url = 'http://127.0.0.1:3000/zhengshi' //正式
	}

WeChat public platform link:
refer to parameters in order
1 project name
2 applet appid
3 select automatic upload to WeChat platform
4 version number custom
5 upload key value log in to WeChat public platform [Development -> Development Management], click tab [Development Settings] Generate secret key download and fill in
6 Description Customize
7 Publish (Click to update HBuilderX to the latest version if there is no response or the pop-up box is different) Click Publish and the plug-in will run directly on the console and wait patiently to install the plug-in before releasing without plug-in
8 What is submitted is the generation environment of the applet

è¿éæå¥å¾çæè¿°

è¿éæå¥å¾çæè¿° 

 

Guess you like

Origin blog.csdn.net/slow097/article/details/128465323