|
@@ -46,6 +46,22 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //APP权限申请
|
|
|
+ function requestPermission(){
|
|
|
+ var Permission = window.plugins.Permission;
|
|
|
+ if(!Permission){
|
|
|
+ console.log('window.plugins.Permission not installed!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var permissions = [
|
|
|
+ 'android.permission.ACCESS_FINE_LOCATION'//获取GPS定位权限
|
|
|
+ ];
|
|
|
+ Permission.request(permissions, function(results) {
|
|
|
+ console.log('Permission.request finished');
|
|
|
+ }, alert);
|
|
|
+ }
|
|
|
+
|
|
|
renlian.init(function () {
|
|
|
// 处理 Cordova 暂停并恢复事件
|
|
|
document.addEventListener('pause', onPause.bind(this), false);
|
|
@@ -53,6 +69,8 @@
|
|
|
renlian.tab.init(tabdata);
|
|
|
//APP检查更新
|
|
|
checkAppUpdate();
|
|
|
+ //APP权限申请
|
|
|
+ requestPermission();
|
|
|
var logininfo = renlian.storage.get('logininfo');
|
|
|
if (logininfo) {// 有登录的token
|
|
|
renlian.nav.go({ path: 'amap', title: '地图', type: 'right', isBack: false });
|