Use my.getRunScene to retrieve the version type of the running mini program.
my.getRunScene
Note
-
Requires basic library 1.10.0 or later. Lower versions need compatibility handling. For details, see the Mini Program base libraries.
-
Requires mPaaS 1.10.60 or later.
Gets the version type of the running mini program.
Parameters
Object with the following attributes:
|
Attribute |
Type |
Required |
Description |
|
success |
Function |
No |
Called on success. |
|
fail |
Function |
No |
Called on failure. |
|
complete |
Function |
No |
Called when the call completes, regardless of outcome. |
Success response
|
Property |
Type |
Description |
|
envVersion |
String |
Version type of the running mini program. Valid values: develop (development), trial, release, gray (grayscale). |
Error codes
|
Error code |
Meaning |
|
3 |
Unknown error. |
Code sample
my.getRunScene({
success(result) {
my.alert({
title: 'Mini program version',
content:`${result.envVersion}`
});
},
})
该文章对您有帮助吗?