润乾报表配置HTTPS后问题修复记录

chosen1cwp 2023年02月21日 153次浏览

背景

项目中集成了润乾报表,迁移至微软云(Microsoft Azure)后遇到两个问题,这里做个记录。

项目使用的润乾报表版本是V4

问题一:连接数据库源失败

报错信息:

mysql caused:communications link failure the last packet successfully received from the server was 1 milliseconds ago. the last packet sent successfully to the server was 1 milliseconds ago.

解决方法:

修改配置文件eportconfig.xml,在参数connection-url 的后边追加?useSSL=false,重新打包部署服务

<jdbc-ds-configs>
    <jdbc-ds-config>
        <name>mysql</name>
        <db-type>mysql</db-type>
        <connection-url>
            jdbc:mysql://10.9.23.6:3306/dbname?useSSL=false
        </connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <user-name>xger</user-name>
        <password>nU$E6bOaDgr</password>
        <db-charset>UTF-8</db-charset>
        <client-charset>UTF-8</client-charset>
        <extend-properties></extend-properties>
    </jdbc-ds-config>
</jdbc-ds-configs>

jdbc-ds-configs

问题二:导出下载文件功能失效,js报错

报错信息

Mixed Content: The page at 'https://agent.zjbxjj.com/reportJsp/showReport.jsp?raq=reportFile/agentInformation&type=a&managecom4Id=1069135717965500416&agentState=01&isFrozen=0#' was loaded over HTTPS, but requested an insecure script 'http://agent.zjbxjj.com/reportServlet?action=10&file=%2Fcom%2Frunqian%2Freport4%2Fview%2Fhtml%2Frqdialog.js'. This request has been blocked; the content must be served over HTTPS.

翻译:页面通过 HTTPS 加载,但请求一个不安全的脚本,此请求已被阻塞; 内容必须通过 HTTPS 提供

解决方法

参考链接:乾学院https报表打印到处问题

修改配置文件eportconfig.xml,设置appUrlPrefix 的值改为 /APPMAP,重新打包部署服务

<config>
    <name>appUrlPrefix</name>
    <value>/APPMAP</value>
</config>

config