fix: add wx-login check
This commit is contained in:
		
							
								
								
									
										50
									
								
								mini-web/envision/wx-get-openid.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								mini-web/envision/wx-get-openid.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | ||||
| <!DOCTYPE html> | ||||
| <html lang="en"> | ||||
|  | ||||
| <head> | ||||
|   <meta charset="utf-8"> | ||||
|   <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||
|   <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1, user-scalable=no"> | ||||
|   <title>登录</title> | ||||
|   <style> | ||||
|     * { | ||||
|       box-sizing: border-box; | ||||
|     } | ||||
|   </style> | ||||
|   <style> | ||||
|     .loading { | ||||
|       position: fixed; | ||||
|       top: 0; | ||||
|       left: 0; | ||||
|       width: 100%; | ||||
|       height: 100%; | ||||
|       background: rgba(255, 255, 255, 0.8); | ||||
|       z-index: 9999; | ||||
|       display: flex; | ||||
|       justify-content: center; | ||||
|       align-items: center; | ||||
|       font-size: 1.5em; | ||||
|       /* Adjust font size for mobile */ | ||||
|     } | ||||
|  | ||||
|     @media (max-width: 600px) { | ||||
|       .loading { | ||||
|         font-size: 1em; | ||||
|         /* Smaller font size for smaller screens */ | ||||
|       } | ||||
|     } | ||||
|   </style> | ||||
| </head> | ||||
|  | ||||
| <body> | ||||
|   <div class="loading"></div> | ||||
|   <div class="openid"></div> | ||||
|   <script type="module"> | ||||
|     import { initGetOpenidEvent, isWechat } from './utils.js'; | ||||
|     const loading = document.querySelector('.loading'); | ||||
|     loading.textContent = !isWechat() ? '微信打开当前页面获取openid' : ''; | ||||
|     initGetOpenidEvent(); | ||||
|   </script> | ||||
| </body> | ||||
|  | ||||
| </html> | ||||
		Reference in New Issue
	
	Block a user