Git Product home page Git Product logo

project's Introduction

我爱学习,学习使我快乐

git日常操作

  • 克隆仓库:git clone [email protected]:jasonandjay/project.git
  • 拉取代码:git pull origin master
  • 新建分支:git branch chenmanjie
  • 删除分支:git branch -d chenmanjie
  • 切换分支:git checkout chenmanjie
  • 推送远程:git push origin master
  • 查看提交记录:git log
  • 回滚代码: git reset --hard [commit:6]
  • 回滚文件: git checkout -- filepath
  • 回到最新代码:git reset HEAD | git pull origin master
  • 隐藏当前分支改动: git stash
  • 回退隐藏:git stash pop
  • 合并分支:git merge chenmanjie
  • 会用PR给他人仓库贡献代码

linux日常操作

  • 善用tab健,帮我们补全命令和路径
  • 切换文件夹: cd
  • 查看当前路径:pwd
  • 查看当前文件夹下的文件: ls+ll
  • 创建文件夹:mkdir
  • 移动文件:mv
  • 复制文件:cp
  • 删除文件及文件夹:rm -rf(禁止使用)
  • 编辑文件:vim
  • 查看历史命令:history

vue项目部署到服务器上,服务器使用nginx

简单版 模板为:webpack-simple

  • 注释掉.gitignore里的dist,既在dist前面加个#号
  • 修改index.html里/dist/build.js为相对路径,在/dist前面加个.
  • 修改webpack.config.js里的publickPath为相对路径,在/dist前面加个.

复杂版 模板为:webpack

  • 注释掉.gitignore里的dist,既在dist前面加个#号
  • 修改config/index.js里的build/assetsPublicPath为相对路径,在/前面加个.

遇到404,修改文件夹的权限

  • chmod 666 -R dir

启动一些线上服务

短信验证码服务

服务器配置

nginx虚拟域名配置

  • vim /etc/nginx/sites-available/default

配置push钩子,自动化部署代码

配置邮件服务器,在push钩子里触发,自动通知收件人

线上公用接口

文件上传

<input type="file">
支持文件上传,用post方式提交formData对象,键为文件名,值为文件
eg:
var ele = document.querySelector('input');
ele.onchange = function(e){
    console.log('e...', e);
    let files = e.target.files;
    // 创建一个formData
    let form = new FormData();
    for (let i=0,len=files.length; i<len;i++){
        console.log(files[i].name);
        form.append(files[i].name, files[i]);
    }

    axios({
        method: 'post',
        url: 'http://123.206.55.50:11000/upload',
        data: form
    }).then(body=>{
        console.log('body...', body);
    }).catch(e=>{
        console.log('e..', e);
    })
}
<input type="file">
var ele = document.querySelector('input');
ele.onchange = function(e){
    let files = e.target.files;
    var reader = new FileReader();
    reader.onload = function(){
        console.log('result...', this.result);
        axios({
            method: 'post',
            url: 'http://123.206.55.50:11000/upload_base64',
            data: {base64: this.result}
        }).then(body=>{
            console.log('body...', body);
        }).catch(e=>{
            console.log('e..', e);
        })
    }
    reader.readAsDataURL(files[0]);
}
axios({
    method: 'post',
    url: 'http://123.206.55.50:11000/tobase64',
    data: {url: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3360034032,4096528553&fm=26&gp=0.jpg'}
}).then(body=>{
    console.log('body...', body);
}).catch(e=>{
    console.log('e..', e);
})

get请求转发

短信验证码接口

post phone='your phone'

project's People

Contributors

jasonandjay avatar dragon-chinese avatar a664008111 avatar lmm19940910 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.