21 lines
433 B
JavaScript
21 lines
433 B
JavaScript
const accountInfo = wx.getAccountInfoSync();
|
|
export const envVersion = accountInfo.miniProgram.envVersion;
|
|
let type = 3;
|
|
if (envVersion === 'trial') {
|
|
console.log('当前环境是体验版');
|
|
type = 2;
|
|
} else if (envVersion === 'release') {
|
|
console.log('当前环境是正式版');
|
|
type = 0;
|
|
} else {
|
|
type = 1;
|
|
console.log('当前环境是开发版或其他');
|
|
}
|
|
|
|
|
|
export function wxShare(par) {
|
|
return {
|
|
...par,
|
|
type
|
|
}
|
|
} |