Browse Source

外部跳转修改

zhongxiaoyu 2 years ago
parent
commit
4fcd9e0210
1 changed files with 14 additions and 4 deletions
  1. 14 4
      src/views/dashboard/index.vue

+ 14 - 4
src/views/dashboard/index.vue

@@ -419,18 +419,28 @@ export default {
             //     this.$message.error(err)
             //   })
             try {
-              const result = await externalSSO({
+              // const result = await externalSSO({
+              //   baseURL: item.appUrl,
+              //   url: url.length ? '?' + url.join('&') : '',
+              //   method,
+              //   headers,
+              //   data: item.bodyType === 'application/json' ? params : qs.stringify(params)
+              // })
+              const result = await axios({
                 baseURL: item.appUrl,
                 url: url.length ? '?' + url.join('&') : '',
                 method,
                 headers,
                 data: item.bodyType === 'application/json' ? params : qs.stringify(params)
+              }).catch(error => {
+                throw new Error(error)
               })
-              if (result.code === 0) {
-                result.data && window.open(result.data)
+              if (result.status === 200) {
+                result?.data.data && window.open(result.data.data)
                 // result.data && window.open(window.location.href.split('#')[0] + '#/transferPage?url=' + result.data)
               } else {
-                this.$message.error(result.message)
+                throw new Error('错误')
+                // this.$message.error(result.message)
               }
             } catch (error) {
               console.log('网络错误:', error)