The Web framework beyond your dreams

Use the full ES6/7 features to develop Node.js applications

Getting Started

Check out the latest developments in the GitHub repo

Use ES6/7 features to develop Node.js applications

//user controller, home/controller/user.js
export default class extends think.controller.base {
  //login action
  async loginAction(){
    if(this.isGet()){
      return this.display();
    }
    //data is validated in logic
    let data = this.post();
    let md5 = think.md5('think_' + data.pwd);
    let result = await this.model('user').where({name: data.name, pwd: md5}).find();
    if(think.isEmpty(result)){
      return this.fail('login fail');
    }
    //set userInfo to session
    await this.session('userInfo', result);
    return this.success();
  }
}

FEATURES