47 lines
1.7 KiB
Java
47 lines
1.7 KiB
Java
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 );
|
||
}
|
||
}
|