Browse Source

Merge remote-tracking branch 'origin/feature-201821-wangcz' into release-201821-wangcz

# Conflicts:
#	components/mobile/staffManagement/StaffList.vue
wangcz 7 years ago
parent
commit
4c1dd81595
4 changed files with 22 additions and 26 deletions
  1. 1 15
      components/mobile/staffManagement/StaffList.vue
  2. 4 0
      nuxt.config.js
  3. 11 11
      plugins/axios.js
  4. 6 0
      server.js

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

@@ -125,21 +125,7 @@
     methods: {
       setSwitchType (type) {
         this.switchType = type
-        this.$http({
-          method: 'get',
-          baseURL: process.env.ssoUrl,
-          url: `/api/userspace/apply/info/mall`,
-          data: {
-            count: 10,
-            page: 1,
-            speaceUU: 10049698,
-            status: 311
-          }
-        }).then(res => {
-            console.log('1', res.data)
-          }, err => {
-            console.log('12', err)
-          })
+        this.$http.get('/api/userspace/apply/info/mall?count=10&page=1&speaceUU=10049698&status=311')
       }
     }
   }

+ 4 - 0
nuxt.config.js

@@ -141,6 +141,10 @@ module.exports = {
    *   }
    */
   proxyTable: {
+    // 账户中心统一前缀
+    '/ssoPrefix/**': ssoUrl,
+    // 账户中心获取申请绑定列表接口
+    '/api/userspace/**': ssoUrl,
     '/api/**': baseUrl,
     '/search/**': baseUrl,
     '/user/**': baseUrl,

+ 11 - 11
plugins/axios.js

@@ -22,20 +22,20 @@ service.interceptors.request.use(config => {
       config.url = process.env.messageUrl + config.url
     } else if (config.url.indexOf('/cmsApi') === 0) {
       config.url = process.env.cmsUrl + config.url
-    // } else if (config.url.indexOf('/sso') === 0) {
-    //   config.url = process.env.ssoUrl + config.url
+    } else if (config.url.indexOf('/sso') === 0) {
+      config.url = process.env.ssoUrl + config.url
     } else {
       config.url = process.env.baseUrl + config.url
     }
-  //   let paramStr = ''
-  //   if (config.params) {
-  //     paramStr += '?'
-  //     for (let s in config.params) {
-  //       paramStr += s + '=' + config.params[s] + '&'
-  //     }
-  //     paramStr.substr(0, paramStr.length - 2)
-  //   }
-  //   console.log(config.url + paramStr)
+    //   let paramStr = ''
+    //   if (config.params) {
+    //     paramStr += '?'
+    //     for (let s in config.params) {
+    //       paramStr += s + '=' + config.params[s] + '&'
+    //     }
+    //     paramStr.substr(0, paramStr.length - 2)
+    //   }
+    //   console.log(config.url + paramStr)
     // config.headers.cookie = store.state.option.cookies + '; ' + store.state.option.sessionId
     // config.headers['User-Agent']
   } else {

+ 6 - 0
server.js

@@ -24,6 +24,12 @@ process.noDeprecation = true
 //   next()
 // })
 
+// 账户中心接口统一转发
+app.get('/ssoPrefix/**', (req, res, next) => {
+  res.redirect(req.url.replace('/ssoPrefix', ''))
+  next()
+})
+
 app.set('port', port)
 
 // Import and Set Nuxt.js options