登录的js代码大致是这样,输入用户名和密码可以获取到token,要怎么把token延续到后续相关页面里都能用到?
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!");
});
}});
jeck猫
相关分类