|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-10-14 17:17:53
|
|
|
- * @LastEditTime: 2022-03-28 17:42:13
|
|
|
+ * @LastEditTime: 2022-03-29 14:18:40
|
|
|
* @LastEditors: your name
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: \Foshan4A\src\views\dashboard\index.vue
|
|
@@ -386,28 +386,43 @@ export default {
|
|
|
})
|
|
|
if (parseInt(item.requestType) === 1) {
|
|
|
method = 'get'
|
|
|
+ const form = document.createElement('form')
|
|
|
+ form.action = item.appUrl + (url.length ? '?' + url.join('&') : '')
|
|
|
+ form.target = '_blank'
|
|
|
+ form.method = method
|
|
|
+ form.style.display = 'none'
|
|
|
+ for (let key in params) {
|
|
|
+ const input = document.createElement('input')
|
|
|
+ input.name = key
|
|
|
+ input.value = params[key]
|
|
|
+ form.appendChild(input)
|
|
|
+ }
|
|
|
+ document.body.appendChild(form)
|
|
|
+ form.submit()
|
|
|
+ document.body.removeChild(form)
|
|
|
} else {
|
|
|
method = 'post'
|
|
|
headers['Content-Type'] =
|
|
|
item.bodyType === 'application/json'
|
|
|
? 'application/json;charset=UTF-8'
|
|
|
: 'application/x-www-form-urlencoded'
|
|
|
- }
|
|
|
- axios({
|
|
|
- url: item.appUrl + (url.length ? '?' + url.join('&') : ''),
|
|
|
- method,
|
|
|
- headers,
|
|
|
- data: item.bodyType === 'application/json' ? params : qs.stringify(params)
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- const data = res.data.data
|
|
|
- data && window.open(data)
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- this.$message.error(err)
|
|
|
+ axios({
|
|
|
+ baseURL: item.appUrl,
|
|
|
+ url: url.length ? '?' + url.join('&') : '',
|
|
|
+ method,
|
|
|
+ headers,
|
|
|
+ data: item.bodyType === 'application/json' ? params : qs.stringify(params)
|
|
|
})
|
|
|
+ .then(res => {
|
|
|
+ const data = res.data.data
|
|
|
+ data && window.open(data)
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ this.$message.error(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.$message.warning('应用地址为空')
|
|
|
+ this.$message.warning('应用地址为空')
|
|
|
}
|
|
|
// if (item.appUrl) {
|
|
|
// window.open(item.appUrl)
|