Skip to content

Commit 1cb49ee

Browse files
committed
leaflet&ol 新增iServer安全认证范例
1 parent ee45216 commit 1cb49ee

15 files changed

+978
-9
lines changed

dist/iclient-classic.js

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10818,6 +10818,55 @@ _SuperMap2.default.SecurityManager = {
1081810818
return this.keys[key];
1081910819
},
1082010820

10821+
/**
10822+
* @description iServer登录验证
10823+
* @param url -{string} iServer首页地址,如:http://localhost:8090/iserver
10824+
* @param username -{string} 用户名
10825+
* @param password -{string} 密码
10826+
* @param rememberme -{boolean} 是否记住
10827+
* @returns {Promise}
10828+
*/
10829+
loginiServer: function loginiServer(url, username, password, rememberme) {
10830+
var end = url.substr(url.length - 1, 1);
10831+
url += end === "/" ? "services/security/login.json" : "/services/security/login.json";
10832+
var loginInfo = {
10833+
username: username && username.toString(),
10834+
password: password && password.toString(),
10835+
rememberme: rememberme
10836+
};
10837+
loginInfo = JSON.stringify(loginInfo);
10838+
var requestOptions = {
10839+
headers: {
10840+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
10841+
}
10842+
};
10843+
return _FetchRequest.FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
10844+
return response.json();
10845+
});
10846+
},
10847+
10848+
/**
10849+
* @description iServer登出
10850+
* @param url -{string} iServer首页地址,如:http://localhost:8090/iserver
10851+
* @returns {Promise}
10852+
*/
10853+
logoutiServer: function logoutiServer(url) {
10854+
var end = url.substr(url.length - 1, 1);
10855+
url += end === "/" ? "services/security/logout" : "/services/security/logout";
10856+
10857+
var requestOptions = {
10858+
headers: {
10859+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
10860+
},
10861+
withoutFormatSuffix: true
10862+
};
10863+
return _FetchRequest.FetchRequest.get(url, "", requestOptions).then(function () {
10864+
return true;
10865+
}).catch(function (ex) {
10866+
return false;
10867+
});
10868+
},
10869+
1082110870
/**
1082210871
* @description Online登录验证
1082310872
* @param callbackLocation -{string} 跳转位置
@@ -10855,7 +10904,7 @@ _SuperMap2.default.SecurityManager = {
1085510904
},
1085610905

1085710906
/**
10858-
* @description iPortal登录验证
10907+
* @description iPortal登出
1085910908
* @param url -{string} iportal首页地址
1086010909
* @returns {Promise}
1086110910
*/

dist/iclient-classic.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-leaflet.js

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7597,6 +7597,55 @@ _SuperMap2["default"].SecurityManager = {
75977597
return this.keys[key];
75987598
},
75997599

7600+
/**
7601+
* @description iServer登录验证
7602+
* @param url -{string} iServer首页地址,如:http://localhost:8090/iserver
7603+
* @param username -{string} 用户名
7604+
* @param password -{string} 密码
7605+
* @param rememberme -{boolean} 是否记住
7606+
* @returns {Promise}
7607+
*/
7608+
loginiServer: function loginiServer(url, username, password, rememberme) {
7609+
var end = url.substr(url.length - 1, 1);
7610+
url += end === "/" ? "services/security/login.json" : "/services/security/login.json";
7611+
var loginInfo = {
7612+
username: username && username.toString(),
7613+
password: password && password.toString(),
7614+
rememberme: rememberme
7615+
};
7616+
loginInfo = JSON.stringify(loginInfo);
7617+
var requestOptions = {
7618+
headers: {
7619+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
7620+
}
7621+
};
7622+
return _FetchRequest.FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
7623+
return response.json();
7624+
});
7625+
},
7626+
7627+
/**
7628+
* @description iServer登出
7629+
* @param url -{string} iServer首页地址,如:http://localhost:8090/iserver
7630+
* @returns {Promise}
7631+
*/
7632+
logoutiServer: function logoutiServer(url) {
7633+
var end = url.substr(url.length - 1, 1);
7634+
url += end === "/" ? "services/security/logout" : "/services/security/logout";
7635+
7636+
var requestOptions = {
7637+
headers: {
7638+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
7639+
},
7640+
withoutFormatSuffix: true
7641+
};
7642+
return _FetchRequest.FetchRequest.get(url, "", requestOptions).then(function () {
7643+
return true;
7644+
})["catch"](function (ex) {
7645+
return false;
7646+
});
7647+
},
7648+
76007649
/**
76017650
* @description Online登录验证
76027651
* @param callbackLocation -{string} 跳转位置
@@ -7634,7 +7683,7 @@ _SuperMap2["default"].SecurityManager = {
76347683
},
76357684

76367685
/**
7637-
* @description iPortal登录验证
7686+
* @description iPortal登出
76387687
* @param url -{string} iportal首页地址
76397688
* @returns {Promise}
76407689
*/

dist/iclient9-leaflet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-mapboxgl.js

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67096,6 +67096,55 @@ _SuperMap2.default.SecurityManager = {
6709667096
return this.keys[key];
6709767097
},
6709867098

