Index.php 981 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\register\controller;
  3. use app\models\system\Site;
  4. use crmeb\basic\BaseController;
  5. class Index extends BaseController
  6. {
  7. public function index()
  8. {
  9. $domain = $this->request->domain();
  10. if (strstr($domain, 'http://')) {
  11. $domain = substr($domain, 7);
  12. } else {
  13. $domain = substr($domain, 8);
  14. }
  15. $appid = Site::where('domain', $domain)->find();
  16. if (!$appid) {
  17. return $this->fetch('404');
  18. }
  19. $Appid = $appid['appid'];
  20. $time = time();
  21. $Sign = Site::getSign($Appid, $time);
  22. $apk = sys_config('apk', '');
  23. $this->assign('apk', $apk);
  24. $this->assign('sign', $Sign);
  25. $this->assign('time', $time);
  26. $this->assign('appid', $Appid);
  27. return $this->fetch();
  28. }
  29. public function down()
  30. {
  31. $apk = sys_config('apk', '');
  32. $this->assign('apk', $apk);
  33. return $this->fetch();
  34. }
  35. }