-
+
+
+
![]()
+

+
-
{{userInfo.branchName}}
+
{{userInfo.branchName?userInfo.branchName:''}}
- 当前版本 / 免费基础版
-
-
- 升级
+ 账户类型 /
+ 个人主账户
+ 个人子账户
+ 企业管理员账户
+ 企业员工账户
+
+
+
+ 升级
@@ -29,67 +38,62 @@
-
我的用户名:{{userInfo.username}}
+
用户名称:{{userInfo.username}}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 登录
+
+
+
+
+
+
+
@@ -97,9 +101,15 @@
import { mapGetters } from 'vuex'
import dayjs from 'dayjs'
+import { queryMyUsers,switchUser } from '@/api/login';
+import BranchAdd from "@/views/mdp/sys/branch/BranchEdit";
+
export default {
data() {
return {
+ branchAddVisible:false,
+ phonenoUsers:[],
+ phonenoUsersVisible:false,
}
},
@@ -108,6 +118,7 @@ export default {
...mapGetters([
'userInfo',
'roles',
+ 'myPosts'
]),
getTimeStatus() {
let hour = dayjs().hour();
@@ -122,12 +133,62 @@ export default {
},
methods: {
+
+ switchUser(){
+ queryMyUsers().then(res0=>{
+ if(res0.data.tips.isOk){
+ this.phonenoUsers=res0.data.data;
+ if(res0.data.data.length<=1){
+ this.$message.warning("当前没有关联的账户,无须切换");
+ }else{
+ this.phonenoUsersVisible=true;
+ }
+ }else{
+ this.$message.error(res0.data.tips.msg);
+ }
+ })
+ },
handleCommand(command){
if(command=='updateUserInfo'){
this.$router.push({path:'/updateUserInfo'})
}
+ },
+ upgradeToBranchAccount(){
+ //跳转到购买模块页面
+ this.branchAddVisible=true;
+ },
+ toLogin(user) {
+ this.$prompt('请输入密码', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ }).then(({ value }) => {
+ let params={
+ password:md5(value),
+ userloginid:user.userid,
+ authType:'password_display_userid' ,
+ grantType:"password"
+ }
+ //userloginid, password,grantType,authType,deptid,userid
+ switchUser(params.userloginid,params.password,params.grantType,params.authType,'',params.userloginid).then(res => {
+ this.phonenoUsersVisible=false;
+ if(res.data.tips.isOk==true){
+ setToken( res.data.data.accessToken.tokenValue)
+ removeCacheUserInfo();
+ this.$store.dispatch('GetUserInfo').then((res2)=>{
+ this.$router.push({ path: '/' });
+ }).catch(err=>{
+
+ });
+ }else{
+ this.$message.error(res.data.tips.msg);
+ }
+ }).catch((e) => {
+
+ })
+ }).catch(() => {
+ this.phonenoUsersVisible=false;
+ });
},
-
logout() {
this.$store.dispatch('LogOut').then(() => {
location.replace('/'+process.env.CONTEXT+'/'+process.env.VERSION+'/');
@@ -135,7 +196,9 @@ export default {
},
},
-
+ components:{
+ BranchAdd
+ },
mounted() {
}