办学质量监测教学评价系统
lindaxia
2025-05-26 6a93856d90a3acaf408f67965cbe73be51fefa4a
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
package org.ruoyi.common.mail.utils;
 
import jakarta.mail.Authenticator;
import jakarta.mail.PasswordAuthentication;
 
/**
 * 用户名密码验证器
 *
 * @author looly
 * @since 3.1.2
 */
public class UserPassAuthenticator extends Authenticator {
 
    private final String user;
    private final String pass;
 
    /**
     * 构造
     *
     * @param user 用户名
     * @param pass 密码
     */
    public UserPassAuthenticator(String user, String pass) {
        this.user = user;
        this.pass = pass;
    }
 
    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(this.user, this.pass);
    }
 
}