Use window.location.hostname if SERVER_HOSTNAME is not defined in production mode
This commit is contained in:
		
							parent
							
								
									65ee7c5012
								
							
						
					
					
						commit
						1aeed45986
					
				
							
								
								
									
										7
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								index.js
									
									
									
									
									
								
							@ -83,7 +83,10 @@ module.exports = {
 | 
				
			|||||||
    let hostname
 | 
					    let hostname
 | 
				
			||||||
    let protocol
 | 
					    let protocol
 | 
				
			||||||
    if (process.env.NODE_ENV === 'production') {
 | 
					    if (process.env.NODE_ENV === 'production') {
 | 
				
			||||||
      hostname = this.SERVER_HOSTNAME,
 | 
					      hostname = this.SERVER_HOSTNAME
 | 
				
			||||||
 | 
					        // #ifdef H5
 | 
				
			||||||
 | 
					        || window.location.hostname
 | 
				
			||||||
 | 
					        // #endif
 | 
				
			||||||
      protocol = 'https:'
 | 
					      protocol = 'https:'
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      hostname =
 | 
					      hostname =
 | 
				
			||||||
@ -311,7 +314,7 @@ module.exports = {
 | 
				
			|||||||
      return Object.assign(resultCloud, { fileUrl: resultCloud.fileID })
 | 
					      return Object.assign(resultCloud, { fileUrl: resultCloud.fileID })
 | 
				
			||||||
    }else if (backend==='SERVER' && url){
 | 
					    }else if (backend==='SERVER' && url){
 | 
				
			||||||
      const resultServer = await this.pickupFile2Server({mediaType, count, sizeType, sourceType, maxDuration, url, header, formData, name})
 | 
					      const resultServer = await this.pickupFile2Server({mediaType, count, sizeType, sourceType, maxDuration, url, header, formData, name})
 | 
				
			||||||
      return Object.assign(resultServer, {fileUrl: resultServer.file ? this.makeServerUrl(resultServer.file.webpath || resultServer.file.filename) : undefined})
 | 
					      return Object.assign(resultServer, {fileUrl: resultServer.file ? this.makeServerUrl(resultServer.file.webpath || resultServer.file.path) : undefined})
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user