67099+
/**
67100+
* @description iServer登录验证
67101+
* @param url -{string} iServer首页地址,如:http://localhost:8090/iserver
67102+
* @param username -{string} 用户名
67103+
* @param password -{string} 密码
67104+
* @param rememberme -{boolean} 是否记住
67105+
* @returns {Promise}
67106+
*/
67107+
loginiServer: function loginiServer(url, username, password, rememberme) {
67108+
var end = url.substr(url.length - 1, 1);
67109+
url += end === "/" ? "services/security/login.json" : "/services/security/login.json";
67110+
var loginInfo = {
67111+
username: username && username.toString(),
67112+
password: password && password.toString(),
67113+
rememberme: rememberme
67114+
};
67115+
loginInfo = JSON.stringify(loginInfo);
67116+
var requestOptions = {
67117+
headers: {
67118+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
67119+
}
67120+
};
67121+
return _FetchRequest.FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
67122+
return response.json();
67123+
});
67124+
},
67125+
67126+
/**
67127+
* @description iServer登出
67128+
* @param url -{string} iServer首页地址,如:http://localhost:8090/iserver
67129+
* @returns {Promise}
67130+
*/
67131+
logoutiServer: function logoutiServer(url) {
67132+
var end = url.substr(url.length - 1, 1);
67133+
url += end === "/" ? "services/security/logout" : "/services/security/logout";
67134+
67135+
var requestOptions = {
67136+
headers: {
67137+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
67138+
},
67139+
withoutFormatSuffix: true
67140+
};
67141+
return _FetchRequest.FetchRequest.get(url, "", requestOptions).then(function () {
67142+
return true;
67143+
}).catch(function (ex) {
67144+
return false;
67145+
});
67146+
},
67147+
6709967148
/**
6710067149
* @description Online登录验证
6710167150
* @param callbackLocation -{string} 跳转位置
@@ -67133,7 +67182,7 @@ _SuperMap2.default.SecurityManager = {
6713367182
},
6713467183

6713567184
/**
67136-
* @description iPortal登录验证
67185+
* @description iPortal登出
6713767186
* @param url -{string} iportal首页地址
6713867187
* @returns {Promise}
6713967188
*/

dist/iclient9-mapboxgl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-openlayers.js

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6937,6 +6937,55 @@ _SuperMap2.default.SecurityManager = {
69376937
return this.keys[key];
69386938
},
69396939

6940+
/**
6941+
* @description iServer登录验证
6942+
* @param url -{string} iServer首页地址,如:http://localhost:8090/iserver
6943+
* @param username -{string} 用户名
6944+
* @param password -{string} 密码
6945+
* @param rememberme -{boolean} 是否记住
6946+
* @returns {Promise}
6947+
*/
6948+
loginiServer: function loginiServer(url, username, password, rememberme) {
6949+
var end = url.substr(url.length - 1, 1);
6950+
url += end === "/" ? "services/security/login.json" : "/services/security/login.json";
6951+
var loginInfo = {
6952+
username: username && username.toString(),
6953+
password: password && password.toString(),
6954+
rememberme: rememberme
6955+
};
6956+
loginInfo = JSON.stringify(loginInfo);
6957+
var requestOptions = {
6958+
headers: {
6959+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
6960+
}
6961+
};
6962+
return _FetchRequest.FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
6963+
return response.json();
6964+
});
6965+
},
6966+
6967+
/**
6968+
* @description iServer登出
6969+
* @param url -{string} iServer首页地址,如:http://localhost:8090/iserver
6970+
* @returns {Promise}
6971+
*/
6972+
logoutiServer: function logoutiServer(url) {
6973+
var end = url.substr(url.length - 1, 1);
6974+
url += end === "/" ? "services/security/logout" : "/services/security/logout";
6975+
6976+
var requestOptions = {
6977+
headers: {
6978+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
6979+
},
6980+
withoutFormatSuffix: true
6981+
};
6982+
return _FetchRequest.FetchRequest.get(url, "", requestOptions).then(function () {
6983+
return true;
6984+
}).catch(function (ex) {
6985+
return false;
6986+
});
6987+
},
6988+
69406989
/**
69416990
* @description Online登录验证
69426991
* @param callbackLocation -{string} 跳转位置
@@ -6974,7 +7023,7 @@ _SuperMap2.default.SecurityManager = {
69747023
},
69757024

69767025
/**
6977-
* @description iPortal登录验证
7026+
* @description iPortal登出
69787027
* @param url -{string} iportal首页地址
69797028
* @returns {Promise}
69807029
*/

dist/iclient9-openlayers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/leaflet/config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,14 @@ var exampleConfig = {
298298
thumbnail: "dataflow.png",
299299
fileName: "dataFlowService"
300300
}]
301+
},
302+
"security": {
303+
name: "安全",
304+
content: [{
305+
name: "安全认证",
306+
thumbnail: "l_iserver_security.png",
307+
fileName: "iServerSecurity"
308+
}]
301309
}
302310
}
303311
},

0 commit comments

Comments
 (0)