问题一,intellij打开工程在每个java文件上有个红色的无效符的解决办法:
说明该类不是可编译文件。在project Structure中(快捷键ctrl+alt+shift+s)选Modules将你带红圈的文件添加上,将你带红圈的文件夹设为Sources。一般是src文件夹,点Sources文件夹,然后点击OK。设置为可编译文件再去工程中看就没红圈了。
Web安全通讯之JWT的Java实现
官网地址:https://jwt.io/
jwt github:https://github.com/jwtk/jjwt
Demo源码地址: https://github.com/wangcantian/SecurityCommDemo
JWT Jar 包下载:http://pan.baidu.com/s/1pLqJYUv
参考: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通过$http(config)的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'} //请求头里会添加Authorization属性为'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() });