url优化

This commit is contained in:
gongfuxiang 2019-04-01 22:41:59 +08:00
parent a374d1a07f
commit c02fee2657
2 changed files with 13 additions and 1 deletions

View File

@ -261,6 +261,12 @@ function PluginsHomeUrl($plugins_name, $plugins_control, $plugins_action, $param
$url = str_replace('public/', '', $url);
}
// tp框架url方法是否识别到https
if(__MY_HTTP__ == 'https' && substr($url, 0, 5) != 'https')
{
$url = 'https'.mb_substr($url, 4, null, 'utf-8');
}
return $url;
}
@ -291,6 +297,12 @@ function PluginsAdminUrl($plugins_name, $plugins_control, $plugins_action, $para
$url = str_replace('public/', '', $url);
}
// tp框架url方法是否识别到https
if(__MY_HTTP__ == 'https' && substr($url, 0, 5) != 'https')
{
$url = 'https'.mb_substr($url, 4, null, 'utf-8');
}
return $url;
}

View File

@ -231,7 +231,7 @@ class Weixin
'mch_id' => $this->config['mch_id'],
'body' => $params['site_name'].'-'.$params['name'],
'nonce_str' => md5(time().rand().$params['order_no']),
'notify_url' => str_replace('https', 'http', $params['notify_url']),
'notify_url' => (__MY_HTTP__ == 'https') ? 'https'.mb_substr($params['notify_url'], 4, null, 'utf-8') : $params['notify_url'],
'openid' => ($trade_type == 'JSAPI') ? $params['user']['weixin_openid'] : '',
'out_trade_no' => $params['order_no'].GetNumberCode(6),
'spbill_create_ip' => GetClientIP(),