国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6KB

  1. <?php
  2. /**
  3. * @version $id:api.php 8:38 2010年7月9日 tianya $
  4. * @package DedeBIZ.User
  5. * @copyright Copyright (c) 2022 DedeBIZ.COM
  6. * @license https://www.dedebiz.com/license
  7. * @link https://www.dedebiz.com
  8. */
  9. define('AJAXLOGIN', TRUE);
  10. define('IS_DEDEAPI', TRUE);
  11. require_once(dirname(__FILE__)."/config.php");
  12. AjaxHead();
  13. $action = isset($action)? $action : '';
  14. if ($action === 'is_need_check_code') {
  15. $isNeed = $cfg_ml->isNeedCheckCode($userid);
  16. echo json_encode(array(
  17. "code" => 0,
  18. "msg" => "",
  19. "data" => array(
  20. "isNeed" => $isNeed,
  21. ),
  22. ));
  23. exit;
  24. } else {
  25. $format = isset($format) ? "json" : "";
  26. if (!$cfg_ml->IsLogin()) {
  27. if ($format === 'json') {
  28. echo json_encode(array(
  29. "code" => -1,
  30. "msg" => "未登录",
  31. "data" => null,
  32. ));
  33. } else {
  34. echo "";
  35. }
  36. exit;
  37. }
  38. $uid = $cfg_ml->M_LoginID;
  39. !$cfg_ml->fields['face'] && $face = ($cfg_ml->fields['sex'] == '女') ? 'dfgirl' : 'dfboy';
  40. $facepic = empty($face) ? $cfg_ml->fields['face'] : $GLOBALS['cfg_memberurl'].'/templets/images/'.$face.'.png';
  41. if ($format === 'json') {
  42. echo json_encode(array(
  43. "code" => 200,
  44. "msg" => "",
  45. "data" => array(
  46. "username" => $cfg_ml->M_UserName,
  47. "myurl" => $myurl,
  48. "facepic" => $facepic,
  49. "memberurl" => $cfg_memberurl,
  50. ),
  51. ));
  52. exit;
  53. }
  54. }
  55. ?>