aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller/Root.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-18 17:12:14 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-18 17:12:14 +0500
commit38d94e65e9bb46cc10cbe7559daa41d1468ba853 (patch)
tree2250da5fe2125e1ddcba99332eb578f39d8c0eb8 /web/app/controller/Root.js
parentef58095c5f841863c271c9f0995a20ac5215fe58 (diff)
downloadetbsa-traccar-web-38d94e65e9bb46cc10cbe7559daa41d1468ba853.tar.gz
etbsa-traccar-web-38d94e65e9bb46cc10cbe7559daa41d1468ba853.tar.bz2
etbsa-traccar-web-38d94e65e9bb46cc10cbe7559daa41d1468ba853.zip
Fix passing parameter and variable declaration
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r--web/app/controller/Root.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index b0067c0..adc188c 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -37,11 +37,14 @@ Ext.define('Traccar.controller.Root', {
var tokenParameter;
if (success) {
Traccar.app.setServer(Ext.decode(response.responseText));
- tokenParameter = window.location.search.match('/token=([a-zA-Z0-9]+)/');
- tokenParameter = tokenParameter !== null ? '?' + tokenParameter[0] : '';
+ tokenParameter = window.location.search.match('token=([a-zA-Z0-9]+)');
Ext.Ajax.request({
scope: this,
- url: 'api/session' + tokenParameter,
+ url: 'api/session',
+ method: 'GET',
+ params: tokenParameter !== null ? {
+ token: tokenParameter[1]
+ } : {},
callback: this.onSessionReturn
});
} else {