|
@@ -28,7 +28,7 @@ import java.util.List;
|
|
**/
|
|
**/
|
|
|
|
|
|
@Controller
|
|
@Controller
|
|
-@RequestMapping("/api")
|
|
|
|
|
|
+@RequestMapping("/wxAuth")
|
|
public class WXLoginController {
|
|
public class WXLoginController {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
@@ -71,7 +71,7 @@ public class WXLoginController {
|
|
public String wxLogin(HttpServletResponse response) throws ParseException,IOException {
|
|
public String wxLogin(HttpServletResponse response) throws ParseException,IOException {
|
|
//请求获取code的回调地址
|
|
//请求获取code的回调地址
|
|
//用线上环境的域名或者用内网穿透,不能用ip
|
|
//用线上环境的域名或者用内网穿透,不能用ip
|
|
- String callBack = "http://www.huiyj.com/api/callBack";//域名填你自己的
|
|
|
|
|
|
+ String callBack = "http://www.onlyfido.top/wxAuth/callBack";//域名填你自己的
|
|
//请求地址
|
|
//请求地址
|
|
String url = null;
|
|
String url = null;
|
|
try {
|
|
try {
|
|
@@ -145,8 +145,8 @@ public class WXLoginController {
|
|
//此时已获取到userInfo,再根据业务进行处理
|
|
//此时已获取到userInfo,再根据业务进行处理
|
|
System.out.println("请求获取userInfo:" + resultInfo);
|
|
System.out.println("请求获取userInfo:" + resultInfo);
|
|
//跳转网页地址
|
|
//跳转网页地址
|
|
- System.out.println("跳转网页地址:" + "redirect:"+"http://www.huiyj.com/?openid="+resultObject.getString("openid"));
|
|
|
|
- return "redirect:"+"http://www.huiyj.com/?openid="+resultObject.getString("openid");
|
|
|
|
|
|
+ System.out.println("跳转网页地址:" + "redirect:"+"http://www.onlyfido.top:45060/?openid="+resultObject.getString("openid"));
|
|
|
|
+ return "redirect:"+"http://www.onlyfido.top:45060/?openid="+resultObject.getString("openid");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|