cqdevicemgt/sgzb-gateway/src/main/java/com/bonus/sgzb/gateway/SgzbGatewayApplication.java

47 lines
1.7 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.bonus.sgzb.gateway;
import org.jasypt.encryption.StringEncryptor;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import javax.annotation.Resource;
/**
* 网关启动程序
*
* @author ruoyi
*/
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
public class SgzbGatewayApplication implements CommandLineRunner {
public static void main(String[] args)
{
SpringApplication.run(SgzbGatewayApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 网关启动成功 ლ(´ڡ`ლ)゙ \n");
}
@Resource
private StringEncryptor encryptor;
@Override
public void run(String... args) throws Exception {
// String nacos = encrypt("Jjsp@nacos2023" );
// String mysqlNm = encrypt("root" );
// String mysqlPs = encrypt("Bonus@admin123!" );
// String redis = encrypt("Dszbns@Redis123!" );
// System.err.println( "nacos原始明文密码加密后的结果为" + nacos );
// System.err.println( "mysqlNm原始明文密码加密后的结果为" + mysqlNm );
// System.err.println( "mysqlPs原始明文密码加密后的结果为" + mysqlPs );
// System.err.println( "redis原始明文密码加密后的结果为" + redis );
}
private String encrypt( String originPassord ) {
return encryptor.encrypt( originPassord );
}
private String decrypt( String encryptedPassword ) {
return encryptor.decrypt( encryptedPassword );
}
}