Fix bug
This commit is contained in:
		
							parent
							
								
									77979ec37b
								
							
						
					
					
						commit
						f7cae37ce4
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -1,7 +1,10 @@
 | 
				
			||||||
import config from '../conf';
 | 
					import config from '../conf';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const uri = config.mongodb.user && config.mongodb.pass
 | 
					const u = config.mongodb.user ? encodeURIComponent(config.mongodb.user) : null;
 | 
				
			||||||
	? `mongodb://${config.mongodb.user}:${config.mongodb.pass}@${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`
 | 
					const p = config.mongodb.pass ? encodeURIComponent(config.mongodb.pass) : null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const uri = u && p
 | 
				
			||||||
 | 
						? `mongodb://${u}:${p}@${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`
 | 
				
			||||||
	: `mongodb://${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
 | 
						: `mongodb://${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue