Browse Source

调试人员权限bug

wzh 2 years ago
parent
commit
b5d75418bf
1 changed files with 5 additions and 2 deletions
  1. 5 2
      pages/work/index.vue

+ 5 - 2
pages/work/index.vue

@@ -87,7 +87,7 @@
 
 
 
-      <view class="grid-item-box" v-if="isCompanyUser()" @click="goPage('alert')"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" @click="goPage('alert')" v-if="hasRole(['admin']) || isCompanyUser()"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/alert.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -200,6 +200,9 @@ export default {
       hasRole(role){
         return authObj.authRoleAdmin(role);
       },
+      isTestRole(){
+        return authObj.authRoleAdmin("testdevice");
+      },
       isCompanyUser(){
         return authObj.authRoleAdmin(["companymgr"]) || authObj.authRoleAdmin(["companyuser"]);
       },
@@ -216,7 +219,7 @@ export default {
             console.log('条码内容:' + res.result);
             getDevcieByQrcode(res.result).then(res=>{
               let device = res.data;
-              if(!self.hasRole(['admin'])){
+              if(self.isCompanyUser()){
                 if(device.deptId == null || device.deptId == 0){
                   self.$modal.showToast('设备不存在或无权限')
                   return;