- 下载SQLiteSpy:
http://xz.w10a.com/Small/SQLiteSpyzwb.rar - 用它打开:\showdoc\Sqlite\showdoc.db.php
- 参考下图
- 定位至“1”处;
- 键入以下命令(红字为原始内容,绿字为替换后的内容)
- 按F9。
update page set page_content = replace(page_content,"192.168.0.111","192.168.X.201");
update upload_file set real_url= replace(real_url,"192.168.0.111","192.168.X.201");
提示:
- 编辑之前请备份db.php文件
- 如需更为相对路径,请参考
update page set page_content = replace(page_content,"http://192.168.0.111","");
update upload_file set real_url= replace(real_url,"http://192.168.0.111",""); - 引号需要是双引号
- 如有多个IP地址或URL,可替换多次
- 如果想一劳永逸,以后上传的图片都自动保存为相对路径,可参考(该办法可能已过时):
把\showdoc\server\Application\Api\Controller目录下的:PageController.class.php文件232行:
$url = get_domain().__ROOT__.substr($upload->rootPath,1).$info['editormd-image-file']['savepath'].$info['editormd-image-file']['savename'] ;
https://blog.csdn.net/qq_28537477/article/details/126706482