手机端API接口测试优化,支持验证码登录。
This commit is contained in:
@@ -86,6 +86,10 @@ public class LoginController extends BaseController{
|
||||
// 是否显示验证码
|
||||
model.addAttribute("isValidCodeLogin", ObjectUtils.toInteger(Global.getConfig("sys.login.failedNumAfterValidCode", "200")) == 0);
|
||||
|
||||
//获取当前会话对象
|
||||
Session session = UserUtils.getSession();
|
||||
model.addAttribute("sessionid", (String)session.getId());
|
||||
|
||||
// 获取登录参数
|
||||
Map<String, Object> paramMap = ServletUtils.getExtParams(request);
|
||||
|
||||
@@ -172,6 +176,10 @@ public class LoginController extends BaseController{
|
||||
// }
|
||||
model.addAttribute("isValidCodeLogin", BaseAuthorizingRealm.isValidCodeLogin(username, /*corpCode, */(String)paramMap.get("deviceType"), "failed"));
|
||||
}
|
||||
|
||||
//获取当前会话对象
|
||||
Session session = UserUtils.getSession();
|
||||
model.addAttribute("sessionid", (String)session.getId());
|
||||
|
||||
// 登录操作如果是Ajax操作,直接返回登录信息字符串。
|
||||
if (ServletUtils.isAjaxRequest(request)){
|
||||
|
||||
@@ -262,7 +262,7 @@ shiro:
|
||||
isAllowExternalSiteIframe: true
|
||||
|
||||
# 是否允许跨域访问,如果允许,设置允许的域名,全部域名设置*号,如果不允许,此设置应该为空
|
||||
# accessControlAllowOrigin: http://demo.jeesite.com
|
||||
# accessControlAllowOrigin: http://demo.jeesite.net
|
||||
# accessControlAllowOrigin: '*'
|
||||
|
||||
# URI 权限过滤器定义
|
||||
|
||||
@@ -43,9 +43,9 @@ public class MobileAppTest {
|
||||
* 登录地址及登录信息
|
||||
*/
|
||||
private static String loginUrl = "/login"
|
||||
+ "?username=" + DesUtils.encode("thinkgem", "thinkgem,jeesite,com")
|
||||
+ "?username=" + DesUtils.encode("system", "thinkgem,jeesite,com")
|
||||
+ "&password=" + DesUtils.encode("admin", "thinkgem,jeesite,com")
|
||||
+ "¶m_deviceType=mobileApp";
|
||||
+ "¶m_deviceType=mobileApp&__sid=";
|
||||
|
||||
/**
|
||||
* 存储的会话编号,则通过getSid()获取。
|
||||
|
||||
Reference in New Issue
Block a user