feat: implement miniapp C-group pages with real API calls and design tokens
This commit is contained in:
+8
-1
@@ -6,7 +6,14 @@
|
||||
*/
|
||||
const isDev = (function() {
|
||||
try {
|
||||
// 使用非废弃的 API(wx.getSystemInfoSync 在基础库 3.7.0+ 已废弃)
|
||||
const accountInfo = typeof wx.getAccountInfoSync === 'function'
|
||||
? wx.getAccountInfoSync()
|
||||
: null;
|
||||
if (accountInfo && accountInfo.miniProgram && accountInfo.miniProgram.envVersion === 'develop') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 兼容旧基础库与部分自动化运行环境。
|
||||
const info = wx.getDeviceInfo ? wx.getDeviceInfo() : wx.getSystemInfoSync();
|
||||
return info.platform === 'devtools';
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user