|
@@ -17,7 +17,7 @@ export default {
|
|
|
projectId: '',
|
|
|
projects: [],
|
|
|
breadcrumb: [],
|
|
|
- secret: "", //密码
|
|
|
+ secret: "", //项目密码
|
|
|
userId: "", //用户id
|
|
|
},
|
|
|
getters: {
|
|
@@ -87,33 +87,11 @@ export default {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
frameworkApi.loadUserInfo().then(resp => {
|
|
|
console.log(resp)
|
|
|
- // if (resp.result == 'success') {
|
|
|
- // state.userInfo = { username: resp.username }
|
|
|
- // storage.set('user_name', resp.username)
|
|
|
- // state.permissions = {}
|
|
|
- // if (resp.permissions) {
|
|
|
- // resp.permissions.forEach(p => (state.permissions[p] = true))
|
|
|
- // }
|
|
|
- // state.projects = []
|
|
|
- // if (resp.projects) {
|
|
|
- // if(resp.projects[0] && resp.projects[0].projId) {
|
|
|
- // state.projectId = resp.projects[0].projId
|
|
|
- // state.secret = resp.projects[0].secret?resp.projects[0].secret:""
|
|
|
- // }
|
|
|
- // resp.projects.forEach(proj =>
|
|
|
- // state.projects.push({
|
|
|
- // id: proj.projId,
|
|
|
- // name: proj.projLocalName,
|
|
|
- // pwd: proj.secret?proj.secret:""
|
|
|
- // })
|
|
|
- // )
|
|
|
- // }
|
|
|
- // } else {
|
|
|
if (resp.Result == 'success') {
|
|
|
- state.userInfo = { username: resp.Username, userId: resp.Userid }
|
|
|
- state.userId = resp.Userid
|
|
|
+ state.userInfo = { username: resp.Username, userId: resp.UserId }
|
|
|
+ state.userId = resp.UserId
|
|
|
storage.set('user_name', resp.Username)
|
|
|
- storage.set('user_id', resp.Userid)
|
|
|
+ storage.set('user_id', resp.UserId)
|
|
|
state.permissions = {}
|
|
|
if (resp.Permissions) {
|
|
|
resp.Permissions.forEach(p => (state.permissions[p] = true))
|