Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

锚点动画报错 #9

Open
DaveCherish opened this issue Nov 30, 2022 · 0 comments
Open

锚点动画报错 #9

DaveCherish opened this issue Nov 30, 2022 · 0 comments

Comments

@DaveCherish
Copy link

点击右侧链接定位锚点js报错,且无动画
image

附修复代码:
/** * 解决问题:锚点动画报错 * 现象:点击右侧链接定位锚点js报错,且无动画 * 原因:当url进行base64_encode后,字符中包含:!"#$%&'()*+,./:;<=>?@[\]^{|}~
* 解决方案:将以上字符替换成空
* /
public function doBase64Encode($url)
{
$replaceChars = ['!', '"', '#', '$', '%', '&', "'", '(', ')', '
', '+', ',', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\', ']', '^', '', '{', '|', '}', '~']; return str_replace($replaceChars, '', base64_encode($url)); }

ApiDoc.php中原来使用base64_encode(url); 的两处代码改为:$this->doBase64Encode(url);
@mumbaicat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant