Problem 1, the solution to intellij opening the project with a red invalid character on each java file:
Indicates that the class is not a compilable file. In the project Structure (shortcut ctrl+alt+shift+s), select Modules to add the file with the red circle, and set the folder with the red circle as Sources. Usually the src folder, click the Sources folder, and then click OK. Set it as a compilable file and then go to the project to see that there is no red circle.
Java Implementation of JWT for Web Security Communication
Official website address: https://jwt.io/
jwt github:https://github.com/jwtk/jjwt
Demo source address: https://github.com/wangcantian/SecurityCommDemo
JWT Jar package download: http://pan.baidu.com/s/1pLqJYUv
Reference: http://blog.csdn.net/wangcantian/article/details/74330458
http://blog.csdn.net/a82793510/article/details/53509427
http://blog.csdn.net/sun_t89/article/details/51923017
http://www.cnblogs.com/xiekeli/p/5607107.html
Angularjs configures the request header of the request through the config parameter of $http(config):
var httpGet = angular.module('HttpGet',[]); httpGet.factory('getData',function($http,$q){ return function(){ var defer = $q.defer(); $http({ method:'get', url:'/api/user', headers: {'Authorization':'code_bunny'} //The Authorization attribute will be added to the request header as 'code_bunny' }).success(function(data,status,headers,config){ defer.resolve(data); }).error(function(data,status,headers,config){ defer.reject(data) }); return defer.promise } }); httpGet.controller('dataController',function($scope,getData){ $scope.data = getData() });