diff --git a/src/admin/api.php b/src/admin/api.php
index 8a6f0d05..4b3b9eec 100644
--- a/src/admin/api.php
+++ b/src/admin/api.php
@@ -9,8 +9,8 @@
* @link https://www.dedebiz.com
*/
define('AJAXLOGIN', TRUE);
+define('IS_DEDEAPI', TRUE);
define('DEDEADMIN', str_replace("\\", '/', dirname(__FILE__)));
-$cfg_NotPrintHead = 'Y';
require_once(DEDEADMIN.'/../system/common.inc.php');
require_once(DEDEINC.'/userlogin.class.php');
AjaxHead();
diff --git a/src/admin/templets/index_body.htm b/src/admin/templets/index_body.htm
index 64694225..5b0d4099 100644
--- a/src/admin/templets/index_body.htm
+++ b/src/admin/templets/index_body.htm
@@ -206,8 +206,7 @@
$("#btnStep" + step).show();
}
function update() {
- $.get("api.php?action=update", function (data) {
- let rs = JSON.parse(data);
+ $.get("api.php?action=update", function (rs) {
if (rs.code === 0) {
$("#_updateMsg").html(rs.msg);
if (rs.data.finish === false) {
@@ -224,9 +223,8 @@
})
}
function hasNewVersion() {
- $.get("api.php?action=has_new_version", function (data) {
+ $.get("api.php?action=has_new_version", function (rs) {
try {
- let rs = JSON.parse(data);
if (rs.code === 0) {
if (rs.result.HasNew === true) {
hasNewVer = true;
@@ -254,8 +252,7 @@
let alertMsg = dedeAlter("正在备份差异文件", 'info', true);
$("#_msgInfo").html(alertMsg);
$("#_msgInfo").show();
- $.get("api.php?action=update_backup", function (data) {
- let rs = JSON.parse(data);
+ $.get("api.php?action=update_backup", function (rs) {
if (rs.code === 0) {
alertMsg = dedeAlter(`成功备份差异文件,目录:${rs.data.backupdir}`, 'success');
$("#_msgInfo").html(alertMsg);
@@ -272,8 +269,7 @@
$('#mdlUpdate').modal('show');
showStepArea(currentStep);
currentStep++;
- $.get("api.php?action=get_changed_files", function (data) {
- let rs = JSON.parse(data);
+ $.get("api.php?action=get_changed_files", function (rs) {
if (rs.code === 0) {
let fstr = '
';
let i = 1;
@@ -299,8 +295,7 @@
$("#_msgInfo").html('');
$("#_msgInfo").hide();
showStepArea(currentStep);
- $.get("api.php?action=get_update_versions", function (data) {
- let rs = JSON.parse(data);
+ $.get("api.php?action=get_update_versions", function (rs) {
if (rs.code === 0) {
let fstr = '';
let i = 1;
diff --git a/src/apps/statistics.php b/src/apps/statistics.php
index 1a7f2045..b668ec6c 100644
--- a/src/apps/statistics.php
+++ b/src/apps/statistics.php
@@ -8,6 +8,7 @@
* @license https://www.dedebiz.com/license
* @link https://www.dedebiz.com
*/
+define('IS_DEDEAPI', TRUE);
require_once(dirname(__FILE__)."/../system/common.inc.php");
require_once(DEDEINC."/libraries/statistics.class.php");
if (empty($dopost)) $dopost = '';
diff --git a/src/static/web/js/login.js b/src/static/web/js/login.js
index 8f4b92aa..e7024835 100644
--- a/src/static/web/js/login.js
+++ b/src/static/web/js/login.js
@@ -2,8 +2,7 @@ $(document).ready(function () {
$("#iptUserid").focusout(function () {
let userid = $(this).val();
if (userid !== '') {
- $.get("api.php?action=is_need_check_code&userid=" + userid, function (data) {
- let rs = JSON.parse(data);
+ $.get("api.php?action=is_need_check_code&userid=" + userid, function (rs) {
if (rs.code === 0) {
if (rs.data.isNeed) {
$("#vdimgck").show();
diff --git a/src/system/common.inc.php b/src/system/common.inc.php
index fcf50f3b..a4530cf8 100755
--- a/src/system/common.inc.php
+++ b/src/system/common.inc.php
@@ -10,7 +10,7 @@
define('DEDEBIZ_SAFE_MODE', FALSE);
//生产环境使用`production`,如果采用`dev`模式,会有一些php的报错信息提示,用于开发调试
if (!defined('DEDE_ENVIRONMENT')) {
- define('DEDE_ENVIRONMENT', 'production');
+ define('DEDE_ENVIRONMENT', 'dev');
}
if (!defined('DEBUG_LEVEL')) {
if (DEDE_ENVIRONMENT == 'production') {
@@ -228,7 +228,7 @@ if (isset($GLOBALS['TotalResult'])) {
if (!isset($cfg_NotPrintHead)) {
if (PHP_SAPI != 'cli') {
if (defined('IS_DEDEAPI')) {
- header("Content-Type:text/json;");
+ header("Content-Type:text/json; charset={$cfg_soft_lang}");
} else {
header("Content-Type:text/html; charset={$cfg_soft_lang}");
}
diff --git a/src/theme/dedebiz/foot.htm b/src/theme/dedebiz/foot.htm
index de2572e6..ab364a95 100644
--- a/src/theme/dedebiz/foot.htm
+++ b/src/theme/dedebiz/foot.htm
@@ -13,8 +13,7 @@