From d3cede4dff8c321efa6d368df6cdc98d5af82f8c Mon Sep 17 00:00:00 2001 From: xiaoz Date: Wed, 16 Dec 2020 17:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E7=BD=91?= =?UTF-8?q?=E7=AB=99=E5=9B=BE=E6=A0=87=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/index.php | 14 ++++++++++++++ templates/default/index.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/controller/index.php b/controller/index.php index 5f4c4ce..7e4f818 100644 --- a/controller/index.php +++ b/controller/index.php @@ -76,6 +76,20 @@ function is_login(){ return false; } } +//将URL转换为base64编码 +function base64($url){ + $urls = parse_url($url); + + //获取请求协议 + $scheme = empty( $urls['scheme'] ) ? 'http://' : $urls['scheme'].'://'; + //获取主机名 + $host = $urls['host']; + //获取端口 + $port = empty( $urls['port'] ) ? '' : ':'.$urls['port']; + + $new_url = $scheme.$host.$port; + return base64_encode($new_url); +} // 载入前台首页模板 require('templates/'.TEMPLATE.'/index.php'); ?> \ No newline at end of file diff --git a/templates/default/index.php b/templates/default/index.php index cab64c5..b4c227d 100644 --- a/templates/default/index.php +++ b/templates/default/index.php @@ -166,7 +166,7 @@
- HUAN + HUAN