luodangjia
2024-12-10 ee7ce5d1cbf80bee0a15c1e5bc5eaa30858d812b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.hollywood.applet.utils;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hollywood.applet.service.TUserService;
import com.hollywood.common.model.TUser;
import com.hollywood.common.security.JwtTokenUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
@Component
public class LoginInfoUtil {
 
    @Autowired
    private TUserService tUserService;
 
    public Long getUserId(){
        String username = JwtTokenUtils.getUsername();
//        System.err.println("============"+username);
//        TUser userName = tUserService.getOne(new QueryWrapper<TUser>().eq("userPhone", username).eq("isDelete",0));
        return Long.parseLong(username);
//        return 2L;
    }
}