记录一次jjwt-gson的配置问题,希望能帮到更多的人
最近要搭设一个新项目,这次在选用jwt的时候没有再直接用下面这个版本, <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt</artifactId> <version>0.9.1</version> </dependency> 而jjwt-gson是一直有在更新的,因此博主这次想试试他,配置gson的话需要两个文件,不然会少包 <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt-gson</artifactId> <version>0.11.0</version> <!--<scope>runtime</scope>因为gson还要用,所以此处注释了--> </dependency> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt-impl</artifactId> <version>0.11.0</version> <scope>runtime</scope> </dependency> 其他按照网上教程走,走完发现控制台报错,一脸懵逼 SecretKey key = new SecretKeySpec(encodedKey, 0,