RichTextController.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * RichTextController.php UTF-8
  4. * 富文本说明请求 用户协议,防沉迷说明
  5. *
  6. * @date : 2018/4/27 21:48
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : liuhongliang <lhl@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace h5wap\wap\controller;
  13. use h5wap\common\controller\V2BaseController;
  14. use huo\controller\richtext\RichText;
  15. use huolib\status\CommonStatus;
  16. class RichTextController extends V2BaseController {
  17. /**
  18. * 富文本说明请求 用户协议,防沉迷说明
  19. * http://doc.1tsdk.com/138?page_id=3134 *
  20. * 【域名】/wap/richtext/index
  21. *
  22. * @param $key @see RichTextKeyConst
  23. *
  24. * @return mixed
  25. */
  26. public function index($key) {
  27. $_richtext_class = new RichText();
  28. $_data = $_richtext_class->getDetail($key);
  29. if (CommonStatus::NO_ERROR != $_data['code']) {
  30. $this->returnData($_data);
  31. }
  32. if ($this->response_type == 'json') {
  33. $this->returnData($_data);
  34. }
  35. $_detail = $_data['data'];
  36. $this->assign('news', $_detail);
  37. return $this->fetch("richtext/$key");
  38. }
  39. }