MCPcopy Create free account
hub / github.com/kenberkeley/react-demo / UserService

Class UserService

src/services/userService.js:6–28  ·  view source on GitHub ↗

* 对应后端涉及到用户认证的 API

Source from the content-addressed store, hash-verified

4 * 对应后端涉及到用户认证的 API
5 */
6class UserService {
7
8 checkLogin () {
9 return xhr({ url: '/user' })
10 }
11
12 /**
13 * @param {Object} userData
14 * @return {Promise}
15 */
16 login (userData) {
17 return xhr({
18 method: 'post',
19 url: '/login',
20 body: userData
21 })
22 }
23
24 logout () {
25 return xhr({ url: '/logout' })
26 }
27
28}
29
30// 实例化后再导出
31export default new UserService()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected