fix
This commit is contained in:
		
							parent
							
								
									394f0c6e46
								
							
						
					
					
						commit
						afe8b26eee
					
				| @ -129,12 +129,14 @@ func (l *DataTransferLogic) DataTransfer(w http.ResponseWriter, r *http.Request) | ||||
| 			return | ||||
| 		} | ||||
| 		//有效token | ||||
| 		if s[0] != "empty_token" { | ||||
| 			r.Header.Set("Authorization", "Bearer "+s[0]) | ||||
| 		token := strings.Trim(s[0], " ") | ||||
| 		if token != "empty_token" { | ||||
| 			r.Header.Set("Authorization", "Bearer "+token) | ||||
| 		} | ||||
| 		//有效wid | ||||
| 		if s[1] != "empty_wid" { | ||||
| 			oldWid = s[1] | ||||
| 		wid := strings.Trim(s[1], " ") | ||||
| 		if wid != "empty_wid" { | ||||
| 			oldWid = wid | ||||
| 		} | ||||
| 		//设置Sec-Websocket-Protocol | ||||
| 		upgrader.Subprotocols = []string{secWebsocketProtocol} | ||||
| @ -197,7 +199,7 @@ func (l *DataTransferLogic) setConnPool(conn *websocket.Conn, userInfo *auth.Use | ||||
| 		//解析传入的wid是不是属于自己的用户的 | ||||
| 		decryptionWid, err := encryption_decryption.CBCDecrypt(oldWid) | ||||
| 		if err != nil { | ||||
| 			logx.Error(err, ":", oldWid) | ||||
| 			logx.Error(err) | ||||
| 			return wsConnectItem{}, errors.New("解码wid失败") | ||||
| 		} | ||||
| 		lendecryptionWid := len(decryptionWid) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user