2017-03-17 24 views
0

我在從電子郵件鏈接存儲令牌時遇到了一些問題。實際上,我使用的是angularjs。例如,我得到這個鏈接到我的郵件http://65.147.100.19:8090/UAR-Machine-V0.3_2/#/build/?456456在這個鏈接我想存儲令牌「?456456」當我點擊鏈接,我將重定向到登錄頁面在這個重定向期間我想存儲這個令牌作爲一個對象。令牌使用該令牌驗證經過身份驗證的用戶。與令牌驗證相同,但我希望使用在URL中發佈的動態令牌進行此驗證。 在此先感謝。從URL中存儲令牌到js文件中的對象

+0

請添加要在其中存儲令牌一些代碼和詳細信息,以及你使用的是什麼後臺? – Sravan

+0

你的問題不清楚。請以更好的方式解釋。 – undefined

+0

只要console.log(window.location),看看你是否有東西。 –

回答

0

這裏我打電話給我的網址(與澳鵬我的詳細信息和會話ID等),如波紋管,

"http://localhost:7070/dais-portal/#/SocialLandingPage/"+userID+"/"+entityId+"/"+channelID+"/"+sessionID 

JS文件

app.config(function($stateProvider, $urlRouterProvider, $locationProvider) { 
    /* 
    * $urlRouterProvider.otherwise('/'); 
    */ 
    $stateProvider 

    .state('SocialLandingPage', { 
     url: '/SocialLandingPage/:userID/:entityId/:channelID/:sessionID', 
     views: { 
      'content-page': { 
       templateUrl: 'loginPage/view/dais-dummy-landing-page.html' 
      } 
     } 
    }) 
    } 

僞着陸page.html中,這裏被稱爲一個控制器。並獲取所有值(如用戶ID,entityId,channelID和會話ID)

從該控制器。 我越來越喜歡這個,

$scope.userID = $stateParams.userID; 
$scope.entityId = $stateParams.entityId; 
$scope.channelID = $stateParams.channelID; 
$scope.sessionID = $stateParams.sessionID; 
相關問題