|
本帖最后由 蓝色江 于 2019-6-28 09:04 编辑
是的,你说的是关键,我好像突然明白了,可是我回想了一下,我直接弄机智云的demo到app时只留了config.xml,按照要求修改了config.xml内容,而且在运端添加了机智云的模块,对于模块的引用代码完全时机智云自动生成的代码:
apiready = function(){
api.setStatusBarStyle({
style: 'dark',
color: '#fff'
});
['gizWifiSDK', 'gizWifiDevice'].map(function(){
window[ arguments[0] ] = api.require( arguments[0] );
});
$api.rmStorage( 'hasBack' );
$api.setStorage('appID', api.systemType === 'ios' ? 'ea7117653404492cbc769ec':'397639f2456d5b55a864');
$api.setStorage('appSecret', api.systemType === 'ios' ? 'd469a95d46a4a883190b1c':'904d5b44e696951294f8');
$api.setStorage('specialProductKeys', ['4203a557391f6b2d']);
// 初始化机智云模块
gizWifiSDK.startWithAppID({
appID: $api.getStorage('appID'),
appSecret: $api.getStorage('appSecret'),
specialProductKeys: $api.getStorage('specialProductKeys'),
cloudServiceInfo: null,
autoSetDeviceDomain: false
}, function(ret, err) {
if(ret && ret.errorCode === 8316 ){
fnJumpWin({
name: 'login',
path: '/user',
slidBackEnabled: true,
y: 0
})
// fnJumpWin({
// name: 'deviceControl',
// path: '/deviceControl',
// slidBackEnabled: true,
// y: 0
// })
}else{
fnNotes( err );
}
});
gizWifiSDK.setLogLevel({"logLevel": 0});
}其中:['gizWifiSDK', 'gizWifiDevice'].map(function(){
我只添加了gizWifiSDK模块,没有'gizWifiDevice'这个模块啊
是否应该加一句:var gizWifiSDK = api.require('gizWifiSDK');
|
|