|  |  | @ -4,6 +4,11 @@ import com.glxp.api.util.RsaUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.context.ApplicationContextInitializer; |  |  |  | import org.springframework.context.ApplicationContextInitializer; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.context.ConfigurableApplicationContext; |  |  |  | import org.springframework.context.ConfigurableApplicationContext; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import java.io.IOException; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import java.nio.file.Files; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import java.nio.file.Path; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import java.nio.file.Paths; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | public class ToolApplicationContextInitializer implements ApplicationContextInitializer { |  |  |  | public class ToolApplicationContextInitializer implements ApplicationContextInitializer { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
	
		
		
			
				
					|  |  | @ -18,14 +23,30 @@ public class ToolApplicationContextInitializer implements ApplicationContextInit | 
			
		
	
		
		
			
				
					
					|  |  |  |                 "hbn1tobX+al4XvfRpjoCjST2mRfqCt4aNuBDM1LHMzyMBVJpfui91ikLGMgP4Gdf" + |  |  |  |                 "hbn1tobX+al4XvfRpjoCjST2mRfqCt4aNuBDM1LHMzyMBVJpfui91ikLGMgP4Gdf" + | 
			
		
	
		
		
			
				
					
					|  |  |  |                 "swIDAQAB"; |  |  |  |                 "swIDAQAB"; | 
			
		
	
		
		
			
				
					
					|  |  |  |         try { |  |  |  |         try { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             createTmpDirectoryIfWindows(); | 
			
		
	
		
		
			
				
					
					|  |  |  | //            String result = RsaUtils.publicKeyDecrypt(myKey, publicKey);
 |  |  |  | //            String result = RsaUtils.publicKeyDecrypt(myKey, publicKey);
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //            String hardInfo = MyHardWareUtils.getHardDiskSN();
 |  |  |  | //            String hardInfo = MyHardWareUtils.getHardDiskSN();
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //            if (!result.equals(hardInfo)) {
 |  |  |  | //            if (!result.equals(hardInfo)) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //                System.exit(1);
 |  |  |  | //                 System.exit(1);
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | //            }
 |  |  |  | //            }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         } catch (Exception e) { |  |  |  |         } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             e.printStackTrace(); |  |  |  |             e.printStackTrace(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             System.exit(1); |  |  |  |             System.exit(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private void createTmpDirectoryIfWindows() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String os = System.getProperty("os.name").toLowerCase(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (os.contains("win")) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             Path path = Paths.get("D:/tmp"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (!Files.exists(path)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 try { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     Files.createDirectories(path); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     System.out.println("目录创建成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } catch (IOException e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     e.printStackTrace(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |