Code Monkey home page Code Monkey logo

wxphotos's Introduction

多彩画册

微信相册小程序 - 《多彩画册》

小程序学习之作,代码比较糙!后台使用 NodeJs + MongoDB + Nginx,源码在文件夹server内!

后台服务

图片的上传使用了 又拍云的服务,图片存储在云端

//文件 routes/login.js 

//获取 session_key 和 openid ;appid 和secret 请替换为自己的
const getWXID = (code)=>{
  return new Promise((resolve, reject)=>{
    request('https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code='+code+'&grant_type=authorization_code',(error, response, body)=>{
      error ? reject(error) : resolve(JSON.parse(body));
    });
  });
};


//文件 routes/getSignature.js 又拍云的账号,请参考又拍云api

router.post('/getSignature',(ctx, next) => {
  if(ctx.request.body.data){
    const signature = base64Sha1(ctx.request.body.data, md5('自己的密码'));
    ctx.body = {code:'succeed',signature:signature};
  }else{
    ctx.body = {code:'failed',message:'参数不正确!'};
  }
});

主要功能

  • 1.照片上传
  • 2.照片管理 (删除,更改,设置公开或私密)
  • 3.评论 (可评论他人,仅支持一层评论)
  • 4.关注,点赞
  • 5.评论
  • 6.发私信 (简单的留言功能)
  • 7.查看粉丝,查看关注

Demo

多彩画册

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.