feat: add premit request.
This commit is contained in:
parent
ed9e09a376
commit
13b62c570c
15
game/game.js
15
game/game.js
|
@ -9979,7 +9979,7 @@ new Promise(resolve=>{
|
||||||
'是否退出游戏?',
|
'是否退出游戏?',
|
||||||
function(index){
|
function(index){
|
||||||
switch(index){
|
switch(index){
|
||||||
case 2:game.saveConfig('null');game.reload();break;
|
case 2:game.reload();break;
|
||||||
case 3:navigator.app.exitApp();break;
|
case 3:navigator.app.exitApp();break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -9991,6 +9991,17 @@ new Promise(resolve=>{
|
||||||
navigator.app.exitApp();
|
navigator.app.exitApp();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if ("cordova" in window && "plugins" in window.cordova && "permissions" in window.cordova.plugins) {
|
||||||
|
const permissions = cordova.plugins.permissions;
|
||||||
|
const requests = ["WRITE_EXTERNAL_STORAGE", "READ_EXTERNAL_STORAGE"]
|
||||||
|
requests.forEach((request) => {
|
||||||
|
permissions.checkPermission(permissions[request], (status) => {
|
||||||
|
if (!status.hasPermission) {
|
||||||
|
permissions.requestPermission(permissions[request], lib.other.ignore, lib.other.ignore);
|
||||||
|
}
|
||||||
|
}, lib.other.ignore);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
game.download=function(url,folder,onsuccess,onerror,dev,onprogress){
|
game.download=function(url,folder,onsuccess,onerror,dev,onprogress){
|
||||||
if(!url.startsWith('http')){
|
if(!url.startsWith('http')){
|
||||||
|
@ -10151,7 +10162,7 @@ new Promise(resolve=>{
|
||||||
else{
|
else{
|
||||||
showbar();
|
showbar();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
else if(typeof window.require=='function'){
|
else if(typeof window.require=='function'){
|
||||||
lib.node={
|
lib.node={
|
||||||
|
|
Loading…
Reference in New Issue