From 91e2abca7fc3075d35dc0aa9256a182735a8e5ac Mon Sep 17 00:00:00 2001 From: Vergil <974548713@qq.com> Date: Wed, 6 May 2020 09:32:27 +0800 Subject: [PATCH] request --- src/utils/request.js | 49 +++++++++++++++++++++++--------------------- static/config.js | 26 +++++++++++++++++++++++ 2 files changed, 52 insertions(+), 23 deletions(-) create mode 100644 static/config.js diff --git a/src/utils/request.js b/src/utils/request.js index 24b890ab..73f262be 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,33 +1,36 @@ import axios from 'axios' +import { wsuri_config, name_config, name1_config, name3_config, name4_config, readFile_config, readImg_config, upload_config, upload2_config, upload3_config, uploadInvoiceScan_config, uploadInvoiceScan1_config, + download_config, uploadPerson_config, uploadOP_config, url_config, ExcelDownLoad_config, ServerIP_config, uploadFileMachine_config, + downloadFileMachine_config, MESUploadFile_config, MESDownloadFile_config, request_config } from '../../static/config' // import Cookies from 'js-cookie' // import store from '@/store' -export const wsuri = `ws://192.168.1.232:61101//WebMoudule//websocket` -export const name = `OP8888` -export const name1 = `OP1000` -export const name3 = `OP2000` -export const name4 = `OP9999` +export const wsuri = wsuri_config +export const name = name_config +export const name1 = name1_config +export const name3 = name3_config +export const name4 = name4_config -export const readFile = `http://123.56.95.229:58010/webpage/file/` // invoice -export const readImg = `http://123.56.95.229:58010/webpage/img/` // delivery/MS/performancebond -export const upload = `http://123.56.95.229:58010/submit/uploadFile.ashx` // ContractInformationManagement -export const upload2 = `http://123.56.95.229:58010/submit/upload2.ashx` // delivery -export const upload3 = `http://123.56.95.229:58010/submit/upload3.ashx` // performancebond -export const uploadInvoiceScan = `http://123.56.95.229:58010/submit/uploadInvoiceScan.ashx` // invoice -export const uploadInvoiceScan1 = `http://123.56.95.229:58010/submit/uploadInvoiceScan1.ashx` // invoice(workshop) -export const download = `http://123.56.95.229:58010/submit/downloadFile.ashx` // ContractInformationManagement -export const uploadPerson = `http://123.56.95.229:58010/submit/uploadPerson.ashx` -export const uploadOP = `http://123.56.95.229:58010/submit/uploadOP.ashx` -export const url = `http://123.56.95.229:58010/submit/MESCommonBase.ashx` // 采购件入库、离线件入库 -export const ExcelDownLoad = 'http://123.56.95.229:58010/submit/MESCommonBase.ashx' // 导出excel +export const readFile = readFile_config // invoice +export const readImg = readImg_config // delivery/MS/performancebond +export const upload = upload_config // ContractInformationManagement +export const upload2 = upload2_config // delivery +export const upload3 = upload3_config // performancebond +export const uploadInvoiceScan = uploadInvoiceScan_config // invoice +export const uploadInvoiceScan1 = uploadInvoiceScan1_config // invoice(workshop) +export const download = download_config // ContractInformationManagement +export const uploadPerson = uploadPerson_config +export const uploadOP = uploadOP_config +export const url = url_config // 采购件入库、离线件入库 +export const ExcelDownLoad = ExcelDownLoad_config // 导出excel // 技术中心程序发布时要更改下面所有的IP到0段 -export const ServerIP = `http://123.56.95.229:58010/webpage/file/` -export const uploadFileMachine = `http://123.56.95.229:58010/submit/uploadFileMachine.ashx` // 机床总图 发布时改成0.231 -export const downloadFileMachine = `http://123.56.95.229:58010/submit/downloadFileMachine.ashx` // 机床总图 发布时改成0.231 -export const MESUploadFile = `http://123.56.95.229:58010/submit/MESUploadFile.ashx` -export const MESDownloadFile = `http://123.56.95.229:58010/submit/MESDownloadFile.ashx` +export const ServerIP = ServerIP_config +export const uploadFileMachine = uploadFileMachine_config // 机床总图 发布时改成0.231 +export const downloadFileMachine = downloadFileMachine_config // 机床总图 发布时改成0.231 +export const MESUploadFile = MESUploadFile_config +export const MESDownloadFile = MESDownloadFile_config const service = axios.create({ - baseURL: `http://123.56.95.229:58010/submit/MESCommonBase.ashx`, + baseURL: request_config, timeout: 1500000 // 请求超时时间 }) diff --git a/static/config.js b/static/config.js new file mode 100644 index 00000000..ffa895e5 --- /dev/null +++ b/static/config.js @@ -0,0 +1,26 @@ +export const wsuri_config = `ws://192.168.1.232:61101//WebMoudule//websocket` +export const name_config = `OP8888` +export const name1_config = `OP1000` +export const name3_config = `OP2000` +export const name4_config = `OP9999` + +export const readFile_config = `http://123.56.95.229:58010/webpage/file/` // invoice +export const readImg_config = `http://123.56.95.229:58010/webpage/img/` // delivery/MS/performancebond +export const upload_config = `http://123.56.95.229:58010/submit/uploadFile.ashx` // ContractInformationManagement +export const upload2_config = `http://123.56.95.229:58010/submit/upload2.ashx` // delivery +export const upload3_config = `http://123.56.95.229:58010/submit/upload3.ashx` // performancebond +export const uploadInvoiceScan_config = `http://123.56.95.229:58010/submit/uploadInvoiceScan.ashx` // invoice +export const uploadInvoiceScan1_config = `http://123.56.95.229:58010/submit/uploadInvoiceScan1.ashx` // invoice(workshop) +export const download_config = `http://123.56.95.229:58010/submit/downloadFile.ashx` // ContractInformationManagement +export const uploadPerson_config = `http://123.56.95.229:58010/submit/uploadPerson.ashx` +export const uploadOP_config = `http://123.56.95.229:58010/submit/uploadOP.ashx` +export const url_config = `http://123.56.95.229:58010/submit/MESCommonBase.ashx` // 采购件入库、离线件入库 +export const ExcelDownLoad_config = 'http://123.56.95.229:58010/submit/MESCommonBase.ashx' // 导出excel +// 技术中心程序发布时要更改下面所有的IP到0段 +export const ServerIP_config = `http://123.56.95.229:58010/webpage/file/` +export const uploadFileMachine_config = `http://123.56.95.229:58010/submit/uploadFileMachine.ashx` // 机床总图 发布时改成0.231 +export const downloadFileMachine_config = `http://123.56.95.229:58010/submit/downloadFileMachine.ashx` // 机床总图 发布时改成0.231 +export const MESUploadFile_config = `http://123.56.95.229:58010/submit/MESUploadFile.ashx` +export const MESDownloadFile_config = `http://123.56.95.229:58010/submit/MESDownloadFile.ashx` + +export const request_config = `http://123.56.95.229:58010/submit/MESCommonBase.ashx`