Search in sources :

Example 46 with Action

use of app.hongs.action.anno.Action 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);
}
Also used : CoreConfig(app.hongs.CoreConfig) Map(java.util.Map) HashMap(java.util.HashMap) Action(app.hongs.action.anno.Action)

Example 47 with Action

use of app.hongs.action.anno.Action 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);
}
Also used : CoreConfig(app.hongs.CoreConfig) Map(java.util.Map) HashMap(java.util.HashMap) Action(app.hongs.action.anno.Action)

Example 48 with Action

use of app.hongs.action.anno.Action 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);
}
Also used : CoreConfig(app.hongs.CoreConfig) Map(java.util.Map) HashMap(java.util.HashMap) Action(app.hongs.action.anno.Action)

Example 49 with Action

use of app.hongs.action.anno.Action 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);
}
Also used : CoreConfig(app.hongs.CoreConfig) Map(java.util.Map) HashMap(java.util.HashMap) Action(app.hongs.action.anno.Action)

Example 50 with Action

use of app.hongs.action.anno.Action 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);
}
Also used : CoreConfig(app.hongs.CoreConfig) Map(java.util.Map) HashMap(java.util.HashMap) Action(app.hongs.action.anno.Action)

Aggregations

Action (app.hongs.action.anno.Action)63 Map (java.util.Map)52 HashMap (java.util.HashMap)38 NaviMap (app.hongs.action.NaviMap)16 CommitSuccess (app.hongs.action.anno.CommitSuccess)14 CoreLocale (app.hongs.CoreLocale)12 Preset (app.hongs.action.anno.Preset)12 IAction (app.hongs.dh.IAction)10 RoleMap (app.hongs.serv.auth.RoleMap)10 Verify (app.hongs.action.anno.Verify)9 FetchCase (app.hongs.db.util.FetchCase)8 CoreConfig (app.hongs.CoreConfig)7 Select (app.hongs.action.anno.Select)7 Set (java.util.Set)6 File (java.io.File)5 List (java.util.List)5 HongsException (app.hongs.HongsException)4 ActionRunner (app.hongs.action.ActionRunner)4 LuceneAction (app.hongs.dh.lucene.LuceneAction)3 SearchAction (app.hongs.dh.search.SearchAction)3