From 4bd69e5d6e9c3cee5165d78c1cf0730e41564e1c Mon Sep 17 00:00:00 2001 From: zyzzc Date: Sat, 10 May 2014 10:07:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=88=E5=AF=B9=E8=87=AA=E5=AE=9A=E4=B9=89ad?= =?UTF-8?q?min=E7=9B=AE=E5=BD=95=E4=B8=8Erewrite=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plugin.php | 8 ++++---- market.php | 7 +++++-- views/js.php | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Plugin.php b/Plugin.php index 5788acd..9f47480 100644 --- a/Plugin.php +++ b/Plugin.php @@ -4,7 +4,7 @@ * * @package AppStore * @author chekun - * @version 1.0.1 + * @version 1.0.0 * @link http://typecho.dilicms.com */ class AppStore_Plugin implements Typecho_Plugin_Interface @@ -37,8 +37,8 @@ public static function activate() //创建菜单和路由 Helper::addPanel(3, 'AppStore/market.php', '应用商店', '应用商店', 'administrator'); - Helper::addRoute('app.store.market', '/admin/app-store/market', 'AppStore_Action', 'market'); - Helper::addRoute('app.store.install', '/admin/app-store/install', 'AppStore_Action', 'install'); + Helper::addRoute('app.store.market', __TYPECHO_ADMIN_DIR__.'app-store/market', 'AppStore_Action', 'market'); + Helper::addRoute('app.store.install', __TYPECHO_ADMIN_DIR__.'app-store/install', 'AppStore_Action', 'install'); } /** @@ -88,4 +88,4 @@ public static function config(Typecho_Widget_Helper_Form $form) */ public static function personalConfig(Typecho_Widget_Helper_Form $form){} -} +} \ No newline at end of file diff --git a/market.php b/market.php index 924ff12..db8faa6 100644 --- a/market.php +++ b/market.php @@ -1,3 +1,6 @@ redirect('/index.php/admin/app-store/market'); \ No newline at end of file +$options = Helper::options(); +$siteUrl = $options->siteUrl; +$isRewrite = $options->rewrite; +$absUrl = ($isRewrite ? rtrim($siteUrl, '/') : $siteUrl."index.php"); +Typecho_Response::getInstance()->redirect($absUrl.__TYPECHO_ADMIN_DIR__.'app-store/market'); \ No newline at end of file diff --git a/views/js.php b/views/js.php index cf01786..affe7c6 100644 --- a/views/js.php +++ b/views/js.php @@ -34,7 +34,7 @@ function init() } $.ajax({ - url: 'getRequestUrl()); ?>', + url: 'adminUrl('app-store/install'); ?>', dataType: 'json', data: { version: $version.val(),