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(),