no message
parent
66e28fc37c
commit
f5bcd26314
|
|
@ -1,7 +1,7 @@
|
|||
import request from '@/utils/request'
|
||||
export function getTaskInfo(data) {
|
||||
return request({
|
||||
url: '/zwwms/dcx/queryVueServlet',
|
||||
url: '/api/zwwms/dcx/queryVueServlet',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import store from '../store'
|
|||
import { getToken } from '@/utils/auth'
|
||||
import Config from '@/settings'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
import qs from 'qs'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
baseURL: process.env.VUE_APP_BASE_API, // api 的 base_url
|
||||
|
|
@ -15,10 +15,14 @@ const service = axios.create({
|
|||
// request拦截器
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
if (config.method === 'post' || config.method === 'POST') {
|
||||
config.data = qs.stringify(config.data)
|
||||
}
|
||||
if (getToken()) {
|
||||
config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
config.headers['Content-Type'] = 'application/json'
|
||||
config.headers['Access-Control-Allow-Origin'] = 'true'
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
|
|
|
|||
|
|
@ -80,8 +80,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
doInit() {
|
||||
// const params = { methodType: 'kchzcx', viewCount: 100, currentPage: 1 }
|
||||
const params = null
|
||||
const params = { methodType: 'kchzcx', viewCount: 100, currentPage: 1 }
|
||||
getTaskInfo(params).then(res => {
|
||||
this.data = res
|
||||
this.loading = false
|
||||
|
|
|
|||
|
|
@ -22,17 +22,18 @@ module.exports = {
|
|||
|
||||
devServer: {
|
||||
port: port,
|
||||
open: true,
|
||||
open: false,
|
||||
host: '0.0.0.0',
|
||||
overlay: {
|
||||
warnings: false,
|
||||
errors: true
|
||||
},
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: process.env.VUE_APP_BASE_API,
|
||||
target: 'http://192.168.56.138:8080',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/api': 'api'
|
||||
'/api': '/'
|
||||
}
|
||||
},
|
||||
'/auth': {
|
||||
|
|
|
|||
Loading…
Reference in New Issue