這里寫(xiě)問(wèn)題描述
當(dāng)請(qǐng)求url是
{{base_url}}/devices/666888990/sendMqtt/greenhouse/control/shade-net/open
時(shí),不能正確的解析topics=greenhouse/control/shade-net/open,而是返回404
Route::any('/devices/{device_id}/sendMqtt/{topics}', [app\controller\devices\IndexController::class, 'sendMqtt']);
你為什么不愿意修改一下路由的傳參方式,或者你的參數(shù)應(yīng)該避免出現(xiàn)/
,就像你用Windows系統(tǒng)需要避免文件名是 \
一樣
Route::any('/devices/{device_id}/sendMqtt/[{topics:.+}]', [app\controller\devices\IndexController::class, 'sendMqtt']);
這個(gè)webman路由文檔有例子,這樣寫(xiě)