Browse Source

pref: 处理B2B接口代理问题

huangb 6 years ago
parent
commit
9d3443a126

+ 1 - 1
components/mobile/staffManagement/StaffList.vue

@@ -296,7 +296,7 @@
       },
       // 获取角色
       getRoles () {
-        this.$http.get('/account/role')
+        this.$http.get('/btob/account/role')
           .then(response => {
             if (response.data) {
               this.rolesList = response.data

+ 3 - 5
nuxt.config.js

@@ -11,7 +11,7 @@ const cmsUrl = process.env.CMS_URL || (isProdMode ? 'https://cms.usoftchina.com'
 // 消息
 const messageUrl = process.env.MESSAGE_URL || (isProdMode ? 'https://api-message.usoftchina.com/' : 'http://test-message.uuzcc.cn/')
 // B2B
-const uasUrl = process.env.uasUrl || (isProdMode ? 'https://b2b.usoftchina.com/' : 'http://rel-b2b.uuzcc.cn/')
+const uasUrl = process.env.uasUrl || (isProdMode ? 'https://b2b.usoftchina.com/' : 'http://test-b2b.uuzcc.cn/')
 // 帐户中心
 const ssoUrl = process.env.ssoUrl || (isProdMode ? 'https://sso.ubtob.com/' : 'http://test-sso-server.uuzcc.cn/')
 // pcb展示ID
@@ -146,7 +146,6 @@ module.exports = {
    */
   proxyTable: {
     // B2B服务接口 uasUrl
-    '/btob/**': uasUrl,
     '/purchase/arCheck': uasUrl,
     '/sale/inquiry/**': uasUrl,
     '/purc/inquiry/**': uasUrl,
@@ -220,7 +219,7 @@ module.exports = {
     '/goods/**': baseUrl,
     // 公共物料匹配物料名称
     '/productuser/**': materialUrl,
-    // '/account/**': baseUrl,
+    '/account/**': baseUrl,
     '/internalmessage-service/**': baseUrl,
     '/wx/**': baseUrl,
     '/messages**': messageUrl,
@@ -234,7 +233,6 @@ module.exports = {
     // 账户中心获取申请绑定列表接口
     '/api/userspace/apply/**': ssoUrl,
     // 权限管理
-    '/account/user/**': uasUrl,
-    '/account/role/**': uasUrl
+    '/btob/**': {target: uasUrl, changeOrigin: true, pathRewrite: {'^/btob': '/'}}
   }
 }

+ 1 - 1
pages/mobile/center/user/btobarCheck.vue

@@ -400,7 +400,7 @@
       }
     },
     created() {
-      this.$http.get('/account/role/isUser').then(res => {
+      this.$http.get('/btob/account/role/isUser').then(res => {
         this.isUser = res.data.isUser
       })
       this.getUnread()

+ 1 - 1
pages/mobile/center/user/supplier/index.vue

@@ -113,7 +113,7 @@
       }
     },
     created() {
-      this.$http.get('/account/role/currentRole').then(res => {
+      this.$http.get('/btob/account/role/currentRole').then(res => {
         this.thisUser = this.$store.state.option.user.data
         this.enabled = res.data.count > 0 || this.thisUser.sys
       })

+ 1 - 1
pages/mobile/center/user/tender/index.vue

@@ -217,7 +217,7 @@
         this.setSelect(selectObj.key, selectObj.value, false)
       },
       getHasUser () {
-        this.$http.get('/account/role/isUser').then(res => {
+        this.$http.get('/btob/account/role/isUser').then(res => {
           this.isUser = res.data.isUser
         })
       },

+ 1 - 1
pages/mobile/center/vendor/btobapCheck.vue

@@ -405,7 +405,7 @@
       }
     },
     created() {
-      this.$http.get('/account/role/isUser').then(res => {
+      this.$http.get('/btob/account/role/isUser').then(res => {
         this.isUser = res.data.isUser
       })
       this.getUnread()

+ 8 - 8
pages/mobile/center/vendor/customer/index.vue

@@ -151,7 +151,7 @@
       }
     },
     created() {
-      this.$http.get('/account/role/currentRole').then(res => {
+      this.$http.get('/btob/account/role/currentRole').then(res => {
         this.thisUser = this.$store.state.option.user.data
         this.enabled = res.data.count > 0 || this.thisUser.sys
       })
@@ -164,7 +164,7 @@
           if (this.modalObj.customer.myEnterprise.uu) {
             // 当前用户是管理员时
             if (this.thisUser.sys) {
-                this.$http.post(`/account/user/transferUserToVendor/${this.modalObj.customer.id}`, this.modalObj.originList).then(data => {
+                this.$http.post(`/btob/account/user/transferUserToVendor/${this.modalObj.customer.id}`, this.modalObj.originList).then(data => {
                   this.onMind('转移成功!')
                   this.closeModal()
                   this.setSelect(true)
@@ -187,7 +187,7 @@
                 this.onMind('您未选择权限转移对象!')
                 this.closeModal()
               } else {
-                this.$http.post(`/account/user/transferMyDistribute?custUU=${this.modalObj.customer.myEnterprise.uu}&userUU=${this.target.userUU}`, {})
+                this.$http.post(`/btob/account/user/transferMyDistribute?custUU=${this.modalObj.customer.myEnterprise.uu}&userUU=${this.target.userUU}`, {})
                   .then(data => {
                   this.onMind('转移成功!')
                   this.closeModal()
@@ -202,7 +202,7 @@
             this.closeModal()
           }
         } else {
-          this.$http.post(`/account/user/bindUserToVendor/${this.modalObj.customer.id}`, this.modalObj.originList).then(res => {
+          this.$http.post(`/btob/account/user/bindUserToVendor/${this.modalObj.customer.id}`, this.modalObj.originList).then(res => {
             this.onMind('分配成功!')
             this.closeModal()
             this.setSelect(true)
@@ -287,10 +287,10 @@
         this.modalObj.keyword = ''
         this.modalObj.type = 'add'
         this.modalObj.customer = customer
-        this.$http.get(`/account/user/getEnTransfer/${customer.myEnterprise.uu}`).then(res => {
+        this.$http.get(`/btob/account/user/getEnTransfer/${customer.myEnterprise.uu}`).then(res => {
           customer.enTransfer = res.data.result
           if (this.enabled || customer.enTransfer) {
-            this.$http.get(`/account/user/customer/${customer.id}`, {params: this.modalParams}).then(data => {
+            this.$http.get(`/btob/account/user/customer/${customer.id}`, {params: this.modalParams}).then(data => {
                 customer.userinfos = data.data.content
                 this.modalObj.showModal = true
                 this.modalObj.showModalList = customer.userinfos
@@ -307,13 +307,13 @@
         this.modalObj.keyword = ''
         this.modalObj.type = 'chance'
         this.modalObj.customer = customer
-        this.$http.get(`/account/user/getDistribute/${customer.id}`).then(res => {
+        this.$http.get(`/btob/account/user/getDistribute/${customer.id}`).then(res => {
           customer.enTransfer = res.data.result
           if (this.enabled || customer.enTransfer) {
             this.$http.get('/authentication').then(res => {
               this.thisUser = res.data
             })
-            this.$http.get(`/account/user/customer/${customer.id}`, {params: this.modalParams}).then(data => {
+            this.$http.get(`/btob/account/user/customer/${customer.id}`, {params: this.modalParams}).then(data => {
               customer.userinfos = data.data.content
               customer.userinfos.forEach(user => {
                 if (this.$store.state.option.user.data.userUU === user.userUU && user.transfer) {

+ 1 - 1
pages/mobile/center/vendor/invoice/invoice_btob.vue

@@ -153,7 +153,7 @@
       }
     },
     created() {
-      this.$http.get('/account/role/isUser').then(res => {
+      this.$http.get('/btob/account/role/isUser').then(res => {
         this.isUser = res.data.isUser
       })
     },

+ 1 - 1
pages/mobile/center/vendor/sample/index.vue

@@ -297,7 +297,7 @@
         this.setSelect(selectObj.key, selectObj.value, false)
       },
       getHasUser () {
-        this.$http.get('/account/role/isUser').then(res => {
+        this.$http.get('/btob/account/role/isUser').then(res => {
           this.isUser = res.data.isUser
         })
       },