我正在尝试对使用 vite 和 vue3 创建的前端应用程序进行 dockerize。它不作为容器工作。这是错误响应。
\n(!) 无法从 rollupOptions 或 html 文件自动确定入口点,并且没有显式的 OptimizeDeps.include 模式。跳过依赖项预捆绑。
\nVITE v3.2.4 ready in 191 ms\n\n \xc3\xa2\xc5\xbe\xc5\x93 Local: http://localhost:5173/\n \xc3\xa2\xc5\xbe\xc5\x93 Network: http://172.17.0.2:5173/\n(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.\nRun Code Online (Sandbox Code Playgroud)\nDockerfile
\n# base image\nFROM node:16.3.0-alpine\n\n# set working directory\nWORKDIR /app\n\n# add `/app/node_modules/.bin` to $PATH\nENV PATH /app/node_modules/.bin:$PATH\n\n# install and cache app dependencies\nCOPY package.json /app/package.json\nRUN npm install\nRUN npm install @vue/cli@3.7.0 -g\n# start app\nCMD …Run Code Online (Sandbox Code Playgroud) 我在SpringBoot应用程序的resources文件夹中有这个文件夹.
resources/files/a.txt
resources/files/b/b1.txt
resources/files/b/b2.txt
resources/files/c/c1.txt
resources/files/c/c2.txt
Run Code Online (Sandbox Code Playgroud)
我想得到所有的txt文件,所以这是我的代码:
ClassLoader classLoader = this.getClass().getClassLoader();
Path configFilePath = Paths.get(classLoader.getResource("files").toURI());
List<Path> atrackFileNames = Files.list(configFilePath)
.filter(s -> s.toString().endsWith(".txt"))
.map(Path::getFileName)
.sorted()
.collect(toList());
Run Code Online (Sandbox Code Playgroud)
但我只得到文件a.txt
我想将从 API 获取的 JSON 数据转换为 PDF。
JSON数据示例
{
"data": [
{
"state": "Manchester",
"quantity": 20
},
{
"state": "Surrey",
"quantity": 46
},
{
"state": "Scotland",
"quantity": 36
},
{
"state": "Kent",
"quantity": 23
},
{
"state": "Devon",
"quantity": 43
},
{
"state": "Glamorgan",
"quantity": 43
}
]
}
Run Code Online (Sandbox Code Playgroud)
我找到了这个脚本: http://code.activestate.com/recipes/578979-convert-json-to-pdf-with-python-and-xtopdf/
但出现错误
无模块 PDFWriter
有没有其他方法可以将 JSON 数据转换为 PDF。
请帮忙。
dct_data = json_tour_data.__dict__
tour_data = json.dumps(dct_data)
Run Code Online (Sandbox Code Playgroud)
如何从json中删除这些反斜杠?这是我的输出:
"{\"strFileOpenDateAjxKey\": \"2018-01-16 12:40:22.526417\",
\"strFilePassengerAjxKey\": \"Zahra Walji\", \"strFileOpenMobileAjxKey\":
\"46464664\", \"strFileOpenDepartmentAjxKey\": \"Finance department\",
\"strFileOpenAccountCodeAjxKey\": \"CARTZS\",
\"strFileOpenProfileCodeAjxKey\": \"CARTZS\",
\"strFileopenOriginalCountryIdAjxKey\": 61, \"blnBoundAjxKey\": 1,
\"strTransactionCurrencyJsKey\": \"Shillings\",
\"intCurrencyPrecisionJsKey\": 3, \"strPackageTypeJsKey\": \"PKG\",
\"strUserNameAjxKey\": \"admin\", \"strPasswordAjxKey\": \"1234\"}"
Run Code Online (Sandbox Code Playgroud)