<dependency> <groupId>com.jfinal</groupId> <artifactId>jfinal-java8</artifactId> <version>3.2</version> </dependency> <dependency> <groupId>com.jfinal</groupId> <artifactId>jfinal-weixin</artifactId> <version>1.9</version> <exclusions> <exclusion> <groupId>com.jfinal</groupId> <artifactId>jfinal</artifactId> </exclusion> </exclusions> </dependency>
public static void main(String[] args) { ApiConfig ac = new ApiConfig(); String appId = PropKit.get("wxpay.appid"); System.out.println("appId:"+appId); String appSecret = PropKit.get("wxpay.appSecret"); System.out.println("appSecret:"+appSecret); ac.setAppId(appId); ac.setAppSecret(appSecret); ApiConfigKit.putApiConfig(ac); ApiConfigKit.setThreadLocalAppId(appId); ViewButton toShop = new ViewButton(); toShop.setName("test"); toShop.setType("view"); toShop.setUrl("https://www.test.com"); Menu menu = new Menu(); menu.setButton(new Button[]{toShop}); String jsonStr = JsonKit.toJson(menu).toString(); System.out.println(jsonStr); ApiResult apiResult = MenuApi.createMenu(jsonStr); System.out.println(apiResult.getJson()); }
java.lang.NullPointerException at com.jfinal.weixin.sdk.api.AccessTokenApi.getAccessTokenStr(AccessTokenApi.java:66) at com.jfinal.weixin.sdk.api.MenuApi.createMenu(MenuApi.java:38)
@JFinal 我在jfinal工程中导入了jfinal-weixin,这样使用无法取得accesstoken,请问是什么情况
项目:JFinal