登錄的js代碼大致是這樣,輸入用戶名和密碼可以獲取到token,要怎么把token延續(xù)到后續(xù)相關(guān)頁(yè)面里都能用到?var App = angular.module('lcdApp', []);App.controller('loginCtrl', function ($scope, $http, $window) {$scope.loginClick = function () {
$http.post('url', {
username: $scope.username,
password: $scope.password
}).success(function (data, status, headers, config) {
})
.error(function (data, status, headers, config) {
console.log("http usrreg error!");
});
}});
怎么在登錄驗(yàn)證的過(guò)程中存儲(chǔ)token,并在相關(guān)的后續(xù)頁(yè)面都拿到這個(gè)token?
喵喵時(shí)光機(jī)
2018-10-17 13:39:38