|
@@ -0,0 +1,27 @@
|
|
|
|
+package com.iamberry.wechat.handles.accessToken;
|
|
|
|
+
|
|
|
|
+import com.iamberry.wechat.core.entity.ResultMsg;
|
|
|
|
+import com.iamberry.wechat.tools.NameUtils;
|
|
|
|
+import com.iamberry.wechat.tools.ResultInfo;
|
|
|
|
+import com.iamberry.wechat.tools.WeixinUtil;
|
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
+
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
+@Controller
|
|
|
|
+@RequestMapping("/AccessToken")
|
|
|
|
+public class AccessTokenHandler {
|
|
|
|
+ /**
|
|
|
|
+ * 获取token
|
|
|
|
+ * @param request
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequestMapping("/get_AccessToken")
|
|
|
|
+ public String selectGamePrizeByGameId(HttpServletRequest request) throws Exception {
|
|
|
|
+ String token = WeixinUtil.getAccessToken(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret")).getToken();
|
|
|
|
+ return token;
|
|
|
|
+ }
|
|
|
|
+}
|