刘韬 6 anni fa
parent
commit
667a01c229

+ 1 - 1
PacsOnline_Wechat_Patient/src/main/java/com/zskk/common/ZskkConfig.java

@@ -78,7 +78,7 @@ public class ZskkConfig extends JFinalConfig {
 		me.add(arp);
 
 //         使用redis分布accessToken
-         RedisPlugin redisPlugin = new RedisPlugin("weixin_patient", "127.0.0.1", 6379, 1000);
+         RedisPlugin redisPlugin = new RedisPlugin("weixin_patient", "127.0.0.1", 6379);
          redisPlugin.setSerializer(JdkSerializer.me); // 需要使用fst高性能序列化的用户请删除这一行(Fst jar依赖请查看WIKI)
          me.add(redisPlugin);
     }

+ 12 - 3
PacsOnline_Wechat_Patient/src/main/java/com/zskk/controller/WeixinApiController.java

@@ -1,5 +1,6 @@
 package com.zskk.controller;
 
+import com.jfinal.weixin.sdk.api.AccessTokenApi;
 import com.jfinal.weixin.sdk.api.ApiConfigKit;
 import com.jfinal.weixin.sdk.api.ApiResult;
 import com.jfinal.weixin.sdk.api.CallbackIpApi;
@@ -21,9 +22,17 @@ public class WeixinApiController extends ApiController {
      * 设计初衷:https://www.oschina.net/question/2702126_2237352
      */
     public void getToken() {
-        String key = getPara("key");
-        String json = ApiConfigKit.getAccessTokenCache().get(key);
-        renderText(json);
+    	try {
+//          String key = getPara("key");
+//          String json = ApiConfigKit.getAccessTokenCache().get(key);
+          String json = AccessTokenApi.getAccessTokenStr();
+          renderText(json);
+		} catch (Exception e) {
+			// TODO: handle exception
+	          renderText(e.toString());
+
+		}
+
     }
     
     /**