Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何使 path 与api.get('/view/:search/:userid', search)一起工作/view//12,并给出params.search一个空值?
api.get('/view/:search/:userid', search)
/view//12
params.search
请您尝试以下方法:
api.get('/view/:search?/:userid', search)
或者如果您定义了一条新路线
api.get('/view//:userid', search)