mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 19:12:48 +08:00
优化链接拼接
This commit is contained in:
@@ -72,11 +72,15 @@ function get_system_config($name = '', $default = '')
|
|||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_source_link($url)
|
function get_source_link($url,$default = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
if (empty($url)) {
|
if (empty($url)) {
|
||||||
$url = '/static/images/avatar.png';
|
|
||||||
|
if(!empty($default)){
|
||||||
|
$url = $default;
|
||||||
|
}else{
|
||||||
|
$url = '/static/images/avatar.png';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (strpos($url, '/') === 0) {
|
if (strpos($url, '/') === 0) {
|
||||||
return request()->domain() . $url;
|
return request()->domain() . $url;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Nav extends Model
|
|||||||
//
|
//
|
||||||
public function getImgAttr($value)
|
public function getImgAttr($value)
|
||||||
{
|
{
|
||||||
return get_source_link($value);
|
return get_source_link($value,'/static/images/noimg.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStatusNameAttr()
|
public function getStatusNameAttr()
|
||||||
|
|||||||
Reference in New Issue
Block a user