Browse Source

Update application/index/controller/Ajax.php

修正application/config.php中'app_trace'=>Env::get('app.trace', true)时,浏览器访问e用户中心”/index/user"F12调试显示错误:Uncaught SyntaxError: Unexpected token <
raorf 7 years ago
parent
commit
336597859a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      application/index/controller/Ajax.php

+ 1 - 1
application/index/controller/Ajax.php

@@ -26,7 +26,7 @@ class Ajax extends Frontend
         $controllername = input("controllername");
         $this->loadlang($controllername);
         //强制输出JSON Object
-        $result = 'define(' . json_encode(Lang::get(), JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . ');';
+        $result = jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]);
         return $result;
     }