Browse Source

处理权限分配问题

wangcz 7 years ago
parent
commit
b5ced4eca2
3 changed files with 13 additions and 15 deletions
  1. 3 3
      nuxt.config.js
  2. 6 12
      pages/mobile/center/vendor/customer/index.vue
  3. 4 0
      yarn.lock

+ 3 - 3
nuxt.config.js

@@ -164,6 +164,9 @@ module.exports = {
     '/vendor/customer/**': uasUrl,
     '/vendor/customer/**': uasUrl,
     '/vendor/info/**': uasUrl,
     '/vendor/info/**': uasUrl,
     '/vendorPerformanceAssess/info/**': uasUrl,
     '/vendorPerformanceAssess/info/**': uasUrl,
+    // 权限管理
+    '/account/user/**': uasUrl,
+    '/account/role/**': uasUrl,
     '/vendor/**': baseUrl,
     '/vendor/**': baseUrl,
     '/vendor**': baseUrl,
     '/vendor**': baseUrl,
     // 账户中心统一前缀
     // 账户中心统一前缀
@@ -218,9 +221,6 @@ module.exports = {
     '/goods/**': baseUrl,
     '/goods/**': baseUrl,
     // 公共物料匹配物料名称
     // 公共物料匹配物料名称
     '/productuser/**': materialUrl,
     '/productuser/**': materialUrl,
-    // 权限管理
-    '/account/user/**': uasUrl,
-    '/account/role/**': uasUrl,
     '/account/**': baseUrl,
     '/account/**': baseUrl,
     '/internalmessage-service/**': baseUrl,
     '/internalmessage-service/**': baseUrl,
     '/wx/**': baseUrl,
     '/wx/**': baseUrl,

+ 6 - 12
pages/mobile/center/vendor/customer/index.vue

@@ -59,16 +59,16 @@
 
 
                   </span>
                   </span>
                   <span class="item inline-block" style="width: 32%;">用户UU</span>
                   <span class="item inline-block" style="width: 32%;">用户UU</span>
-                  <span class="item inline-block" style="width: 40%;text-align: right">用户名称</span>
+                  <span class="item inline-block" style="width: 40%;text-align: center">用户名称</span>
                 </div>
                 </div>
-                <div class="customer-modal-content-list" v-for="item in modalObj.showModalList">
+                <div class="customer-modal-content-list" v-for="item in modalObj.showModalList" v-if="item.userUU !== thisUser.userUU">
                   <span class="item inline-block" style="width: 28%;" @click="checkItem(item)">
                   <span class="item inline-block" style="width: 28%;" @click="checkItem(item)">
                     <label class="mobile-cart-check" :class="{'active': item.distribute}" v-if="modalObj.type === 'add'"></label>
                     <label class="mobile-cart-check" :class="{'active': item.distribute}" v-if="modalObj.type === 'add'"></label>
                     <label class="mobile-cart-check" :class="{'active': item.transfer}" v-else></label>
                     <label class="mobile-cart-check" :class="{'active': item.transfer}" v-else></label>
                     <!--<label class="mobile-cart-check" :class="{'active': item.distribute}"></label>-->
                     <!--<label class="mobile-cart-check" :class="{'active': item.distribute}"></label>-->
                   </span>
                   </span>
                   <span class="item inline-block" style="width: 32%;">{{item.userUU}}</span>
                   <span class="item inline-block" style="width: 32%;">{{item.userUU}}</span>
-                  <span class="item inline-block" style="width: 40%;">{{item.userName}}</span>
+                  <span class="item inline-block" style="width: 40%;text-align: center;">{{item.userName}}</span>
                 </div>
                 </div>
               </div>
               </div>
             </div>
             </div>
@@ -241,7 +241,7 @@
       modalObjonFilter() {
       modalObjonFilter() {
         let _arr = []
         let _arr = []
         this.modalObj.originList.forEach(item => {
         this.modalObj.originList.forEach(item => {
-          if (item.userUU.toString().indexOf(this.modalObj.keyword) > -1) {
+          if (item.userUU.toString().indexOf(this.modalObj.keyword) > -1 || item.userName.toString().indexOf(this.modalobj.keyword)) {
             _arr.push(item)
             _arr.push(item)
           }
           }
         })
         })
@@ -249,13 +249,10 @@
       },
       },
       // 分配
       // 分配
       async addUserInfo(customer) {
       async addUserInfo(customer) {
-        if (!this.enabled) {
-         this.onMind('您没有为当前客户分配用户的权限!')
-        }
         this.modalObj.type = 'add'
         this.modalObj.type = 'add'
         this.modalObj.customer = customer
         this.modalObj.customer = customer
         this.$http.get(`/account/user/getEnTransfer/${customer.myEnterprise.uu}`).then(res => {
         this.$http.get(`/account/user/getEnTransfer/${customer.myEnterprise.uu}`).then(res => {
-          customer.enTransfer = res.result
+          customer.enTransfer = res.data.result
           if (this.enabled || customer.enTransfer) {
           if (this.enabled || customer.enTransfer) {
             this.$http.post(`/account/user/customer/${customer.myEnterprise.uu}`).then(data => {
             this.$http.post(`/account/user/customer/${customer.myEnterprise.uu}`).then(data => {
                 customer.userinfos = data.data
                 customer.userinfos = data.data
@@ -271,13 +268,10 @@
       },
       },
       // 转移
       // 转移
       transferUserInfo(customer) {
       transferUserInfo(customer) {
-        if (!this.enabled) {
-          this.onMind('您没有转移当前客户权限的权限!')
-        }
         this.modalObj.type = 'chance'
         this.modalObj.type = 'chance'
         this.modalObj.customer = customer
         this.modalObj.customer = customer
         this.$http.get(`/account/user/getDistribute/${customer.myEnterprise.uu}`).then(res => {
         this.$http.get(`/account/user/getDistribute/${customer.myEnterprise.uu}`).then(res => {
-          customer.enTransfer = res.result
+          customer.enTransfer = res.data.result
           if (this.enabled || customer.enTransfer) {
           if (this.enabled || customer.enTransfer) {
             this.$http.get('/authentication').then(res => {
             this.$http.get('/authentication').then(res => {
               this.thisUser = res.data
               this.thisUser = res.data

+ 4 - 0
yarn.lock

@@ -3953,6 +3953,10 @@ js-beautify@1.6.14:
     mkdirp "~0.5.0"
     mkdirp "~0.5.0"
     nopt "~3.0.1"
     nopt "~3.0.1"
 
 
+js-md5@^0.7.3:
+  version "0.7.3"
+  resolved "https://registry.yarnpkg.com/js-md5/-/js-md5-0.7.3.tgz#b4f2fbb0b327455f598d6727e38ec272cd09c3f2"
+
 js-tokens@^3.0.0, js-tokens@^3.0.2:
 js-tokens@^3.0.0, js-tokens@^3.0.2:
   version "3.0.2"
   version "3.0.2"
   resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
   resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"