Browse Source

登录优化

master
陈裕财 4 years ago
parent
commit
71782f3509
  1. 8
      config/index.js
  2. 27
      src/views/login/components/login.vue
  3. 2
      src/views/login/index.vue

8
config/index.js

@ -17,9 +17,9 @@ module.exports = {
'^/api/m1/xm': '/xm' '^/api/m1/xm': '/xm'
} }
}, },
/**
'/api/m1/sys': { '/api/m1/sys': {
target: 'http://192.168.0.103:7015',
target: 'http://localhost:7015',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api/m1/sys': '/sys' '^/api/m1/sys': '/sys'
@ -27,13 +27,13 @@ module.exports = {
}, },
'/api/m1/pay': { '/api/m1/pay': {
target: 'http://192.168.0.103:7125',
target: 'http://localhost:7125',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api/m1/pay': '/pay' '^/api/m1/pay': '/pay'
} }
}, },
**/
/** /**
'/api/m1/workflow': { '/api/m1/workflow': {
target: 'http://localhost:7080', target: 'http://localhost:7080',

27
src/views/login/components/login.vue

@ -265,33 +265,14 @@ export default {
loginParams.branchId=params.branchId loginParams.branchId=params.branchId
} }
this.$store.dispatch("LoginByUserloginid",loginParams).then(res => { this.$store.dispatch("LoginByUserloginid",loginParams).then(res => {
this.loading = false
this.loading = false
if(res.data.tips.isOk==true){ if(res.data.tips.isOk==true){
this.loading = true; this.loading = true;
this.$store.dispatch('GetUserInfo').then((res2)=>{
//this.userDeptid=res2.data.userInfo.deptid
this.$store.dispatch('GetUserInfo').then((res2)=>{
this.loading = false this.loading = false
if(res2.data.tips.isOk==true){
if(this.$store.state.user.myBranchs==null ||this.$store.state.user.myBranchs.length==0||this.$store.state.user.myDepts==null || this.$store.state.user.myDepts.length<=0){
//if(1==1){
//this.$message.error("\n ");
this.addBranchFormVisible=true;
}else if(this.$store.state.user.myDepts.length>1 ){
//this.$message.info("");
if( !this.userDeptid ){
this.userDeptid=res2.data.userInfo.deptid
this.deptSelectVisible=true;
}else{
this.rolesChecked();
}
//this.$router.push({ path: 'mdp/sys/branch/BranchAdd' })
}else if(this.$store.state.user.myDepts.length==1){
//
if(res2.data.tips.isOk==true){
this.userDeptid=res2.data.userInfo.deptid this.userDeptid=res2.data.userInfo.deptid
this.rolesChecked();
}else{
this.rolesChecked();
}
this.rolesChecked();
}else{ }else{
this.$message.error(res2.data.tips.msg); this.$message.error(res2.data.tips.msg);
} }

2
src/views/login/index.vue

@ -270,11 +270,13 @@ export default {
} }
this.$store.dispatch("LoginByUserloginid",loginParams).then(res => { this.$store.dispatch("LoginByUserloginid",loginParams).then(res => {
this.loading = false this.loading = false
debugger;
if(res.data.tips.isOk==true){ if(res.data.tips.isOk==true){
console.log(this.$store); console.log(this.$store);
this.loading = true; this.loading = true;
this.$store.dispatch('GetUserInfo').then((res2)=>{ this.$store.dispatch('GetUserInfo').then((res2)=>{
//this.userDeptid=res2.data.userInfo.deptid //this.userDeptid=res2.data.userInfo.deptid
debugger;
this.loading = false this.loading = false
if(res2.data.tips.isOk==true){ if(res2.data.tips.isOk==true){
if(this.$store.state.user.myDepts.length>1 ){ if(this.$store.state.user.myDepts.length>1 ){

Loading…
Cancel
Save