Browse Source

代码调整

tags/6.0.0
tianya 3 months ago
parent
commit
ac9141298b
5 changed files with 144 additions and 37 deletions
  1. +1
    -1
      src/dede/inc/inc_menu.php
  2. +54
    -8
      src/dede/index_body.php
  3. +1
    -1
      src/dede/templets/index2.htm
  4. +73
    -27
      src/dede/templets/index_body.htm
  5. +15
    -0
      src/include/common.inc.php

+ 1
- 1
src/dede/inc/inc_menu.php View File

@@ -161,7 +161,7 @@ $adminMenu2
<m:top item='1_10_7_' name='系统帮助' display='none'>
<m:item name='参考文档' link='http://help.dedecms.com' rank='' target='_blank' />
<m:item name='意见建议反馈' link='https://github.com/dedetech/issues' rank='' target='_blank' />
<m:item name='代码托管' link='https://git.dedebiz.com/' rank='' target='_blank' />
<m:item name='代码托管' link='https://www.dedebiz.com/git' rank='' target='_blank' />
<m:item name='官方交流论坛' link='http://bbs.dedecms.com' rank='' target='_blank' />
</m:top>


+ 54
- 8
src/dede/index_body.php View File

@@ -226,16 +226,62 @@ else if ($dopost == 'getRightSide') {
// 直接采用DedeBIZ重写方法
exit;
} elseif ($dopost == "system_info") {
$client = new DedeBizClient('127.0.0.1', 8181);
$client->appid = "1008665";
$client->key = "I04NcaYUCmRukRDE";
$rs = $client->SystemInfo();
if ($rs->code === 200) {
echo $rs->data;
$client->Close();
if (!extension_loaded("openssl")) {
echo json_encode(array(
"code" => -1001,
"msg"=>"PHP不支持OpenSSL,无法完成Dede商业授权",
"result"=>null,
));
exit;
}
if (empty($cfg_auth_code)) {
echo json_encode(array(
"code" => -1002,
"msg"=>"当前站点尚未购买Dede商业授权",
"result"=>null,
));
exit;
}
openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB);
if (!empty($decotent)) {
$res = json_decode($decotent);
if (isset($res->sid)) {
echo json_encode(array(
"code" => 200,
"msg"=>"",
"result"=>array(
"domain" => $res->domain,
"title" => $res->title,
"stype" => $res->stype == 1? "企业单位" : "个人",
"auth_version" => $res->auth_version,
"auth_at" => date("Y-m-d", $res->auth_at),
),
));
}
}
// openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB);
// var_dump($decotent);
// $client = new DedeBizClient('127.0.0.1', 8181);
// $client->appid = "1008665";
// $client->key = "I04NcaYUCmRukRDE";
// $rs = $client->SystemInfo();
// if ($rs->code === 200) {
// echo $rs->data;
// $client->Close();
// exit;
// }
}
?>

+ 1
- 1
src/dede/templets/index2.htm View File

@@ -115,7 +115,7 @@
<form action="action_search.php" target="main" method="post">
<input name="keyword" type="text" value="功能搜索" onfocus="if(this.value=='功能搜索'){this.value='';}" onblur="if(this.value==''){this.value='功能搜索';}" class="allsearch" style="width:150px;"/>
<input name="" type="submit" value="搜索" class="np"/>
<a href='https://git.dedebiz.com' target='_blank'>代码托管</a> <a href='http://bbs.dedecms.com' target='_blank'>官方论坛</a>
<a href='https://www.dedebiz.com/git' target='_blank'>代码托管</a> <a href='http://bbs.dedecms.com' target='_blank'>官方论坛</a>
</form>
</div>
</div>


+ 73
- 27
src/dede/templets/index_body.htm View File

