@@ -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 */
0 commit comments