package org.nl.config.saconfig;

import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.util.SaResult;
import org.springframework.stereotype.Component;

import java.util.function.BiFunction;

/*
 * @author ZZQ
 * @Date 2022/11/24 3:47 下午
 */
@Component
public class LoginUserHandler implements BiFunction<String, String, Object> {
    @Override
    public Object apply(String user, String password) {
        //用户登入账号密码查询：
        StpUtil.login(Long.valueOf(password));

        return SaResult.ok("登录成功！").setData(StpUtil.getTokenValue());

    }

}
