国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

路由參數(shù)里包含斜杠時(shí),如何使路由生效

redqd

問(wèn)題描述

這里寫(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']);
299 3 0
3個(gè)回答

你為什么不愿意修改一下路由的傳參方式,或者你的參數(shù)應(yīng)該避免出現(xiàn)/,就像你用Windows系統(tǒng)需要避免文件名是 \一樣

  • 暫無(wú)評(píng)論
walkor 打賞
Route::any('/devices/{device_id}/sendMqtt/[{topics:.+}]', [app\controller\devices\IndexController::class, 'sendMqtt']);

這個(gè)webman路由文檔有例子,這樣寫(xiě)

  • redqd 2025-05-27

    謝謝,謝謝,確實(shí)可行

dj880

謝謝分享~

  • 暫無(wú)評(píng)論
??