An Tao

Results 204 comments of An Tao

比如你存个字符串到ViewData里,名字叫key,view里就可以: ``` auto str = @@.get("name"); ``` 具体请参考: https://github.com/drogonframework/drogon/wiki/CHN-06-%E8%A7%86%E5%9B%BE

你要从orm::Result里把需要的字段提出来放到ViewData里去显示

@Necoo33 How did you install the sqlite3 library? I think you should use the `apt install` command in the ubuntu wsl rather than vcpkg in host windows OS.

There may be global settings to enable vcpkg, sorry I'm not familiar with wsl. Did you run the `sudo apt install libsqlite3-dev` command?

你可以做个计时对象放到request对象的attributes里。drogon目前没有单独的抽象。 如果你想做统计,有个prometheus的插件可供使用。 另外你说的处理时长,AccessLog插件也可以直接打印出来。

It seems something wrong with the jsoncpp dev library. You could try to remove it and then compile and install the jsoncpp from source code.

这是unicode的转义编码,json里很常见,网上搜个解码器放到你工程里试试。

Would you please make a demo repo for this issue? If you update drogon via vcpkg, you should recompile your project even if you use drogon as shared library.

Could you please share your client code so I can reproduce this issue locally?

I did some tests with your controller code and postman, but I can't reproduce this issue, it works fine in my local environment.