@@ -81,7 +81,7 @@
<div class="col-md-6 mt-3">
<div class="card">
<div class="card-header">
Dede商业服务
Dede商业服务授权
</div>
<!--/.card-header-->
<div class="card-body" id="_systeminfo">
@@ -401,33 +401,79 @@
$.get("index_body.php?dopost=system_info", function (data) {
let rsp = JSON.parse(data);
if (rsp.code === 200) {
$("#_systeminfo").html(`
<table width="100%" class="table table-borderless">
<tbody>
<tr>
<td class="nline" style="text-align:left"> 运行时间: </td>
<td class="nline" style="text-align:left"> ${rsp.result.server_run_time} </td>
</tr>
<tr>
<td class="nline" style="text-align:left"> 系统: </td>
<td class="nline" style="text-align:left"> ${rsp.result.server_goos}(${rsp.result.server_goarch})</td>
</tr>
<tr>
<td class="nline" style="text-align:left"> 版本号: </td>
<td class="nline" style="text-align:left"> v${rsp.result.server_version} </td>
</tr>
<tr>
<td class="nline" style="text-align:left"> 内存使用: </td>
<td class="nline" style="text-align:left">
<div class="progress-bar bg-success" role="progressbar" style="width: ${rsp.result.server_memory_usage}%;" aria-valuenow="${rsp.result.server_memory_usage}" aria-valuemin="0" aria-valuemax="100">${rsp.result.server_memory_usage}%</div>
</td>
</tr>
</tbody></table>
`);
let infoStr = `<table width="100%" class="table table-borderless"><tbody>`;
if (typeof rsp.result.domain !== "undefined") {
infoStr += `
<tr>
<td class="nline" style="text-align:left"> 授权域名: </td>
<td class="nline" style="text-align:left"> ${rsp.result.domain} <a href="https://www.dedebiz.com/auth/?domain=${rsp.result.domain}"><b>【查看】</b></a> </td>
</tr>
`;
}
if (typeof rsp.result.title !== "undefined") {
infoStr += `
<tr>
<td class="nline" style="text-align:left"> 站点名称: </td>
<td class="nline" style="text-align:left"> ${rsp.result.title} </td>
</tr>
`;
}
if (typeof rsp.result.stype !== "undefined") {
infoStr += `
<tr>
<td class="nline" style="text-align:left"> 站点类型: </td>
<td class="nline" style="text-align:left"> ${rsp.result.stype} </td>
</tr>
`;
}
if (typeof rsp.result.auth_version !== "undefined") {
infoStr += `
<tr>
<td class="nline" style="text-align:left"> 授权版本: </td>
<td class="nline" style="text-align:left"> v${rsp.result.auth_version}.x.x </td>
</tr>
`;
}
if (typeof rsp.result.auth_at !== "undefined") {
infoStr += `
<tr>
<td class="nline" style="text-align:left"> 授权时间: </td>
<td class="nline" style="text-align:left"> ${rsp.result.auth_at} </td>
</tr>
`;
}
if (typeof rsp.result.server_run_time === "undefined") {
// 下面是DedeBIZ Core组件信息
infoStr += `
<tr>
<td class="nline" style="text-align:left"> Dede商业组件: </td>
<td class="nline" style="text-align:left"> <a class="btn btn-danger btn-sm" target="_blank" href="https://www.dedebiz.com/start?code=-1008">如何启动组件</a> </td>
</tr>
`;
} else {
// 下面是DedeBIZ Core组件信息
if (typeof rsp.result.server_run_time !== "undefined") {
infoStr += `
<tr>
<td class="nline" style="text-align:left"> 运行时间: </td>
<td class="nline" style="text-align:left"> ${rsp.result.server_run_time} </td>
</tr>
`;
} else {
// 商业组件信息
}
}
infoStr += "</tbody></table>";
$("#_systeminfo").html(infoStr);
} else {
$("#_systeminfo").html(`尚未启动Dede商业站点服务,<a class="btn btn-danger">去开启</a>`);
$("#_systeminfo").html(`
<div class="py-1">尚未启动Dede商业站点服务,原因:<b>${rsp.msg}</b></div>
<div class="py-1">Dede商业服务可以提升性能、增强安全、支持开源。</div>
<div class="py-1"><a class="btn btn-danger" target="_blank" href="https://www.dedebiz.com/start?code=${rsp.code}">开启商业服务</a></div>
`);
}
});
}
@@ -435,7 +481,7 @@
LoadServer();
setInterval(function () {
LoadServer();
}, 1000)
}, 5000)
});
</script>
</body>


+ 15
- 0
src/include/common.inc.php View File

@@ -31,6 +31,21 @@ define('DEDEMODEL', './model');
define('DEDECONTROL', './control');
define('DEDEAPPTPL', './templates');

// ------------------------------------------------------------------------
define('DEDEVER', 6); // 当前系统大版本
define('DEDEPUB', <<<EOT
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvupO2Lixns34bBqwTzK0
9wA9sfGBdgc03zh1sUacieJBikx08e7xmkJbMF81jb/YfNGW/+iJ3qHULdc9Dtd3
+FsnHG+tUDnzjkPnVVmnrjucQqfHRRVKKAgXOWxtuRKUVF3NDjiJtDAf5Y2BMAhw
oqzeepye5I4mWyO4A8/V2ougO+xDK426MIf1dq+W59NVZj8k+zeZrbPh7+fPFw4u
PwAMpkTJJ9nwNOO6saH2eMGaQ3oxZIQ+SmminDB8miI/+hwIn2hNmaHFuur0OGlB
NQabUzX9JoYtXqPcpZRT7ymHrppU0KFdUSEJiW0utTWJo0HrDOBIT5qWlM0MP9p/
PwIDAQAB
-----END PUBLIC KEY-----
EOT); // DedeBIZ系统公钥


if (version_compare(PHP_VERSION, '5.3.0', '<') && function_exists("get_magic_quotes_gpc"))
{
set_magic_quotes_runtime(0);


Loading…
Cancel
Save