xccjk / x-blog

学习笔记
17 stars 2 forks source link

报错 #84

Open xccjk opened 1 year ago

xccjk commented 1 year ago

curl: (28) Failed to connect to github.com port 443: Operation timed out

在https://www.ipaddress.com输入443的网站,获取域名对应IP

编辑电脑hosts文件:

140.82.112.3 github.com 
xccjk commented 1 year ago

火狐浏览器中jquery发起ajax请求报错

<button class="btn" id="pass">批量通过</button>

问题原因:火狐浏览器中,button按钮默认类型为submit,回已form表单的形式提交。通过指定type为button即可

<button class="btn" type="button" id="pass">批量通过</button> 
xccjk commented 10 months ago

React 使用yield,报错uncaught at check call: argument [object Promise] is not a function

错误的使用方式:

*goods({ payload }, { call, put }) {
      const {  key } = payload;
      const response = yield call(move(key));
      yield put({
        type: 'save',
        payload: { goods: response },
      });
},

正确的方式:

*goods({ payload }, { call, put }) {
      const {  key } = payload;
      const response = yield call(move, key);
      yield put({
        type: 'save',
        payload: { goods: response },
      });
},
xccjk commented 5 months ago

axios catch拦截的错误非json格式,Request failed with status code 500

添加axios全局拦截,return Promise.reject(error.response)

axios.interceptors.response.use((response) => {
  return response;
}, (error) => {
  return Promise.reject(error.response);
});
xccjk commented 1 week ago

brew 安装应用报错 homebrew-core is a shallow clone

Error:
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow

解决方法:先删除对应包,然后重新拉代码

cd /usr/local/Homebrew/Library/Taps/homebrew/
rm -rf homebrew-core
git clone https://github.com/Homebrew/homebrew-core.git