loginById.php 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. defined('ONLY_ONLY_ONLY') or exit('Access Denied');
  3. define('LOG_CATALOG',"loginById");
  4. try{
  5. $subSystem=intval(SUBSYS_PLAT_PCWEB);
  6. $loginInfo=bizPlater_getFELoginInfo(true);
  7. $loginName=$loginInfo["loginName"];
  8. $loginPwd=$loginInfo["loginPwd"];
  9. $hashedLoginPwd=bizPlater_cryptLoginPwd($loginPwd);
  10. $bizPlater=pdo_fetch("select * from base_user where deleted=0 and subsystem=:subsystem and `login_name`=:login_name and `login_pwd`=:login_pwd limit 1;",
  11. array(
  12. ":subsystem"=>intval($subSystem),
  13. ":login_name"=>trim($loginName),
  14. ":login_pwd"=>$hashedLoginPwd
  15. ));
  16. if(empty($bizPlater)) throw new GeneralException("","无此用户,或密码录入错误!");
  17. //获取当前用户的可用模块列表
  18. $feModuleSet=bizPlater_getModuleSet($bizPlater);
  19. $FOREND_TOKEN=base_buildForendToken($bizPlater);
  20. unset($bizPlater["login_pwd"]);
  21. $ajaxRes->Result=array(
  22. "forendToken"=>$FOREND_TOKEN,
  23. "navIcon" => $feModuleSet["navIcon"],
  24. "states" => $feModuleSet["states"],
  25. "mainRoleName"=>$feModuleSet["mainRoleName"],
  26. "bizUserInfo"=>$bizPlater,
  27. "undoList"=>$feModuleSet["undoList"],
  28. );
  29. }catch(Throwable $e){
  30. $friendMsg=get_class($e)=='GeneralException'?$e->friendmsg:$e->getMessage();
  31. throw new GeneralException("","登录异常:".$friendMsg,LOG_CATALOG,0,$e);
  32. }