use rbac
db.createUser({
user: "rbac",
pwd: "rbac123",
roles: [ { role: "readWrite", db: "rbac" } ]
})
db.auth('rbac','rbac123')
-
- .env.development
VUE_APP_BASE_API = 'http://localhost:8080'
-
- src/api/user.js
url: '/user/login'
改为
url: '/auth'
-
- src/utils/request.js
config.headers['X-Token'] = getToken()
改为
config.headers['Authorization'] = 'Bearer ' + getToken()