Browse Source

文件路径index bug

huwhois 3 years ago
parent
commit
f97fb81a76
2 changed files with 7 additions and 1 deletions
  1. 3 1
      application/App.php
  2. 4 0
      application/Index.php

+ 3 - 1
application/App.php

@ -60,7 +60,9 @@ class App{
60 60
            } else {
61 61
                $action = $pathinfo;
62 62
            }
63
            $doc = str_replace($action, '', $pathinfo);
63
            // var_dump($pathinfo);
64
65
            $doc = substr($pathinfo, strlen($action));
64 66
        }
65 67
        $action = $action ? : "index";
66 68
        

+ 4 - 0
application/Index.php

@ -14,10 +14,14 @@ class Index extends View
14 14
    public function index()
15 15
    {
16 16
        $doc = $GLOBALS['doc'];
17
17 18
        $doc = ltrim($doc, '/');
19
18 20
        if (substr($doc, -1) === '/') {
19 21
            $doc = $doc . "index.md";
20 22
        }
23
        // var_dump($doc);
24
        // exit;
21 25
        $doc = empty($doc) ? 'index.md' : $doc;
22 26
        if (pathinfo($doc,PATHINFO_EXTENSION) != 'md') {
23 27
            $doc = $doc . ".md";