fix: append base_url for requests from cordova app (#7895)
This commit is contained in:
parent
4134d3773d
commit
4e87357152
2 changed files with 10 additions and 0 deletions
|
|
@ -464,6 +464,11 @@ frappe.Application = Class.extend({
|
|||
return frappe.call('frappe.client.get_hooks', { hook: 'app_logo_url' })
|
||||
.then(r => {
|
||||
frappe.app.logo_url = (r.message || []).slice(-1)[0];
|
||||
if (window.cordova) {
|
||||
let host = frappe.request.url;
|
||||
host = host.slice(0, host.length - 1);
|
||||
frappe.app.logo_url = host + frappe.app.logo_url;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,11 @@ frappe.call = function(opts) {
|
|||
let url = opts.url;
|
||||
if (!url) {
|
||||
url = '/api/method/' + args.cmd;
|
||||
if (window.cordova) {
|
||||
let host = frappe.request.url;
|
||||
host = host.slice(0, host.length - 1);
|
||||
url = host + url;
|
||||
}
|
||||
delete args.cmd;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue