小编kre*_*zus的帖子

无法从 rollupOptions 自动确定入口点

我正在尝试对使用 vite 和 vue3 创建的前端应用程序进行 dockerize。它不作为容器工作。这是错误响应。

\n

(!) 无法从 rollupOptions 或 html 文件自动确定入口点,并且没有显式的 OptimizeDeps.include 模式。跳过依赖项预捆绑。

\n
VITE 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.\n
Run Code Online (Sandbox Code Playgroud)\n

Dockerfile

\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)

docker dockerfile vuejs3 vite

17
推荐指数
1
解决办法
3万
查看次数

Java 8:从文件夹/子文件夹中获取文件

我在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

java collections functional-programming stream java-8

8
推荐指数
2
解决办法
2万
查看次数

如何使用 python 脚本将 JSON 数据转换为 PDF

我想将从 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。

请帮忙。

python pdf json

7
推荐指数
1
解决办法
3万
查看次数

从 Django Rest Framework 中的 Json 字符串中删除反斜杠

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)

python json django-rest-framework

3
推荐指数
1
解决办法
8213
查看次数