添加域名前缀限制

master
ELF 4 years ago
parent c339623c78
commit ef8334dd18

@ -1156,6 +1156,12 @@ class PromoteCompanyController extends ThinkController
if ($save['site_domain_prefix'] == '') { if ($save['site_domain_prefix'] == '') {
$this->error('请输入推广后台域名前缀'); $this->error('请输入推广后台域名前缀');
} }
if (strlen($save['site_domain_prefix']) > 6) {
$this->error('域名前缀不能超过6个字符');
}
if (!preg_match('/^[a-z0-9]+$/', $save['site_domain_prefix'])) {
$this->error('域名前缀只能由小写字母和数字组成');
}
if ($save['site_config']['icon'] == '') { if ($save['site_config']['icon'] == '') {
$this->error('请上传推广后台ICON'); $this->error('请上传推广后台ICON');
} }

@ -378,7 +378,7 @@
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>推广后台域名前缀:</td> <td class="l"><i class="mustmark" style="margin-left:-7px">*</i>推广后台域名前缀:</td>
<td class="r" > <td class="r" >
<input type="text" class="txt" style="float: none;" name="site_domain_prefix" value="" placeholder="请输入推广后台域名前缀"> <input type="text" class="txt" style="float: none;" name="site_domain_prefix" value="" placeholder="请输入推广后台域名前缀">
<span class="notice-text" style="float: none;">请确保唯一。完整地址: <span id="site-url-show" style="color: red; font-weight: bold;" data-domain="<?=C('DOMAIN', null, null)?>"></span></span> <span class="notice-text" style="float: none;">请确保唯一只能由小写字母和数字组成不能超过6个字符。完整地址: <span id="site-url-show" style="color: red; font-weight: bold;" data-domain="<?=C('DOMAIN', null, null)?>"></span></span>
</td> </td>
</tr> </tr>

@ -387,7 +387,7 @@
} }
?> ?>
<input type="text" class="txt" style="float: none;" name="site_domain_prefix" value="{$data.site_domain_prefix}" placeholder="请输入推广后台域名前缀"> <input type="text" class="txt" style="float: none;" name="site_domain_prefix" value="{$data.site_domain_prefix}" placeholder="请输入推广后台域名前缀">
<span class="notice-text" style="float: none;">请确保唯一。完整地址: <span id="site-url-show" style="color: red; font-weight: bold;" data-domain="<?=$domain?>"><?=$siteUrl?></span></span> <span class="notice-text" style="float: none;">请确保唯一只能由小写字母和数字组成不能超过6个字符。完整地址: <span id="site-url-show" style="color: red; font-weight: bold;" data-domain="<?=$domain?>"><?=$siteUrl?></span></span>
</td> </td>
</tr> </tr>

Loading…
Cancel
Save