Advertisement
Guest User

Untitled

a guest
Sep 17th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. $scope.loginUser = function () {
  2. var reqq = {
  3. method: 'POST',
  4. url: '/Token',
  5. data: "userName=123@tut.by&password=12345Yy*&grant_type=password"
  6. };
  7.  
  8.  
  9. $http(reqq).then(function successCallback(data) {
  10. console.log(data.data.userName);
  11. sessionStorage.setItem(tokenKey, data.data.access_token);//что такое tokenKey ?
  12.  
  13. }, function errorCallback(res) {
  14. console.log(res);
  15. });
  16. };
  17.  
  18. $scope.userInfo = function () {
  19. $http({
  20. method: 'GET',
  21. url: '/api/Account/UserInfo'
  22. }).then(function successCallback(res) {
  23. console.log(res);
  24. }, function errorCallback(res) {
  25. console.log(res);
  26. });
  27. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement