package com.fs.app.controller;


import com.fs.app.utils.JwtUtils;
import com.fs.common.core.redis.RedisCache;
import com.fs.common.utils.ServletUtils;
import io.jsonwebtoken.Claims;
import org.springframework.beans.factory.annotation.Autowired;


public class AppBaseController {
	@Autowired
	JwtUtils jwtUtils;
	@Autowired
	RedisCache redisCache;

	public String getUserId()
	{
		String headValue =  ServletUtils.getRequest().getHeader("APPToken");
		Claims claims=jwtUtils.getClaimByToken(headValue);
		String userId = claims.getSubject().toString();
		return userId;
	}


}
