Browse Source

车间管家手机端退出登录

seyason 1 year ago
parent
commit
3184b7fb68

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/index/index.vue

@@ -222,7 +222,14 @@ export default {
                 },
             ]
             console.log(routersList, modelNameList)
-            this.routers = routersList.filter(item => item.fixed || modelNameList.includes(item.moudelName))
+            this.routers = routersList.filter(item => item.fixed || modelNameList.includes(item.moudelName));
+            this.routers.push({
+                    name: '我的',
+                    moudelName: '我的',
+                    // url: '/workView',
+                    url: '/my',
+                    icon: 'balance-list-o'
+                });
         },
         // 获取企业微信参数
         agentConfig() {

+ 4 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/login/index.vue

@@ -196,6 +196,10 @@
                 this.isWX = true;
             }
             let href = window.location.href;
+            //如果是管理员退出后登录,则不自动登录
+            if (href.indexOf('loginAny') > 0) {
+                return;
+            }
             //优先处理企业微信工作台点击进入,后台已经处理过,有userId传过来了
             if (this.isCorpWX && href.indexOf("userId") > 0) {
                 //判断企业微信,是否存在授权

+ 5 - 78
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/my/children/center.vue

@@ -13,36 +13,25 @@
         <!-- 主体 -->
         <main class="mt-10">
             <div class="bg-fff">
-                <!-- <div v-if="userInfo.companyId == '7'"> -->
-
-                <van-cell title="当前版本" :title-style="'flex: 0.5;'" :value="version"></van-cell>
-
                 <div style="height: 20px;background: #f4f4f4"></div>
                 <!-- </div> -->
                 <van-cell title="账号" v-if="userInfo.userNameNeedTranslate != '1'" :title-style="'flex: 0.5;'" :value="userInfo.phone"></van-cell>
                 <van-cell title="工号" v-if="userInfo.jobNumber" :title-style="'flex: 0.5;'" :value="userInfo.jobNumber"></van-cell>
-
+                <van-cell title="角色" v-if="userInfo.roleName" :title-style="'flex: 0.5;'" :value="userInfo.roleName"></van-cell>
                 <div style="height: 20px;background: #f4f4f4"></div>
                 
                 <van-cell title="公司" :title-style="'flex: 0.5;'" :value="userInfo.companyName"></van-cell>
                 <van-cell title="有效日期" :title-style="'flex: 0.5;'" :value="expirationDate"></van-cell> 
 
                 <div style="height: 20px;background: #f4f4f4"></div>
-                <!-- <div v-if="userInfo.companyId == '7'"> -->
-                <van-cell title="使用说明" :title-style="'flex: 1;'" is-link @click="instructions()"></van-cell>
-                <van-cell title="在线客服" :title-style="'flex: 1;'" is-link @click="tokefu()"></van-cell>
-                <van-cell title="添加员工" :title-style="'flex: 1;'" is-link @click="addEmployee()" v-if="wxManager"></van-cell>
-                <!-- </div> -->
-                <!-- <van-cell title="修改密码" isLink to="/my/set"></van-cell> -->
             </div>
-            <van-cell :title="'绑定'+(isCorpWX?'企业':'')+'微信'" v-if="userInfo.userNameNeedTranslate != '1' && (isCorpWX || isWX)" @click="bindWeiXin" style="margin-top:10px;" :title-style="'flex: 2.5;'" label="绑定微信后可接收工时填报提醒">
+            <!-- <van-cell :title="'绑定'+(isCorpWX?'企业':'')+'微信'" v-if="userInfo.userNameNeedTranslate != '1' && (isCorpWX || isWX)" @click="bindWeiXin" style="margin-top:10px;" :title-style="'flex: 2.5;'" label="绑定微信后可接收工时填报提醒">
                 <template>
                     <span v-if="(isCorpWX && userInfo.corpwxUserid == null) || (isWX && userInfo.wxOpenid == null)" style="color:#ff0000;">未绑定</span>
                     <span v-if="(isCorpWX && userInfo.corpwxUserid != null) || (isWX && userInfo.wxOpenid != null)" style="color:#7CCD7C;">已绑定</span>
                 </template>
-            </van-cell>
-            <van-button class="logout" @click="logout" block round type="danger" v-if="!isCorpWX">退出登录</van-button>
-            <!-- <van-button class="logout" @click="logout" block round type="danger" >退出登录</van-button> -->
+            </van-cell> -->
+            <van-button class="logout" @click="logout" block round type="danger" v-if="userInfo.roleName=='超级管理员' || userInfo.roleName=='系统管理员'">退出登录</van-button>
         </main>
 
         <Footer page="my" />
@@ -78,7 +67,7 @@
             logout() {
                 this.$store.commit("updateLogin", false);
                 localStorage.removeItem("userInfo");
-                this.$router.push("/login");
+                this.$router.push({path:"/login", query: {loginAny: true}});
             },
             bindWeiXin(){
                 //企业微信
@@ -99,61 +88,6 @@
                 var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=0#wechat_redirect";
                 window.location.href = weixinUrl;
             },
-            // 使用说明
-            instructions() {
-                let url = 'http://celiang.oss-cn-hangzhou.aliyuncs.com/measurement/2022-01/18/75it6phpocqYFV1642488558220118.pdf'
-                let name = '使用说明书'
-                // 将要传过去的值
-                this.previewPDF(url, name)
-            },
-            // 预览pdf
-            previewPDF(url, name) {
-                this.$router.push({
-                    path:  '/pdf',
-                    query: {
-                        url: '',
-                        name: name
-                    }
-                })
-            },
-            // 添加员工
-            addEmployee() {
-                wx.invoke('openAppManage', {}, function(res){
-                    console.log(res, '你在看看')
-                    if(res.err_msg == "openAppManage:ok") {
-                        // 调用成功              
-                    }
-                    if(res.err_msg == "openAppManage:fail:no permission") {
-                        // 调用人身份不符合                 
-                        this.$message({message: '调用人身份不符合',type: "error"});
-                    }
-                    if(res.err_msg == "openAppManage:fail:unknown app") {
-                        // 应用信息获取失败
-                        this.$message({message: '应用信息获取失败',type: "error"});
-                    }
-                    if(res.err_msg == "openAppManage:fail:unsupported app type") {
-                        // 应用类型不符合要求
-                        this.$message({message: '应用类型不符合要求',type: "error"});
-                    }
-                    if(res.err_msg == "openAppManage:fail") {
-                        // 其它错误                  
-                        this.$message({message: '其它错误',type: "error"});
-                    }      
-                })
-            },
-            // 跳转客服
-            tokefu(){
-                wx.invoke('openThirdAppServiceChat', {
-                    }, function(res) {
-                        console.log('invoke',res);
-                        if (res.err_msg == "openThirdAppServiceChat:ok" || res.err_msg == "openThirdAppServiceChat:cancel") {
-                        }else{
-                            this.$toast.fail('请联系管理员添加客服');
-                        }
-                        
-                    }
-                );
-            },
             // 判断是否有添加员工的权限
             getWxManager() {
                 this.$axios.post("/user/isManager", {})
@@ -185,13 +119,6 @@
                 userss.company.expirationDate[2] >= 10 ? userss.company.expirationDate[2] : userss.company.expirationDate[1] = '0' + userss.company.expirationDate[2]
                 userss.company.expirationDate[1] >= 10 ? userss.company.expirationDate[1] : userss.company.expirationDate[1] = '0' + userss.company.expirationDate[1]
                 this.expirationDate = userss.company.expirationDate[0] + '-' + userss.company.expirationDate[1] + '-' + userss.company.expirationDate[2]
-
-                // 版本
-                userss.company.packageWorktime == 1 ? this.version = '基础版' : ''
-                userss.company.packageProject == 1 ? this.version = '专业版' : ''
-                userss.company.packageEngineering == 1 ? this.version = '建筑工程版' : ''
-                userss.company.packageOa == 1 ? this.version = '旗舰版' : ''
-
                 console.log(this.version)
             }
 

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -187,10 +187,10 @@
                         this.routers.push({name: '查看日报',url: '/calendar',icon: 'description'})
                         if(this.user.companyId != '1071') { // 针对物奇公司去掉填写日报
                             this.routers.push({name: '填写日报',url: '/edit',icon: 'edit'})
-                        }
-                        // if (this.user.companyId == 817 || this.user.companyId == 7 || this.user.companyId == 10) {
+                            //物奇临时去掉按周填报
                             this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})
-                        // }
+                        }
+                        // this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})                        }
                     }
                     if(list[i].name == '待办任务') {
                         this.routers.push({