刘韬 2 vuotta sitten
vanhempi
commit
3983bf7a41

+ 3 - 3
PacsOnline_Wechat_Doctor/pom.xml

@@ -62,9 +62,9 @@
 			<version>2.10.2</version>
 		</dependency>
 		<dependency>
-			<groupId>jakarta.servlet</groupId>
-			<artifactId>jakarta.servlet-api</artifactId>
-			<version>5.0.0</version>
+			<groupId>javax.servlet</groupId>
+			<artifactId>javax.servlet-api</artifactId>
+			<version>4.0.1</version>
 			<scope>provided</scope>
 		</dependency>
 		<dependency>

+ 44 - 44
PacsOnline_Wechat_Doctor/src/main/java/com/zskk/common/ZskkConfig.java

@@ -110,50 +110,50 @@ public class ZskkConfig extends JFinalConfig {
 	public void onStart() {
 		// TODO Auto-generated method stub
 		super.onStart();
-//		// 支持redis存储access_token、js_ticket,需要先启动RedisPlugin
-//		ApiConfigKit.setAccessTokenCache(new RedisAccessTokenCache("weixin_doctor"));
-//		// 中世康恺电子胶片平台
-//		ApiConfig ac_zskk = new ApiConfig();
-//		// 配置微信 API 相关参数
-//		ac_zskk.setToken(PropKit.get("token_zskk"));
-//		ac_zskk.setAppId(PropKit.get("appId_zskk"));
-//		ac_zskk.setAppSecret(PropKit.get("appSecret_zskk"));
-//
-//		/**
-//		 * 是否对消息进行加密,对应于微信平台的消息加解密方式: 1:true进行加密且必须配置 encodingAesKey
-//		 * 2:false采用明文模式,同时也支持混合模式
-//		 */
-//		ac_zskk.setEncryptMessage(Boolean.FALSE);
-//
-//		/**
-//		 * 多个公众号时,重复调用ApiConfigKit.putApiConfig(ac)依次添加即可,第一个添加的是默认。
-//		 */
-//		
-//		ApiConfigKit.putApiConfig(ac_zskk);
-//
-//		WxaConfig wc = new WxaConfig();
-//        wc.setAppId(PropKit.get("appId_xtzd"));
-//        wc.setAppSecret(PropKit.get("appSecret_xtzd"));
-//        WxaConfigKit.setWxaConfig(wc);
-//
-//		/**
-//		 * 1.9 新增LocalTestTokenCache用于本地和线上同时使用一套appId时避免本地将线上AccessToken冲掉
-//		 * 
-//		 * 设计初衷:https://www.oschina.net/question/2702126_2237352
-//		 * 
-//		 * 注意: 1. 上线时应保证此处isLocalDev为false,或者注释掉该不分代码!
-//		 * 
-//		 * 2. 为了安全起见,此处可以自己添加密钥之类的参数,例如:
-//		 * http://localhost/weixin/api/getToken?secret=xxxx
-//		 * 然后在WeixinApiController#getToken()方法中判断secret
-//		 * 
-//		 * @see WeixinApiController#getToken()
-//		 */
-////      if (isLocalDev) {
-////          String onLineTokenUrl = "http://localhost/weixin/api/getToken";
-////          ApiConfigKit.setAccessTokenCache(new LocalTestTokenCache(onLineTokenUrl));
-////      }
-//		ServiceFactory.init();
+		// 支持redis存储access_token、js_ticket,需要先启动RedisPlugin
+		ApiConfigKit.setAccessTokenCache(new RedisAccessTokenCache("weixin_doctor"));
+		// 中世康恺电子胶片平台
+		ApiConfig ac_zskk = new ApiConfig();
+		// 配置微信 API 相关参数
+		ac_zskk.setToken(PropKit.get("token_zskk"));
+		ac_zskk.setAppId(PropKit.get("appId_zskk"));
+		ac_zskk.setAppSecret(PropKit.get("appSecret_zskk"));
+
+		/**
+		 * 是否对消息进行加密,对应于微信平台的消息加解密方式: 1:true进行加密且必须配置 encodingAesKey
+		 * 2:false采用明文模式,同时也支持混合模式
+		 */
+		ac_zskk.setEncryptMessage(Boolean.FALSE);
+
+		/**
+		 * 多个公众号时,重复调用ApiConfigKit.putApiConfig(ac)依次添加即可,第一个添加的是默认。
+		 */
+		
+		ApiConfigKit.putApiConfig(ac_zskk);
+
+		WxaConfig wc = new WxaConfig();
+        wc.setAppId(PropKit.get("appId_xtzd"));
+        wc.setAppSecret(PropKit.get("appSecret_xtzd"));
+        WxaConfigKit.setWxaConfig(wc);
+
+		/**
+		 * 1.9 新增LocalTestTokenCache用于本地和线上同时使用一套appId时避免本地将线上AccessToken冲掉
+		 * 
+		 * 设计初衷:https://www.oschina.net/question/2702126_2237352
+		 * 
+		 * 注意: 1. 上线时应保证此处isLocalDev为false,或者注释掉该不分代码!
+		 * 
+		 * 2. 为了安全起见,此处可以自己添加密钥之类的参数,例如:
+		 * http://localhost/weixin/api/getToken?secret=xxxx
+		 * 然后在WeixinApiController#getToken()方法中判断secret
+		 * 
+		 * @see WeixinApiController#getToken()
+		 */
+//      if (isLocalDev) {
+//          String onLineTokenUrl = "http://localhost/weixin/api/getToken";
+//          ApiConfigKit.setAccessTokenCache(new LocalTestTokenCache(onLineTokenUrl));
+//      }
+		ServiceFactory.init();
 
 	}
 

+ 1 - 1
PacsOnline_Wechat_Doctor/src/main/webapp/WEB-INF/web.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_5_0.xsd" id="WebApp_ID" version="5.0">
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0">
   <display-name>PacsOnline_Wechat_Patient</display-name>
   <filter>
     <filter-name>jfinal</filter-name>

+ 1 - 1
PacsOnline_Wechat_Doctor/src/main/webapp/index.jsp

@@ -2,4 +2,4 @@
 <body>
 <h2>Hello World!</h2>
 </body>
-</html>
+</html>