Выйти из SAP hana cloud Приложение Angularjs

Я сталкиваюсь с пользователем, чтобы выйти из приложения в SAP. Приложение находится в режиме аутентификации. Поэтому пользователю необходимо войти в систему с именем пользователя SAP, чтобы просмотреть приложение. в этом случае Как выйти из приложения Angular 1.x в SAP Hana.

нео-app.json

{
"welcomeFile": "/index.html",
"logoutPage": "/logout.html",
"routes": [{
    "path": "/services/userapi",
    "target": {
        "type": "service",
        "name": "userapi"

    }
}  ]
}

HTML

<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>

<div ng-app="myApp" ng-controller="myCtrl"> 

<p>Hello:{{username}}</p>

<a href="" ng-click="logout()">Logout</a>

</div>

<p>The $http service requests a page on the server, and the response is set as the value of the "myWelcome" variable.</p>

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {

    $http({
      method : "GET",
      url : "/services/userapi/currentuser",
      headers: {'Content-Type': 'application/json'}
    }).then(function mySuccess(response) {
      $scope.username = response.data.name;
      });
  $scope.logout = function(){

  }
});
</script>

</body>
</html>

0 ответов

Другие вопросы по тегам