fix: tap handler

This commit is contained in:
lilong.129
2025-03-04 20:40:10 +08:00
parent 65564b958f
commit 7539e456d7
7 changed files with 78 additions and 18 deletions

View File

@@ -12,14 +12,9 @@ import (
)
func (r *RouterExt) GetDriver(c *gin.Context) (driverExt *driver_ext.StubXTDriver, err error) {
driverObj, exists := c.Get("driver")
if exists {
return driverObj.(*driver_ext.StubXTDriver), nil
}
deviceObj, exists := c.Get("device")
var device uixt.IDevice
var driver driver_ext.IStubDriver
deviceObj, exists := c.Get("device")
if !exists {
device, err = r.GetDevice(c)
if err != nil {