use of app.hongs.CoreConfig in project HongsCORE by ihongs.
the class QQAction method inWap.
/**
* QQ WAP 登录回调
* @param helper
* @throws HongsException
*/
@Action("wap/create")
public void inWap(ActionHelper helper) throws HongsException {
CoreConfig cc = CoreConfig.getInstance("oauth2");
String appId = cc.getProperty("oauth2.qq.wap.app.id");
String appSk = cc.getProperty("oauth2.qq.wap.app.key");
String rurl = cc.getProperty("oauth2.qq.wap.bak.url");
String code = helper.getParameter("code");
if (appId == null || appSk == null) {
helper.error500("Not support this mode");
}
Map info = getUserInfo(code, appId, appSk, rurl, true);
String opnId = (String) info.get("opnid");
String name = (String) info.get("name");
String head = (String) info.get("head");
AuthKit.openSign(helper, "wx", appId, opnId, name, head, System.currentTimeMillis());
ConnKit.redirect(helper);
}
use of app.hongs.CoreConfig in project HongsCORE by ihongs.
the class QQAction method inWeb.
/**
* QQ Web 登录回调
* @param helper
* @throws HongsException
*/
@Action("web/create")
public void inWeb(ActionHelper helper) throws HongsException {
CoreConfig cc = CoreConfig.getInstance("oauth2");
String appId = cc.getProperty("oauth2.qq.web.app.id");
String appSk = cc.getProperty("oauth2.qq.web.app.key");
String rurl = cc.getProperty("oauth2.qq.wap.bak.url");
String code = helper.getParameter("code");
if (appId == null || appSk == null) {
helper.error500("Not support this mode");
}
Map info = getUserInfo(code, appId, appSk, rurl, false);
String opnId = (String) info.get("opnid");
String name = (String) info.get("name");
String head = (String) info.get("head");
AuthKit.openSign(helper, "wx", appId, opnId, name, head, System.currentTimeMillis());
ConnKit.redirect(helper);
}
use of app.hongs.CoreConfig in project HongsCORE by ihongs.
the class WBAction method inWap.
@Action("wap/create")
public void inWap(ActionHelper helper) throws HongsException {
CoreConfig cc = CoreConfig.getInstance("oauth2");
String appId = cc.getProperty("oauth2.wb.wap.app.id");
String appSk = cc.getProperty("oauth2.wb.wap.app.key");
String rurl = cc.getProperty("oauth2.wb.wap.bak.url");
String code = helper.getParameter("code");
if (appId == null || appSk == null) {
helper.error500("Not support this mode");
}
Map info = getUserInfo(code, appId, appSk, rurl);
String opnId = (String) info.get("opnid");
String name = (String) info.get("name");
String head = (String) info.get("head");
AuthKit.openSign(helper, "wb", appId, opnId, name, head, System.currentTimeMillis());
ConnKit.redirect(helper);
}
use of app.hongs.CoreConfig in project HongsCORE by ihongs.
the class WXAction method inWeb.
/**
* 微信 Web 登录回调
* @param helper
* @throws HongsException
*/
@Action("web/create")
public void inWeb(ActionHelper helper) throws HongsException {
CoreConfig cc = CoreConfig.getInstance("oauth2");
String appId = cc.getProperty("oauth2.wx.web.app.id");
String appSk = cc.getProperty("oauth2.wx.web.app.key");
String code = helper.getParameter("code");
if (appId == null || appSk == null) {
helper.error500("Not support this mode");
}
Map info = getUserInfo(code, appId, appSk);
String opnId = (String) info.get("opnid");
String name = (String) info.get("name");
String head = (String) info.get("head");
AuthKit.openSign(helper, "wx", appId, opnId, name, head, System.currentTimeMillis());
ConnKit.redirect(helper);
}
use of app.hongs.CoreConfig in project HongsCORE by ihongs.
the class WXAction method inWap.
/**
* 微信 WAP 登录回调
* @param helper
* @throws HongsException
*/
@Action("wap/create")
public void inWap(ActionHelper helper) throws HongsException {
CoreConfig cc = CoreConfig.getInstance("oauth2");
String appId = cc.getProperty("oauth2.wx.wap.app.id");
String appSk = cc.getProperty("oauth2.wx.wap.app.key");
String code = helper.getParameter("code");
if (appId == null || appSk == null) {
helper.error500("Not support this mode");
}
Map info = getUserInfo(code, appId, appSk);
String opnId = (String) info.get("opnid");
String name = (String) info.get("name");
String head = (String) info.get("head");
AuthKit.openSign(helper, "wx", appId, opnId, name, head, System.currentTimeMillis());
ConnKit.redirect(helper);
}
Aggregations