forked from codingapi/springboot-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.js
28 lines (26 loc) · 752 Bytes
/
user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module.exports = (app, helper) => {
app.post('/user/login', (req, res) => {
const username = req.body.username;
if(username==='admin'){
res.json({
success:true,
data:{
'username': username,
'token':'test token',
'avatar':'/logo.png',
'authorities': ['ROLE_ADMIN','ROLE_DEVELOPER'],
}
});
return;
}
res.json({
success:true,
data:{
'username': username,
'token':'test token',
'avatar':'/logo.png',
'authorities': ['ROLE_USER'],
}
});
});
};