Files
docs/其他/故障解决方案大全.md
2026-01-14 11:27:47 +08:00

3.9 KiB
Raw Permalink Blame History

cors错误

跨域资源共享标准CORScross-origin sharing standard 新增了一组 HTTP首部字段允许服务器声明哪些源站通过浏览器有权限访问哪些资源。另外规范要求对那些可能对服务器数据产生副作用的 HTTP 请求方法特别是 GET 以外的 HTTP 请求,或者搭配某些 MIME 类型的 POST 请求浏览器必须首先使用 OPTIONS 方法发起一个预检请求preflight request从而获知服务端是否允许该跨域请求。服务器确认允许之后才发起实际的 HTTP 请求。在预检请求的返回中服务器端也可以通知客户端是否需要携带身份凭证包括 Cookies和 HTTP 认证相关数据。CORS请求失败会产生错误但是为了安全在JavaScript代码层面是无法获知到底具体是哪里出了问题。你只能查看浏览器的控制台以得知具体是哪里出现了错误。
- 使用下列方法之一: GET HEAD POST
- Fetch 规范定义了对 CORS 安全的首部字段集合,不得人为设置该集合之外的其他首部字段。该集合为:
    1. Accept
    2. Accept-Language
    3. Content-Language
    4. Content-Type (需要注意额外的限制)
    5. DPR
    6. Downlink
    7. Save-Data
    8. Viewport-Width
    9. Width
- Content-Type 的值仅限于下列三者之一:
    1. text/plain
    2. multipart/form-data
    3. application/x-www-form-urlencoded

 1、客户端向服务器发送出错需要客户端指定content-type的值为以上三种之一
 2、客户端接受服务器数据错误需要服务器返回时指定返回头"Access-Control-Allow-Origin": "*"允许跨域(错误原因:本地调试请求远程服务器,出现跨域访问导致)

MySQL解决方案

1045(28000)错误MySQL笔记#^055b1a

PostgreSQL解决方案

postgresql远程连接失败

# ubuntu下12版本出现客户端连接失败:(使用root或postgres用户修改)/etc/postgresql/12/main/
1. 在/etc/postgresql/12/main/postgresql.conf文件中60行左右修改listen_addresses = '*'
1. 在/etc/postgresql/12/main/pg_hba.conf文件中,在ipv4哪行追加一行
host    all             all             0.0.0.0/0               trust

ubuntu解决方案

ubuntu22.04解决centos容器无法用systemctlLinux笔记#^bf399f

centos解决方案

python解决方案

更换pip源

^508e71

  1. Windows更换

    在文件资源管理器输入%appdata%,新建pip文件夹,在文件夹中创建pip.ini配置文件

  2. Linux/Mac更换

    在用户主目录下创建.pip隐藏文件夹,并在文件夹中创建pip.conf配置文件

  3. pip源网址

    阿里云 http://mirrors.aliyun.com/pypi/simple/ 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 华为 https://repo.huaweicloud.com/repository/pypi/simple

  4. 配置文件内容
    [global]
    index-url = https://mirrors.aliyun.com/pypi/simple
    [install]
    use-mirrors = true
    mirrors = https://mirrors.aliyun.com/pypi/simple/
    trusted-host = mirrors.aliyun.com
    
  5. 华为pip加速
[global]
index-url = https://repo.huaweicloud.com/repository/pypi/simple
trusted-host = repo.huaweicloud.com
timeout = 120

windows解决方案

esxi-8.0集成网卡驱动

^4bfd56

VMware ESXi 集成网卡驱动教程 - DIYNAS (diy-nas.cn)

  • 导出iso镜像报错解决方法
    • 方法一
    将python版本升级到3.7.9,不然导出iso时会报错
    
    • 方法二

    Install-Module -Name VMware.PowerCLI -RequiredVersion 12.3.0.17860403

windows更新服务启动失败

^6f79fa

net stop wuauserv
net stop cryptSvc
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 Catroot2.old
net start wuauserv
net start cryptSvc
net start bits
net start msiserver
# 重启电脑