forked from free-lancers/electricity_bill_calc_service
		
	feat(session):增加清除用户会话的工具函数。
This commit is contained in:
		
							
								
								
									
										5
									
								
								cache/session.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								cache/session.go
									
									
									
									
										vendored
									
									
								
							| @@ -20,3 +20,8 @@ func HasSession(token string) (bool, error) { | ||||
| 	key := fmt.Sprintf("session:%s", token) | ||||
| 	return Exists(key) | ||||
| } | ||||
|  | ||||
| func ClearSession(token string) (bool, error) { | ||||
| 	key := fmt.Sprintf("session:%s", token) | ||||
| 	return Delete(key) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user