第三段完善 代理商绑定 激活等 正式上线的版本
This commit is contained in:
@@ -56,22 +56,51 @@ class Config extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->title = '系统参数配置';
|
||||
$this->files = Storage::types();
|
||||
$this->plugins = Plugin::get(null, true);
|
||||
$this->issuper = AdminService::isSuper();
|
||||
$this->systemid = ModuleService::getRunVar('uni');
|
||||
$this->framework = ModuleService::getLibrarys('topthink/framework');
|
||||
$this->thinkadmin = ModuleService::getLibrarys('zoujingli/think-library');
|
||||
if (AdminService::isSuper() && $this->app->session->get('user.password') === md5('admin')) {
|
||||
$url = url('admin/index/pass', ['id' => AdminService::getUserId()]);
|
||||
$this->showErrorMessage = lang("超级管理员账号的密码未修改,建议立即<a data-modal='%s'>修改密码</a>!", [$url]);
|
||||
if ($this->request->isGet()) {
|
||||
$this->title = '系统参数配置';
|
||||
$this->files = Storage::types();
|
||||
$this->plugins = Plugin::get(null, true);
|
||||
$this->issuper = AdminService::isSuper();
|
||||
$this->systemid = ModuleService::getRunVar('uni');
|
||||
$this->framework = ModuleService::getLibrarys('topthink/framework');
|
||||
$this->thinkadmin = ModuleService::getLibrarys('zoujingli/think-library');
|
||||
if (AdminService::isSuper() && $this->app->session->get('user.password') === md5('admin')) {
|
||||
$url = url('admin/index/pass', ['id' => AdminService::getUserId()]);
|
||||
$this->showErrorMessage = lang("超级管理员账号的密码未修改,建议立即<a data-modal='%s'>修改密码</a>!", [$url]);
|
||||
}
|
||||
uasort($this->plugins, static function ($a, $b) {
|
||||
if ($a['space'] === $b['space']) return 0;
|
||||
return $a['space'] > $b['space'] ? 1 : -1;
|
||||
});
|
||||
$this->fetch();
|
||||
} else {
|
||||
$data = $this->request->post();
|
||||
foreach ($data as $k => $v) {
|
||||
sysconf($k, $v);
|
||||
}
|
||||
$this->success('参数修改成功!');
|
||||
}
|
||||
uasort($this->plugins, static function ($a, $b) {
|
||||
if ($a['space'] === $b['space']) return 0;
|
||||
return $a['space'] > $b['space'] ? 1 : -1;
|
||||
});
|
||||
$this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统配置参数
|
||||
* @param string $name 配置名称
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
return sysconf($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统配置参数
|
||||
* @param string $name 配置名称
|
||||
* @param mixed $value 配置值
|
||||
* @return mixed
|
||||
*/
|
||||
public function set($name, $value)
|
||||
{
|
||||
return sysconf($name, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,18 +82,48 @@ class Account extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
// 检查设备是否在冷却期
|
||||
$cooldownKey = "device_cooldown_{$machineId}";
|
||||
$isInCooldown = \think\facade\Cache::get($cooldownKey);
|
||||
// 优先检查缓存中是否有该设备最近使用的账号
|
||||
$cacheKey = "device_account_{$machineId}";
|
||||
$cachedAccount = \think\facade\Cache::get($cacheKey);
|
||||
|
||||
if ($cachedAccount) {
|
||||
// 检查账号是否仍然可用
|
||||
$account = Db::name('cursor_accounts')
|
||||
->where('id', $cachedAccount['id'])
|
||||
->find();
|
||||
|
||||
if ($account) {
|
||||
// 更新缓存时间
|
||||
\think\facade\Cache::set($cacheKey, $account, 600); // 10分钟缓存
|
||||
|
||||
// 查询设备激活状态用于计算过期时间
|
||||
$activations = Db::name('cursor_activation_codes')
|
||||
->where('used_by', '=', $machineId)
|
||||
->where('is_used', '=', 1)
|
||||
->order('used_at desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
if ($isInCooldown) {
|
||||
return json([
|
||||
'code' => 429,
|
||||
'msg' => '请求过于频繁,请稍后再试',
|
||||
'data' => [
|
||||
'cooldown_expires' => date('Y-m-d H:i:s', $isInCooldown)
|
||||
]
|
||||
]);
|
||||
if (!empty($activations)) {
|
||||
$totalDays = array_sum(array_column($activations, 'days'));
|
||||
$firstActivationTime = strtotime($activations[count($activations)-1]['used_at']);
|
||||
$expireTime = $firstActivationTime + ($totalDays * 24 * 3600);
|
||||
|
||||
// 返回账号信息
|
||||
return json([
|
||||
'code' => 200,
|
||||
'msg' => '获取成功',
|
||||
'data' => [
|
||||
'email' => $account['email'],
|
||||
'password' => $account['password'],
|
||||
'access_token' => $account['access_token'],
|
||||
'refresh_token' => $account['refresh_token'],
|
||||
'expire_time' => date('Y-m-d H:i:s', $expireTime),
|
||||
'days_left' => ceil(($expireTime - time()) / 86400)
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 查询设备激活状态
|
||||
@@ -124,39 +154,18 @@ class Account extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
// 检查缓存中是否有该设备最近使用的账号
|
||||
$cacheKey = "device_account_{$machineId}";
|
||||
$cachedAccount = \think\facade\Cache::get($cacheKey);
|
||||
|
||||
if ($cachedAccount) {
|
||||
// 检查账号是否仍然可用
|
||||
$account = Db::name('cursor_accounts')
|
||||
->where('id', $cachedAccount['id'])
|
||||
->find();
|
||||
|
||||
if ($account) {
|
||||
// 更新缓存时间
|
||||
\think\facade\Cache::set($cacheKey, $account, 600); // 10分钟缓存
|
||||
|
||||
// 返回账号信息
|
||||
return json([
|
||||
'code' => 200,
|
||||
'msg' => '获取成功',
|
||||
'data' => [
|
||||
'email' => $account['email'],
|
||||
'password' => $account['password'],
|
||||
'access_token' => $account['access_token'],
|
||||
'refresh_token' => $account['refresh_token'],
|
||||
'expire_time' => date('Y-m-d H:i:s', $expireTime),
|
||||
'days_left' => ceil(($expireTime - time()) / 86400)
|
||||
]
|
||||
]);
|
||||
}
|
||||
// 在分配新账号前检查冷却期
|
||||
$cooldownKey = "device_cooldown_{$machineId}";
|
||||
$isInCooldown = \think\facade\Cache::get($cooldownKey);
|
||||
if ($isInCooldown) {
|
||||
return json([
|
||||
'code' => 429,
|
||||
'msg' => '请求过于频繁,请稍后再试',
|
||||
'data' => [
|
||||
'cooldown_expires' => date('Y-m-d H:i:s', intval($isInCooldown))
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
// 记录冷却期
|
||||
$cooldownExpires = time() + 1800; // 30分钟冷却期
|
||||
\think\facade\Cache::set($cooldownKey, $cooldownExpires, 1800);
|
||||
|
||||
// 开启事务
|
||||
Db::startTrans();
|
||||
@@ -195,6 +204,10 @@ class Account extends Controller
|
||||
'used_by' => $machineId
|
||||
]);
|
||||
|
||||
// 设置冷却期(仅在成功分配新账号时)
|
||||
$cooldownExpires = time() + 1800; // 30分钟冷却期
|
||||
\think\facade\Cache::set($cooldownKey, $cooldownExpires, 1800);
|
||||
|
||||
Db::commit();
|
||||
|
||||
// 缓存新账号信息
|
||||
|
||||
@@ -45,6 +45,17 @@ class Mail extends Controller
|
||||
'BROWSER_USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.92 Safari/537.36',
|
||||
'MAIL_SERVER' => 'https://tempmail.plus'
|
||||
]
|
||||
] ,
|
||||
[
|
||||
'name' => '备用配置3',
|
||||
'config' => [
|
||||
'DOMAIN' => 'jxyweb.site',
|
||||
'TEMP_MAIL' => 'exvet',
|
||||
'TEMP_MAIL_EXT' => '@mailto.plus',
|
||||
'BROWSER_USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.92 Safari/537.36',
|
||||
'MAIL_SERVER' => 'https://tempmail.plus',
|
||||
'TEMP_MAIL_EPIN'=>'889944'
|
||||
]
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
@@ -205,16 +205,31 @@ class Member extends Controller
|
||||
return json(['code' => 400, 'msg' => '设备ID不能为空']);
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取Redis实例
|
||||
$redis = cache('redis');
|
||||
$cacheKey = "device_status:{$machineId}";
|
||||
|
||||
// 尝试获取缓存
|
||||
if ($redis && $statusInfo = $redis->get($cacheKey)) {
|
||||
return json(json_decode($statusInfo, true));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Redis异常时记录日志但继续执行
|
||||
trace("Redis异常: " . $e->getMessage(), 'error');
|
||||
}
|
||||
|
||||
// 获取该设备所有的激活记录
|
||||
$activations = Db::name('cursor_activation_codes')
|
||||
->where('used_by', '=', $machineId)
|
||||
->where('is_used', '=', 1)
|
||||
->field(['days', 'used_at', 'code', 'device_info'])
|
||||
->order('used_at desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
if (empty($activations)) {
|
||||
return json([
|
||||
$result = [
|
||||
'code' => 401,
|
||||
'msg' => '未激活',
|
||||
'data' => [
|
||||
@@ -224,7 +239,16 @@ class Member extends Controller
|
||||
'days_left' => 0,
|
||||
'activation_records' => []
|
||||
]
|
||||
]);
|
||||
];
|
||||
// 未激活状态缓存1分钟
|
||||
try {
|
||||
if ($redis) {
|
||||
$redis->set($cacheKey, json_encode($result), 60);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
trace("Redis缓存写入异常: " . $e->getMessage(), 'error');
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
// 计算总天数
|
||||
@@ -232,13 +256,13 @@ class Member extends Controller
|
||||
|
||||
// 计算最终到期时间
|
||||
$now = time();
|
||||
$firstActivationTime = strtotime($activations[count($activations)-1]['used_at']); // 第一次激活时间
|
||||
$expireTime = $firstActivationTime + ($totalDays * 24 * 3600); // 总天数转换为秒数
|
||||
$firstActivationTime = strtotime($activations[count($activations)-1]['used_at']);
|
||||
$expireTime = $firstActivationTime + ($totalDays * 24 * 3600);
|
||||
$daysLeft = ceil(($expireTime - $now) / 86400);
|
||||
|
||||
// 判断是否过期
|
||||
if ($daysLeft <= 0) {
|
||||
return json([
|
||||
$result = [
|
||||
'code' => 401,
|
||||
'msg' => '已过期',
|
||||
'data' => [
|
||||
@@ -256,11 +280,20 @@ class Member extends Controller
|
||||
];
|
||||
}, $activations)
|
||||
]
|
||||
]);
|
||||
];
|
||||
// 过期状态缓存1分钟
|
||||
try {
|
||||
if ($redis) {
|
||||
$redis->set($cacheKey, json_encode($result), 60);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
trace("Redis缓存写入异常: " . $e->getMessage(), 'error');
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
// 返回正常状态
|
||||
return json([
|
||||
// 正常状态返回
|
||||
$result = [
|
||||
'code' => 200,
|
||||
'msg' => '正常',
|
||||
'data' => [
|
||||
@@ -278,12 +311,21 @@ class Member extends Controller
|
||||
];
|
||||
}, $activations)
|
||||
]
|
||||
]);
|
||||
|
||||
];
|
||||
|
||||
// 正常状态缓存5分钟
|
||||
try {
|
||||
if ($redis) {
|
||||
$redis->set($cacheKey, json_encode($result), 300);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
trace("Redis缓存写入异常: " . $e->getMessage(), 'error');
|
||||
}
|
||||
return json($result);
|
||||
} catch (\Exception $e) {
|
||||
return json([
|
||||
'code' => 500,
|
||||
'msg' => $e->getMessage()
|
||||
'msg' => '系统异常,请稍后重试'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
137
app/admin/controller/api/Version.php
Normal file
137
app/admin/controller/api/Version.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\controller\api;
|
||||
|
||||
use app\admin\model\Version as VersionModel;
|
||||
use think\admin\Controller;
|
||||
use think\facade\Request;
|
||||
|
||||
/**
|
||||
* 版本管理接口
|
||||
* @auth true
|
||||
*
|
||||
* 接口说明:
|
||||
* ====================================================
|
||||
* 接口域名:{:sysconf('site_domain')}
|
||||
*
|
||||
* 公共返回参数:
|
||||
* - code: 错误码,0表示成功,非0表示失败
|
||||
* - msg: 提示信息
|
||||
* - data: 返回的数据,请求失败时可能为空
|
||||
*
|
||||
* 错误码说明:
|
||||
* - 0: 成功
|
||||
* - 1: 一般性错误(具体错误信息见msg)
|
||||
* - 401: 未授权或授权失败
|
||||
* - 404: 请求的资源不存在
|
||||
* - 500: 服务器内部错误
|
||||
*
|
||||
* 版本号格式:x.x.x (例如: 3.4.1)
|
||||
* 平台类型:
|
||||
* - all: 全平台
|
||||
* - windows: Windows平台
|
||||
* - mac: Mac平台
|
||||
* - linux: Linux平台
|
||||
* ====================================================
|
||||
*
|
||||
* 1. 获取最新版本 [GET] /admin/api.version/latest
|
||||
* 请求参数:
|
||||
* - platform: 平台类型(all|windows|mac|linux), 默认为all
|
||||
* 返回数据:
|
||||
* {
|
||||
* "code": 0,
|
||||
* "msg": "获取成功",
|
||||
* "data": {
|
||||
* "id": "1",
|
||||
* "version_no": "3.4.1.4",
|
||||
* "version_name": "听泉cursor助手",
|
||||
* "download_url": "http://domain/upload/xxx.exe",
|
||||
* "is_force": 1, // 是否强制更新(1是,0否)
|
||||
* "min_version": "3.4.0.0", // 最低要求版本
|
||||
* "platform": "all", // 平台类型
|
||||
* "description": "版本描述", // 版本描述
|
||||
* "status": 1, // 状态(1启用,0禁用)
|
||||
* "create_time": "2024-03-20 10:00:00"
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* 2. 检查版本更新 [GET] /admin/api.version/check
|
||||
* 请求参数:
|
||||
* - version: 当前版本号(必填)
|
||||
* - platform: 平台类型(all|windows|mac|linux), 默认为all
|
||||
* 返回数据:
|
||||
* {
|
||||
* "code": 0,
|
||||
* "msg": "检查完成",
|
||||
* "data": {
|
||||
* "has_update": true, // 是否有更新
|
||||
* "is_force": 1, // 是否强制更新
|
||||
* "version_info": { // 新版本信息(has_update为true时返回)
|
||||
* // 同上面的版本信息
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* 错误返回示例:
|
||||
* {
|
||||
* "code": 1,
|
||||
* "msg": "请提供当前版本号",
|
||||
* "data": null
|
||||
* }
|
||||
*/
|
||||
class Version extends Controller
|
||||
{
|
||||
/**
|
||||
* 获取最新版本
|
||||
* @return void
|
||||
*/
|
||||
public function latest()
|
||||
{
|
||||
$platform = $this->request->param('platform', 'all');
|
||||
$version = VersionModel::mk()->getLatestVersion($platform);
|
||||
if (!$version) {
|
||||
$this->error('暂无版本信息');
|
||||
}
|
||||
|
||||
// 处理下载地址
|
||||
$version['download_url'] = $this->getFullUrl($version['download_url']);
|
||||
$this->success('获取成功', $version);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查更新
|
||||
* @return void
|
||||
*/
|
||||
public function check()
|
||||
{
|
||||
$currentVersion = $this->request->param('version');
|
||||
$platform = $this->request->param('platform', 'all');
|
||||
|
||||
if (empty($currentVersion)) {
|
||||
$this->error('请提供当前版本号');
|
||||
}
|
||||
|
||||
$result = VersionModel::mk()->checkUpdate($currentVersion, $platform);
|
||||
if (isset($result['error'])) {
|
||||
$this->error($result['error']);
|
||||
}
|
||||
|
||||
// 如果有更新,处理下载地址
|
||||
if ($result['has_update'] && isset($result['version_info'])) {
|
||||
$result['version_info']['download_url'] = $this->getFullUrl($result['version_info']['download_url']);
|
||||
}
|
||||
|
||||
$this->success('检查完成', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取完整的下载地址
|
||||
* @param string $path 相对路径
|
||||
* @return string
|
||||
*/
|
||||
protected function getFullUrl($path)
|
||||
{
|
||||
return sysconf('site_domain') . $path;
|
||||
}
|
||||
}
|
||||
167
app/admin/model/Version.php
Normal file
167
app/admin/model/Version.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\admin\Model;
|
||||
|
||||
class Version extends Model
|
||||
{
|
||||
protected $name = 'version';
|
||||
|
||||
// 自动写入时间戳
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
// 版本状态
|
||||
const STATUS_DISABLED = 0;
|
||||
const STATUS_ENABLED = 1;
|
||||
|
||||
/**
|
||||
* 获取下一个版本号
|
||||
* @param string $currentVersion 当前版本号
|
||||
* @return string
|
||||
*/
|
||||
public static function getNextVersion($currentVersion = '')
|
||||
{
|
||||
if (empty($currentVersion)) {
|
||||
// 获取最新版本号
|
||||
$latest = self::order('version_no DESC')->value('version_no');
|
||||
$currentVersion = $latest ?: '1.0.0';
|
||||
}
|
||||
|
||||
// 拆分版本号
|
||||
$parts = explode('.', $currentVersion);
|
||||
$major = intval($parts[0] ?? 1);
|
||||
$minor = intval($parts[1] ?? 0);
|
||||
$patch = intval($parts[2] ?? 0);
|
||||
|
||||
// 增加修订号
|
||||
$patch++;
|
||||
// 如果修订号超过99,增加次版本号
|
||||
if ($patch > 99) {
|
||||
$minor++;
|
||||
$patch = 0;
|
||||
}
|
||||
// 如果次版本号超过99,增加主版本号
|
||||
if ($minor > 99) {
|
||||
$major++;
|
||||
$minor = 0;
|
||||
}
|
||||
|
||||
return sprintf('%d.%d.%d', $major, $minor, $patch);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成版本名称
|
||||
* @param string $version_no 版本号
|
||||
* @param string $filename 文件名
|
||||
* @return string
|
||||
*/
|
||||
public static function generateVersionName($version_no, $filename = '')
|
||||
{
|
||||
// 如果有文件名,尝试从文件名中提取有意义的部分
|
||||
if ($filename) {
|
||||
// 移除扩展名
|
||||
$name = pathinfo($filename, PATHINFO_FILENAME);
|
||||
// 移除版本号部分 (匹配v后面的所有数字和点)
|
||||
$name = preg_replace('/v\d+[\d\.]+/', '', $name);
|
||||
$name = trim($name);
|
||||
if (!empty($name)) {
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
|
||||
// 默认使用版本号作为名称
|
||||
return sprintf('版本 %s', $version_no);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从文件名解析版本号
|
||||
* @param string $filename
|
||||
* @return string
|
||||
*/
|
||||
public static function parseVersionFromFilename($filename)
|
||||
{
|
||||
// 移除扩展名
|
||||
$name = pathinfo($filename, PATHINFO_FILENAME);
|
||||
|
||||
// 匹配版本号 (匹配v后面的所有数字和点)
|
||||
if (preg_match('/v(\d+[\d\.]+)/', $name, $matches)) {
|
||||
return $matches[1];
|
||||
}
|
||||
|
||||
// 如果没有找到版本号,使用当前最新版本号加1
|
||||
return self::getNextVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最新版本信息
|
||||
* @param string $platform 平台
|
||||
* @return array|null
|
||||
*/
|
||||
public function getLatestVersion($platform = 'all')
|
||||
{
|
||||
return $this->where([
|
||||
['status', '=', self::STATUS_ENABLED],
|
||||
['platform', 'in', [$platform, 'all']]
|
||||
])->order('version_no DESC')->find();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查版本更新
|
||||
* @param string $currentVersion 当前版本
|
||||
* @param string $platform 平台
|
||||
* @return array
|
||||
*/
|
||||
public function checkUpdate($currentVersion, $platform = 'all')
|
||||
{
|
||||
$latest = $this->getLatestVersion($platform);
|
||||
if (!$latest) {
|
||||
return ['has_update' => false];
|
||||
}
|
||||
|
||||
// 版本号比较
|
||||
if (version_compare($latest['version_no'], $currentVersion) > 0) {
|
||||
// 检查是否满足最低版本要求
|
||||
if ($latest['min_version'] && version_compare($currentVersion, $latest['min_version']) < 0) {
|
||||
return [
|
||||
'has_update' => false,
|
||||
'error' => '当前版本过低,请先更新到' . $latest['min_version'] . '版本'
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'has_update' => true,
|
||||
'is_force' => $latest['is_force'],
|
||||
'version_info' => $latest
|
||||
];
|
||||
}
|
||||
|
||||
return ['has_update' => false];
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查版本权限
|
||||
* @param int $versionId 版本ID
|
||||
* @param int $targetId 目标ID
|
||||
* @param string $targetType 目标类型
|
||||
* @return bool
|
||||
*/
|
||||
public function checkVersionPermission($versionId, $targetId, $targetType)
|
||||
{
|
||||
$control = \think\facade\Db::name('version_control')
|
||||
->where([
|
||||
['version_id', '=', $versionId],
|
||||
['target_id', '=', $targetId],
|
||||
['target_type', '=', $targetType],
|
||||
['expire_time', '>', date('Y-m-d H:i:s')]
|
||||
])
|
||||
->find();
|
||||
|
||||
if (!$control) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $control['control_type'] === 'white_list';
|
||||
}
|
||||
}
|
||||
@@ -11,224 +11,234 @@
|
||||
{/block}
|
||||
|
||||
{block name="content"}
|
||||
<!--{notempty name='issuper'}-->
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('运行模式')}</b>( {:lang('仅超级管理员可配置')} )
|
||||
</span>
|
||||
</div>
|
||||
<form onsubmit="return false;" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-btn-group shadow-mini nowrap">
|
||||
<!--{if $app->isDebug()}-->
|
||||
<a class="layui-btn layui-btn-sm layui-btn-active">{:lang('以开发模式运行')}</a>
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary" data-confirm="{:lang('确定要切换到生产模式运行吗?')}" data-load="{:url('admin/api.system/debug')}?state=1">{:lang('以生产模式运行')}</a>
|
||||
<!--{else}-->
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary" data-confirm="{:lang('确定要切换到开发模式运行吗?')}" data-load="{:url('admin/api.system/debug')}?state=0">{:lang('以开发模式运行')}</a>
|
||||
<a class="layui-btn layui-btn-sm layui-btn-active">{:lang('以生产模式运行')}</a>
|
||||
<!--{/if}-->
|
||||
</div>
|
||||
<div class="margin-top-20">
|
||||
<p><b>{:lang('开发模式')}</b>:{:lang('开发人员或在功能调试时使用,系统异常时会显示详细的错误信息,同时还会记录操作日志及数据库 SQL 语句信息。')}</p>
|
||||
<p><b>{:lang('生产模式')}</b>:{:lang('项目正式部署上线后使用,系统异常时统一显示 “%s”,只记录重要的异常日志信息,强烈推荐上线后使用此模式。',[config('app.error_message')])}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('富编辑器')}</b>( {:lang('仅超级管理员可配置')} )
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body layui-clear">
|
||||
<div class="layui-btn-group shadow-mini">
|
||||
{if !in_array(sysconf('base.editor'),['ckeditor4','ckeditor5','wangEditor','auto'])}{php}sysconf('base.editor','ckeditor4');{/php}{/if}
|
||||
{foreach ['ckeditor4'=>'CKEditor4','ckeditor5'=>'CKEditor5','wangEditor'=>'wangEditor','auto'=>lang('自适应模式')] as $k => $v}{if sysconf('base.editor') eq $k}
|
||||
{if auth('storage')}<a data-title="配置{$v}" class="layui-btn layui-btn-sm layui-btn-active">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-active">{$v}</a>{/if}
|
||||
{else}
|
||||
{if auth('storage')}<a data-title="配置{$v}" data-action="{:url('admin/api.system/editor')}" data-value="editor#{$k}" class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{/if}
|
||||
{/if}{/foreach}
|
||||
</div>
|
||||
<div class="margin-top-20 full-width pull-left">
|
||||
<p><b>CKEditor4</b>:{:lang('旧版本编辑器,对浏览器兼容较好,但内容编辑体验稍有不足。')}</p>
|
||||
<p><b>CKEditor5</b>:{:lang('新版本编辑器,只支持新特性浏览器,对内容编辑体验较好,推荐使用。')}</p>
|
||||
<p><b>wangEditor</b>:{:lang('国产优质富文本编辑器,对于小程序及App内容支持会更友好,推荐使用。')}</p>
|
||||
<p><b>{:lang('自适应模式')}</b>:{:lang('优先使用新版本编辑器,若浏览器不支持新版本时自动降级为旧版本编辑器。')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--{/notempty}-->
|
||||
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('存储引擎')}</b>( {:lang('文件默认存储方式')} )
|
||||
</span>
|
||||
</div>
|
||||
<!-- 初始化存储配置 -->
|
||||
{if !sysconf('storage.type')}{php}sysconf('storage.type','local');{/php}{/if}
|
||||
{if !sysconf('storage.link_type')}{php}sysconf('storage.link_type','none');{/php}{/if}
|
||||
{if !sysconf('storage.name_type')}{php}sysconf('storage.name_type','xmd5');{/php}{/if}
|
||||
{if !sysconf('storage.allow_exts')}{php}sysconf('storage.allow_exts','doc,gif,ico,jpg,mp3,mp4,p12,pem,png,rar,xls,xlsx');{/php}{/if}
|
||||
{if !sysconf('storage.local_http_protocol')}{php}sysconf('storage.local_http_protocol','follow');{/php}{/if}
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-btn-group shadow-mini nowrap">
|
||||
{foreach $files as $k => $v}{if sysconf('storage.type') eq $k}
|
||||
{if auth('storage')}<a data-title="配置{$v}" data-modal="{:url('storage')}?type={$k}" class="layui-btn layui-btn-sm layui-btn-active">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-active">{$v}</a>{/if}
|
||||
{else}
|
||||
{if auth('storage')}<a data-title="配置{$v}" data-modal="{:url('storage')}?type={$k}" class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{/if}
|
||||
{/if}{/foreach}
|
||||
</div>
|
||||
<div class="margin-top-20 full-width">
|
||||
<p><b>{:lang('本地服务器存储')}</b>:{:lang('文件上传到本地服务器的 `static/upload` 目录,不支持大文件上传,占用服务器磁盘空间,访问时消耗服务器带宽流量。')}</p>
|
||||
<p><b>{:lang('自建Alist存储')}</b>:{:lang('文件上传到 Alist 存储的服务器或云存储空间,根据服务配置可支持大文件上传,不占用本身服务器空间及服务器带宽流量。')}</p>
|
||||
<p><b>{:lang('七牛云对象存储')}</b>:{:lang('文件上传到七牛云存储空间,支持大文件上传,不占用服务器空间及服务器带宽流量,支持 CDN 加速访问,访问量大时推荐使用。')}</p>
|
||||
<p><b>{:lang('又拍云USS存储')}</b>:{:lang('文件上传到又拍云 USS 存储空间,支持大文件上传,不占用服务器空间及服务器带宽流量,支持 CDN 加速访问,访问量大时推荐使用。')}</p>
|
||||
<p><b>{:lang('阿里云OSS存储')}</b>:{:lang('文件上传到阿里云 OSS 存储空间,支持大文件上传,不占用服务器空间及服务器带宽流量,支持 CDN 加速访问,访问量大时推荐使用。')}</p>
|
||||
<p><b>{:lang('腾讯云COS存储')}</b>:{:lang('文件上传到腾讯云 COS 存储空间,支持大文件上传,不占用服务器空间及服务器带宽流量,支持 CDN 加速访问,访问量大时推荐使用。')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('系统参数')}</b>( {:lang('当前系统配置参数')} )
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('网站名称')}</b>Website</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('site_name')}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('site_name')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">{:lang('网站名称及网站图标,将显示在浏览器的标签上。')}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('管理程序名称')}</b>Name</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('app_name')}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('app_name')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">{:lang('管理程序名称,将显示在后台左上角标题。')}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('管理程序版本')}</b>Version</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('app_version')}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('app_version')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">{:lang('管理程序版本,将显示在后台左上角标题。')}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('公安备案号')}</b>Beian</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('beian')?:'-'}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('beian')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<p class="help-block">
|
||||
{:lang('公安备案号,可以在 %s 查询获取,将在登录页面下面显示。',['<a target="_blank" href="https://www.beian.gov.cn/portal/registerSystemInfo">www.beian.gov.cn</a>'])}
|
||||
</p>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('网站备案号')}</b>Miitbeian</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('miitbeian')?:'-'}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('miitbeian')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">
|
||||
{:lang('网站备案号,可以在 %s 查询获取,将显示在登录页面下面。',['<a target="_blank" href="https://beian.miit.gov.cn">beian.miit.gov.cn</a>'])}
|
||||
|
||||
|
||||
<!--{notempty name='issuper'}-->
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('运行模式')}</b>( {:lang('仅超级管理员可配置')} )
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-btn-group shadow-mini nowrap">
|
||||
<!--{if $app->isDebug()}-->
|
||||
<a class="layui-btn layui-btn-sm layui-btn-active">{:lang('以开发模式运行')}</a>
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary" data-confirm="{:lang('确定要切换到生产模式运行吗?')}" data-load="{:url('admin/api.system/debug')}?state=1">{:lang('以生产模式运行')}</a>
|
||||
<!--{else}-->
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary" data-confirm="{:lang('确定要切换到开发模式运行吗?')}" data-load="{:url('admin/api.system/debug')}?state=0">{:lang('以开发模式运行')}</a>
|
||||
<a class="layui-btn layui-btn-sm layui-btn-active">{:lang('以生产模式运行')}</a>
|
||||
<!--{/if}-->
|
||||
</div>
|
||||
<div class="margin-top-20">
|
||||
<p><b>{:lang('开发模式')}</b>:{:lang('开发人员或在功能调试时使用,系统异常时会显示详细的错误信息,同时还会记录操作日志及数据库 SQL 语句信息。')}</p>
|
||||
<p><b>{:lang('生产模式')}</b>:{:lang('项目正式部署上线后使用,系统异常时统一显示 "%s",只记录重要的异常日志信息,强烈推荐上线后使用此模式。',[config('app.error_message')])}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('网站版权信息')}</b>Copyright</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('site_copy')}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('site_copy')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">{:lang('网站版权信息,在后台登录页面显示版本信息并链接到备案到信息备案管理系统。')}</div>
|
||||
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('富编辑器')}</b>( {:lang('仅超级管理员可配置')} )
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body layui-clear">
|
||||
<div class="layui-btn-group shadow-mini">
|
||||
{if !in_array(sysconf('base.editor'),['ckeditor4','ckeditor5','wangEditor','auto'])}{php}sysconf('base.editor','ckeditor4');{/php}{/if}
|
||||
{foreach ['ckeditor4'=>'CKEditor4','ckeditor5'=>'CKEditor5','wangEditor'=>'wangEditor','auto'=>lang('自适应模式')] as $k => $v}{if sysconf('base.editor') eq $k}
|
||||
{if auth('storage')}<a data-title="配置{$v}" class="layui-btn layui-btn-sm layui-btn-active">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-active">{$v}</a>{/if}
|
||||
{else}
|
||||
{if auth('storage')}<a data-title="配置{$v}" data-action="{:url('admin/api.system/editor')}" data-value="editor#{$k}" class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{/if}
|
||||
{/if}{/foreach}
|
||||
</div>
|
||||
<div class="margin-top-20 full-width pull-left">
|
||||
<p><b>CKEditor4</b>:{:lang('旧版本编辑器,对浏览器兼容较好,但内容编辑体验稍有不足。')}</p>
|
||||
<p><b>CKEditor5</b>:{:lang('新版本编辑器,只支持新特性浏览器,对内容编辑体验较好,推荐使用。')}</p>
|
||||
<p><b>wangEditor</b>:{:lang('国产优质富文本编辑器,对于小程序及App内容支持会更友好,推荐使用。')}</p>
|
||||
<p><b>{:lang('自适应模式')}</b>:{:lang('优先使用新版本编辑器,若浏览器不支持新版本时自动降级为旧版本编辑器。')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--{/notempty}-->
|
||||
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('存储引擎')}</b>( {:lang('文件默认存储方式')} )
|
||||
</span>
|
||||
</div>
|
||||
<!-- 初始化存储配置 -->
|
||||
{if !sysconf('storage.type')}{php}sysconf('storage.type','local');{/php}{/if}
|
||||
{if !sysconf('storage.link_type')}{php}sysconf('storage.link_type','none');{/php}{/if}
|
||||
{if !sysconf('storage.name_type')}{php}sysconf('storage.name_type','xmd5');{/php}{/if}
|
||||
{if !sysconf('storage.allow_exts')}{php}sysconf('storage.allow_exts','doc,gif,ico,jpg,mp3,mp4,p12,pem,png,rar,xls,xlsx');{/php}{/if}
|
||||
{if !sysconf('storage.local_http_protocol')}{php}sysconf('storage.local_http_protocol','follow');{/php}{/if}
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-btn-group shadow-mini nowrap">
|
||||
{foreach $files as $k => $v}{if sysconf('storage.type') eq $k}
|
||||
{if auth('storage')}<a data-title="配置{$v}" data-modal="{:url('storage')}?type={$k}" class="layui-btn layui-btn-sm layui-btn-active">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-active">{$v}</a>{/if}
|
||||
{else}
|
||||
{if auth('storage')}<a data-title="配置{$v}" data-modal="{:url('storage')}?type={$k}" class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{/if}
|
||||
{/if}{/foreach}
|
||||
</div>
|
||||
<div class="margin-top-20 full-width">
|
||||
<p><b>{:lang('本地服务器存储')}</b>:{:lang('文件上传到本地服务器的 `static/upload` 目录,不支持大文件上传,占用服务器磁盘空间,访问时消耗服务器带宽流量。')}</p>
|
||||
<p><b>{:lang('自建Alist存储')}</b>:{:lang('文件上传到 Alist 存储的服务器或云存储空间,根据服务配置可支持大文件上传,不占用本身服务器空间及服务器带宽流量。')}</p>
|
||||
<p><b>{:lang('七牛云对象存储')}</b>:{:lang('文件上传到七牛云存储空间,支持大文件上传,不占用服务器空间及服务器带宽流量,支持 CDN 加速访问,访问量大时推荐使用。')}</p>
|
||||
<p><b>{:lang('又拍云USS存储')}</b>:{:lang('文件上传到又拍云 USS 存储空间,支持大文件上传,不占用服务器空间及服务器带宽流量,支持 CDN 加速访问,访问量大时推荐使用。')}</p>
|
||||
<p><b>{:lang('阿里云OSS存储')}</b>:{:lang('文件上传到阿里云 OSS 存储空间,支持大文件上传,不占用服务器空间及服务器带宽流量,支持 CDN 加速访问,访问量大时推荐使用。')}</p>
|
||||
<p><b>{:lang('腾讯云COS存储')}</b>:{:lang('文件上传到腾讯云 COS 存储空间,支持大文件上传,不占用服务器空间及服务器带宽流量,支持 CDN 加速访问,访问量大时推荐使用。')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('系统参数')}</b>( {:lang('当前系统配置参数')} )
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('网站名称')}</b>Website</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('site_name')}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('site_name')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">{:lang('网站名称及网站图标,将显示在浏览器的标签上。')}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('管理程序名称')}</b>Name</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('app_name')}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('app_name')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">{:lang('管理程序名称,将显示在后台左上角标题。')}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('管理程序版本')}</b>Version</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('app_version')}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('app_version')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">{:lang('管理程序版本,将显示在后台左上角标题。')}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('公安备案号')}</b>Beian</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('beian')?:'-'}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('beian')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<p class="help-block">
|
||||
{:lang('公安备案号,可以在 %s 查询获取,将在登录页面下面显示。',['<a target="_blank" href="https://www.beian.gov.cn/portal/registerSystemInfo">www.beian.gov.cn</a>'])}
|
||||
</p>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('网站备案号')}</b>Miitbeian</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('miitbeian')?:'-'}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('miitbeian')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">
|
||||
{:lang('网站备案号,可以在 %s 查询获取,将显示在登录页面下面。',['<a target="_blank" href="https://beian.miit.gov.cn">beian.miit.gov.cn</a>'])}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="help-label"><b>{:lang('网站版权信息')}</b>Copyright</div>
|
||||
<label class="relative block">
|
||||
<input readonly value="{:sysconf('site_copy')}" class="layui-input layui-bg-gray">
|
||||
<a data-copy="{:sysconf('site_copy')}" class="layui-icon layui-icon-release input-right-icon"></a>
|
||||
</label>
|
||||
<div class="help-block">{:lang('网站版权信息,在后台登录页面显示版本信息并链接到备案到信息备案管理系统。')}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--{if $app->isDebug()}-->
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('系统信息')}</b>( {:lang('仅开发模式可见')} )
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table" lay-even>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('核心框架')}</th>
|
||||
<td><a target="_blank" href="https://www.thinkphp.cn">ThinkPHP Version {$framework.version|default='None'}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('平台框架')}</th>
|
||||
<td><a target="_blank" href="https://thinkadmin.top">ThinkAdmin Version {$thinkadmin.version|default='6.0.0'}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('操作系统')}</th>
|
||||
<td>{:php_uname()}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('运行环境')}</th>
|
||||
<td>{:ucfirst($request->server('SERVER_SOFTWARE',php_sapi_name()))} & PHP {$Think.const.PHP_VERSION} & {:ucfirst(app()->db->connect()->getConfig('type'))}</td>
|
||||
</tr>
|
||||
<!-- {notempty name='systemid'} -->
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('系统序号')}</th>
|
||||
<td>{$systemid|default=''}</td>
|
||||
</tr>
|
||||
<!-- {/notempty} -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{notempty name='plugins'}
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('应用插件')}</b>( {:lang('仅开发模式可见')} )
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table" lay-even>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('应用名称')}</th>
|
||||
<th class="nowrap text-center">{:lang('插件名称')}</th>
|
||||
<th class="nowrap text-left">{:lang('插件包名')}</th>
|
||||
<th class="nowrap text-center">{:lang('插件版本')}</th>
|
||||
<th class="nowrap text-center">{:lang('授权协议')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $plugins as $key=>$plugin}
|
||||
<tr>
|
||||
<td class="nowrap text-center">{$key}</td>
|
||||
<td class="nowrap text-center">{$plugin.name|lang}</td>
|
||||
<td class="nowrap text-left">
|
||||
{if empty($plugin.install.document)}{$plugin.package}
|
||||
{else}<a target="_blank" href="{$plugin.install.document}">{$plugin.package}</a>{/if}
|
||||
</td>
|
||||
<td class="nowrap text-center">{$plugin.install.version|default='unknow'}</td>
|
||||
<td class="nowrap text-center">
|
||||
{if empty($plugin.install.license)} -
|
||||
{elseif is_array($plugin.install.license)}{$plugin.install.license|join='、',###}
|
||||
{else}{$plugin.install.license|default='-'}{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!--{/if}-->
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="layui-form-item text-center">
|
||||
<button class="layui-btn" type="submit">保存配置</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--{if $app->isDebug()}-->
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('系统信息')}</b>( {:lang('仅开发模式可见')} )
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table" lay-even>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('核心框架')}</th>
|
||||
<td><a target="_blank" href="https://www.thinkphp.cn">ThinkPHP Version {$framework.version|default='None'}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('平台框架')}</th>
|
||||
<td><a target="_blank" href="https://thinkadmin.top">ThinkAdmin Version {$thinkadmin.version|default='6.0.0'}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('操作系统')}</th>
|
||||
<td>{:php_uname()}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('运行环境')}</th>
|
||||
<td>{:ucfirst($request->server('SERVER_SOFTWARE',php_sapi_name()))} & PHP {$Think.const.PHP_VERSION} & {:ucfirst(app()->db->connect()->getConfig('type'))}</td>
|
||||
</tr>
|
||||
<!-- {notempty name='systemid'} -->
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('系统序号')}</th>
|
||||
<td>{$systemid|default=''}</td>
|
||||
</tr>
|
||||
<!-- {/notempty} -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{notempty name='plugins'}
|
||||
<div class="layui-card padding-20 shadow">
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="help-label">
|
||||
<b style="color:#333!important;">{:lang('应用插件')}</b>( {:lang('仅开发模式可见')} )
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table" lay-even>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nowrap text-center">{:lang('应用名称')}</th>
|
||||
<th class="nowrap text-center">{:lang('插件名称')}</th>
|
||||
<th class="nowrap text-left">{:lang('插件包名')}</th>
|
||||
<th class="nowrap text-center">{:lang('插件版本')}</th>
|
||||
<th class="nowrap text-center">{:lang('授权协议')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $plugins as $key=>$plugin}
|
||||
<tr>
|
||||
<td class="nowrap text-center">{$key}</td>
|
||||
<td class="nowrap text-center">{$plugin.name|lang}</td>
|
||||
<td class="nowrap text-left">
|
||||
{if empty($plugin.install.document)}{$plugin.package}
|
||||
{else}<a target="_blank" href="{$plugin.install.document}">{$plugin.package}</a>{/if}
|
||||
</td>
|
||||
<td class="nowrap text-center">{$plugin.install.version|default='unknow'}</td>
|
||||
<td class="nowrap text-center">
|
||||
{if empty($plugin.install.license)} -
|
||||
{elseif is_array($plugin.install.license)}{$plugin.install.license|join='、',###}
|
||||
{else}{$plugin.install.license|default='-'}{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/notempty}
|
||||
<!--{/if}-->
|
||||
</form>
|
||||
{/block}
|
||||
@@ -99,6 +99,20 @@
|
||||
<input name="site_copy" required placeholder="请输入版权信息" vali-name="版权信息" value="{:sysconf('site_copy')}" class="layui-input">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="layui-form-item margin-bottom-5">
|
||||
<div class="help-label label-required-prev"><b>站点域名</b></div>
|
||||
<label class="relative block label-required-null">
|
||||
<input name="base.site_domain" required placeholder="请输入站点域名" value="{:sysconf('base.site_domain')}" class="layui-input">
|
||||
|
||||
</label>
|
||||
<div class="help-block sub-span-blue">
|
||||
请设置站点访问域名,例如:https://www.example.com
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-xs12 help-block padding-top-0">
|
||||
网站备案号和公安备案号可以在<a target="_blank" href="https://beian.miit.gov.cn">备案管理中心</a>查询并获取,网站上线时必需配置备案号,备案号会链接到信息备案管理系统 ~
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user