Giter Club home page Giter Club logo

chat's Introduction

chat

聊天应用,前后端分离,包含两个项目,一个前端项目、一个后端项目

后台会对非static开头的请求做过滤,该请求应该传递sessionId和token,后台会根据则两个值判断该用户是否已经登录。

前端提供了几个方法:

nighty.Login.isLogin(serverBaseUrl, messageMethod),messageMethod为可选参数,该方法会请求后台判断是否已经登录
nighty.Login.logout(serverBaseUrl, loginPage, messageMethod),messageMethod为可选参数
nighty.Login.getSessionId()
nighty.Login.getToken()
建议在index页面先调用一下isLogin方法,如果已经登录,则将该信息缓存到本地,以后都读取该变量来判断是否已经登录。

说明

1.serverBaseUrl为后台API的基本URL,如http://localhost:8080/chat
2.loginPage为登录会需要跳转的页面路径
3.messageMethod为弹出提示信息的方法,如果不传,则为alert

数据库

IP 47.75.57.210
用户名: root
密码: root
数据库名: chat

chat's People

Contributors

nightynight avatar

Watchers

James Cloos avatar  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.