├── .eslintrc ├── www ├── favicon.ico └── static │ ├── bootstrap.min.js │ └── jquery.slim.min.js ├── src ├── logic │ ├── index.js │ ├── base.js │ └── user.js ├── bootstrap │ └── master.js ├── config │ ├── router.js │ ├── extend.js │ ├── middleware.js │ ├── config.js │ └── adapter.js ├── controller │ ├── index.js │ ├── base.js │ └── user.js └── service │ ├── weibo.js │ ├── github.js │ ├── baidu.js │ └── qq.js ├── .dockerignore ├── production.js ├── development.js ├── .editorconfig ├── view ├── inc │ ├── footer.html │ ├── showMsg.html │ └── header.html ├── index_index.html ├── layout.html ├── user_changepassword.html ├── user_index.html ├── user_login.html ├── user_reg.html └── user_oauth.html ├── Dockerfile ├── .gitignore ├── .github └── workflows │ ├── docker-build-test.yml │ └── publish.yml ├── LICENSE ├── package.json └── README.md /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "think" 3 | } -------------------------------------------------------------------------------- /www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuexb/web-oauth-app/HEAD/www/favicon.ico -------------------------------------------------------------------------------- /src/logic/index.js: -------------------------------------------------------------------------------- 1 | const Base = require('./base.js'); 2 | 3 | module.exports = class extends Base { 4 | }; 5 | -------------------------------------------------------------------------------- /src/bootstrap/master.js: -------------------------------------------------------------------------------- 1 | const process = require('process'); 2 | process.on('SIGINT', () => { 3 | process.exit(0); 4 | }); 5 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /app/ 3 | *.log 4 | .cache 5 | .git 6 | /dist/ 7 | runtime/ 8 | output/ 9 | .vscode 10 | .DS_Store -------------------------------------------------------------------------------- /src/config/router.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | ['/user/login/:type', 'user/oauthLogin'], 3 | ['/user/login/:type/callback', 'user/oauthCallback'] 4 | ]; 5 | -------------------------------------------------------------------------------- /production.js: -------------------------------------------------------------------------------- 1 | const Application = require('thinkjs'); 2 | 3 | const instance = new Application({ 4 | ROOT_PATH: __dirname, 5 | proxy: true, // use proxy 6 | env: 'production' 7 | }); 8 | 9 | instance.run(); 10 | -------------------------------------------------------------------------------- /src/controller/index.js: -------------------------------------------------------------------------------- 1 | const Base = require('./base.js'); 2 | 3 | module.exports = class extends Base { 4 | /** 5 | * 首页 6 | * 7 | * @return {Object} 8 | */ 9 | async indexAction() { 10 | return this.display(); 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /development.js: -------------------------------------------------------------------------------- 1 | const Application = require('thinkjs'); 2 | const watcher = require('think-watcher'); 3 | 4 | const instance = new Application({ 5 | ROOT_PATH: __dirname, 6 | watcher: watcher, 7 | env: 'development' 8 | }); 9 | 10 | instance.run(); 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | trim_trailing_whitespace = true 9 | 10 | [*.md] 11 | indent_size = 4 12 | trim_trailing_whitespace = false 13 | 14 | [*.js] 15 | insert_final_newline = true -------------------------------------------------------------------------------- /src/config/extend.js: -------------------------------------------------------------------------------- 1 | const view = require('think-view'); 2 | const model = require('think-model'); 3 | const cache = require('think-cache'); 4 | const session = require('think-session'); 5 | const fetch = require('think-fetch'); 6 | 7 | module.exports = [ 8 | view, // make application support view 9 | model(think.app), 10 | cache, 11 | session, 12 | fetch 13 | ]; 14 | -------------------------------------------------------------------------------- /view/inc/footer.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /view/inc/showMsg.html: -------------------------------------------------------------------------------- 1 | {% if showMsg %} 2 |
8 | 这是一个用来实验WEB网站集成第三方登录的项目,一个帐号可以关联多个第三方网站,如:GitHub、微信、微博、QQ、百度等,为了更好的熟悉整个流程,该项目应运而生。 9 |
10 |11 | 查看更多介绍>> 12 |
13 | {% endblock %} -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:10-alpine 2 | 3 | LABEL maintainer="xuexb| 类型 | 10 |名称 | 11 |标识 | 12 |操作 | 13 |
|---|---|---|---|
| {{ item.type }} | 19 |{{ item.name | default('-') }} | 20 |{{ item.uid | default('-') }} | 21 |22 | {% if item.uid %} 23 | 36 | 37 | {% else %} 38 | 39 | {% endif %} 40 | | 41 |
| 没有绑定第三方授权登录 | 45 ||||