ewei_shopv2_api.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. define('IN_SYS', true);
  3. require __DIR__ . '/../framework/bootstrap.inc.php';
  4. load()->web('common');
  5. $uniacid = intval($_GPC['i']);
  6. $_W['attachurl'] = $_W['attachurl_local'] = $_W['siteroot'] . $_W['config']['upload']['attachdir'] . '/';
  7. if (!(empty($_W['setting']['remote'][$_W['uniacid']]['type'])))
  8. {
  9. $_W['setting']['remote'] = $_W['setting']['remote'][$_W['uniacid']];
  10. }
  11. if (!(empty($_W['setting']['remote']['type'])))
  12. {
  13. if ($_W['setting']['remote']['type'] == ATTACH_FTP)
  14. {
  15. $_W['attachurl'] = $_W['attachurl_remote'] = $_W['setting']['remote']['ftp']['url'] . '/';
  16. }
  17. else if ($_W['setting']['remote']['type'] == ATTACH_OSS)
  18. {
  19. $_W['attachurl'] = $_W['attachurl_remote'] = $_W['setting']['remote']['alioss']['url'] . '/';
  20. }
  21. else if ($_W['setting']['remote']['type'] == ATTACH_QINIU)
  22. {
  23. $_W['attachurl'] = $_W['attachurl_remote'] = $_W['setting']['remote']['qiniu']['url'] . '/';
  24. }
  25. else if ($_W['setting']['remote']['type'] == ATTACH_COS)
  26. {
  27. $_W['attachurl'] = $_W['attachurl_remote'] = $_W['setting']['remote']['cos']['url'] . '/';
  28. }
  29. }
  30. if (!(empty($_GPC['formwe7'])))
  31. {
  32. $bind = pdo_fetch('SELECT * FROM ' . tablename('ewei_shop_wxapp_bind') . ' WHERE wxapp=:wxapp LIMIT 1', array(':wxapp' => $uniacid));
  33. if (!(empty($bind)) && !(empty($bind['uniacid'])))
  34. {
  35. $uniacid = $_GPC['i'] = $bind['uniacid'];
  36. }
  37. }
  38. if (empty($uniacid))
  39. {
  40. exit('Access Denied.');
  41. }
  42. $site = WeUtility::createModuleSite('ewei_shopv2');
  43. $_GPC['c'] = 'site';
  44. $_GPC['a'] = 'entry';
  45. $_GPC['m'] = 'ewei_shopv2';
  46. $_GPC['do'] = 'mobile';
  47. $_W['uniacid'] = (int) $_GPC['i'];
  48. $_W['acid'] = (int) $_GPC['i'];
  49. if (!(isset($_GPC['r'])))
  50. {
  51. $_GPC['r'] = 'app';
  52. }
  53. else
  54. {
  55. $_GPC['r'] = 'app.' . $_GPC['r'];
  56. }
  57. if (!(is_error($site)))
  58. {
  59. $method = 'doMobileMobile';
  60. $site->uniacid = $uniacid;
  61. $site->inMobile = true;
  62. if (method_exists($site, $method))
  63. {
  64. $site->$method();
  65. exit();
  66. }
  67. }
  68. ?>