无关风月
2025-01-10 2c258c39133435fa0e6e6da85d503982fd5a967d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.jilongda.applet.aspect;
 
 
import com.jilongda.applet.model.TAppUser;
import com.jilongda.applet.utils.LoginInfoUtil;
import com.jilongda.common.exception.TokenException;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
 
@Aspect
@Component
 
public class StateAspect {
    @Autowired
    private LoginInfoUtil loginInfoUtil;
    @Pointcut("execution(* com.jilongda.applet.controller.*.*(..)) && !execution( * com.jilongda.applet.controller.LoginController.*(..))")
    public void state(){
 
    }
 
//    @Before("state()")
//    public void isfrozen(){
//
//        TAppUser loginUser = loginInfoUtil.getLoginUser();
//        if (loginUser==null){
//            throw new TokenException("当前账号已被删除");
//        }
//
//        if (loginUser.getStatus()==0){
//            throw new TokenException("账号已冻结");
//        }
//
//        System.err.println("进入切面");
//
//    }
 
 
 }