前端

165 阅读1分钟

ip地址查询 ipconfig/all

git常用命令:

git clone 复制
git pull 导入
git status 状态
git add 添加
git commit 提交
git push 推送
git push -f origin master 强制推送
git checkout master 跳到主分支
git restore --staged . 撤销所有
cmd移除文件
rd/s/q C:\XXX文件夹 强制删除:del /F /S /Q
excel导入
需要安装xlsl npm i xlsl -S
export function exportInExcel (file) {
  return new Promise(function(resolve, reject) {
    const reader = new FileReader();
    reader.onload = function(e) {
      const data = e.target.result;
      this.wb = Xlsx.read(data, {
        type: "binary"
      });
      const result = [];
      this.wb.SheetNames.forEach(sheetName => {

        result.push({
          sheetName: sheetName,
          sheet: Xlsx.utils.sheet_to_json(this.wb.Sheets[sheetName])
        })
      })
      resolve(result);
    }
    reader.readAsBinaryString(file.raw);
  })
  
}
excel导出
async exportExcel() {
      request
        .get(`/api/examproject/export`, {
          data: {},
          headers: {
            "Content-Type": "application/json",
            charset: "utf-8",
          },
          responseType: "blob",
        })
        .then((response) => {
          let blob = new Blob([response.data], {
            type: "application/vnd.ms-excel",
          });
          let fileName = Date.parse(new Date()) + ".xlsx";
          if (window.navigator.msSaveOrOpenBlob) {
            navigator.msSaveBlob(blob, fileName);
          } else {
            var link = document.createElement("a");
            link.href = window.URL.createObjectURL(blob);
            link.download = fileName;
            link.click();
            window.URL.revokeObjectURL(link.href);
          }
        });
    }
    
 小程序版本更新
 onShow: function(options) {
        console.log('App Show');
        uni.setStorageSync('scene',options.scene)
        const updateManager=uni.getUpdateManager();    // 获取更新管理器对象
        updateManager.onCheckForUpdate(function(res){
            if(res.hasUpdate){
                updateManager.onUpdateReady(function(){
                    uni.showModal({
                        title:'更新提示',
                        content:'新版本已经准备好,点击确定重新启动',
                        showCancel:false,
                        success:res=>{
                            if(res.confirm){
                                updateManager.applyUpdate();
                            }
                        }
                    })
                })
                updateManager.onUpdateFailed(function(){
                    uni.showModal({
                        title:'提示',
                        content:'检查到有新版本,但是下载失败,请检查网络设置',
                        showCancel:false
                    })
                })
            }
        })
    },
    git问题
    1error: failed to push some refs to 'https://gitee.com/_jianjian/safecontrol-front.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...')
    第一步:git pull --rebase origin master命令README.md拉到本地
    第二步:git push origin master