From a3c43a998956d8eb0721eac52dbddc86844da815 Mon Sep 17 00:00:00 2001 From: hongtianzai Date: Fri, 21 Jan 2022 09:56:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=94=B9=E6=88=90=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E5=AF=B9=E6=8E=A5=E4=B8=80=E4=B8=AA=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=20=E9=98=B3=E5=85=89=E9=87=87=E8=B4=AD=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/config.json | 3 +- src/api/udplat/udplatDistributor.js | 9 ++ src/api/udplat/udplatGoods.js | 9 ++ src/api/udplat/udplatHospital.js | 9 ++ src/api/udplat/udplatLog.js | 9 ++ src/api/udplat/udplatManufacture.js | 9 ++ src/main.js | 2 +- src/role.js | 2 +- src/router/index.js | 48 +++++- src/utils/axios2.js | 2 +- src/utils/request.js | 36 ++++- src/views/UDIDownload/jobLog.vue | 1 + src/views/udplat/minixs/commMinixs.js | 72 +++++++++ src/views/udplat/udplatDistributor.vue | 163 ++++++++++++++++++++ src/views/udplat/udplatGoods.vue | 101 +++++++++++++ src/views/udplat/udplatHospital.vue | 98 ++++++++++++ src/views/udplat/udplatLog.vue | 201 +++++++++++++++++++++++++ src/views/udplat/udplatManufacture.vue | 96 ++++++++++++ vue.config.js | 10 +- 19 files changed, 870 insertions(+), 10 deletions(-) create mode 100644 src/api/udplat/udplatDistributor.js create mode 100644 src/api/udplat/udplatGoods.js create mode 100644 src/api/udplat/udplatHospital.js create mode 100644 src/api/udplat/udplatLog.js create mode 100644 src/api/udplat/udplatManufacture.js create mode 100644 src/views/udplat/minixs/commMinixs.js create mode 100644 src/views/udplat/udplatDistributor.vue create mode 100644 src/views/udplat/udplatGoods.vue create mode 100644 src/views/udplat/udplatHospital.vue create mode 100644 src/views/udplat/udplatLog.vue create mode 100644 src/views/udplat/udplatManufacture.vue diff --git a/public/config.json b/public/config.json index 7a644c1..2fd9a49 100644 --- a/public/config.json +++ b/public/config.json @@ -1,4 +1,3 @@ { - "BASE_URL":"https://www.udims.com/UDIC_UDI_Server", - "Download_URL": "http://localhost:9994/" + "BASE_URL":"http://localhost:9995" } diff --git a/src/api/udplat/udplatDistributor.js b/src/api/udplat/udplatDistributor.js new file mode 100644 index 0000000..b0a8773 --- /dev/null +++ b/src/api/udplat/udplatDistributor.js @@ -0,0 +1,9 @@ +import request from "@/utils/request"; + +export function GetList(param){ + return request({ + url: "/udplat/distributor/list", + method: "post", + data: param + }); +} diff --git a/src/api/udplat/udplatGoods.js b/src/api/udplat/udplatGoods.js new file mode 100644 index 0000000..2628ee5 --- /dev/null +++ b/src/api/udplat/udplatGoods.js @@ -0,0 +1,9 @@ +import request from "@/utils/request"; + +export function GetList(param){ + return request({ + url: "/udplat/goods/list", + method: "post", + data: param + }); +} diff --git a/src/api/udplat/udplatHospital.js b/src/api/udplat/udplatHospital.js new file mode 100644 index 0000000..83a6deb --- /dev/null +++ b/src/api/udplat/udplatHospital.js @@ -0,0 +1,9 @@ +import request from "@/utils/request"; + +export function GetList(param){ + return request({ + url: "/udplat/hospital/list", + method: "post", + data: param + }); +} diff --git a/src/api/udplat/udplatLog.js b/src/api/udplat/udplatLog.js new file mode 100644 index 0000000..d37aaa8 --- /dev/null +++ b/src/api/udplat/udplatLog.js @@ -0,0 +1,9 @@ +import request from "@/utils/request"; + +export function GetList(param){ + return request({ + url: "/udplat/log/list", + method: "post", + data: param + }); +} diff --git a/src/api/udplat/udplatManufacture.js b/src/api/udplat/udplatManufacture.js new file mode 100644 index 0000000..b6c5462 --- /dev/null +++ b/src/api/udplat/udplatManufacture.js @@ -0,0 +1,9 @@ +import request from "@/utils/request"; + +export function GetList(param){ + return request({ + url: "/udplat/manufacture/list", + method: "post", + data: param + }); +} diff --git a/src/main.js b/src/main.js index 40ac7d2..4a9c8a2 100644 --- a/src/main.js +++ b/src/main.js @@ -34,7 +34,7 @@ let startApp = function () { // 基础地址 getUrl = res.data.BASE_URL; myReq.defaults.baseURL = getUrl; - request.defaults.baseURL = res.data.Download_URL; + request.defaults.baseURL = getUrl;//res.data.Download_URL; console.log(res.data); new Vue({ router, diff --git a/src/role.js b/src/role.js index 7cd6e09..c2d5328 100644 --- a/src/role.js +++ b/src/role.js @@ -102,7 +102,7 @@ router.beforeEach((to, from, next) => { // accessedRouters[1].children.splice(5,1); //删除admin里面不显示的客户用户管理 // accessedRouters[3].children.splice(8,1);//删除admin里面不显示的用户信息管理 // } - + // 生成可访问的路由表 router.addRoutes(accessedRouters); // 动态添加可访问路由表 next({ ...to }); // hack方法 确保addRoutes已完成 diff --git a/src/router/index.js b/src/router/index.js index 08103f2..270e935 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -74,6 +74,11 @@ import facidentcode from "../views/basic/facidentcode.vue" import jobLog from"../views/UDIDownload/jobLog" import fileInfo from "../views/UDIDownload/fielInfo" import udiSingle from "../views/UDIDownload/udiSingle"; +import udplatDistributor from '../views/udplat/udplatDistributor'; +import udplatHospital from '../views/udplat/udplatHospital'; +import udplatManufacture from '../views/udplat/udplatManufacture'; +import udplatGoods from '../views/udplat/udplatGoods'; +import udplatLog from '../views/udplat/udplatLog'; const err401 = r => require.ensure([], () => r(require("../views/error/err401.vue")), "home"); @@ -641,7 +646,7 @@ export const asyncRouterMap = [ }, children: [ { - name: "同步日志", + name: "UDI日志", path: "jobLog", component: jobLog, @@ -665,8 +670,49 @@ export const asyncRouterMap = [ meta: { authRule: ["UDIDownload/udiSingle"] }, + }, + { + name: "配送企业", + path: "udplatDistributor", + component: udplatDistributor, + meta: { + authRule: ["UDIDownload/udplatDistributor"] + }, + }, + { + name: "医疗机构", + path: "udplatHospital", + component: udplatHospital, + meta: { + authRule: ["UDIDownload/udplatHospital"] + }, + }, + { + name: "生产企业", + path: "udplatManufacture", + component: udplatManufacture, + meta: { + authRule: ["UDIDownload/udplatManufacture"] + }, + }, + { + name: "可选目录", + path: "udplatGoods", + component: udplatGoods, + meta: { + authRule: ["UDIDownload/udplatGoods"] + }, + }, + { + name: "阳光平台日志", + path: "udplatLog", + component: udplatLog, + meta: { + authRule: ["UDIDownload/udplatLog"] + }, } ] } + ]; diff --git a/src/utils/axios2.js b/src/utils/axios2.js index b2dc7bf..05e5fa6 100644 --- a/src/utils/axios2.js +++ b/src/utils/axios2.js @@ -1,7 +1,7 @@ import axios from "axios"; import { Message } from "element-ui"; import store from "../store/index"; -import { BASE_URL } from "../config/app"; +//import { BASE_URL } from "../config/app"; import router from "../router/index"; import "../../public/config"; // axios.defaults.baseURL = '/api' diff --git a/src/utils/request.js b/src/utils/request.js index 15f3622..a4bf4df 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,5 +1,7 @@ import axios from 'axios' import {Message} from 'element-ui' +import store from "../store"; +import router from "../router"; axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' // 创建axios实例 @@ -9,9 +11,24 @@ const service = axios.create({ // 超时 timeout: 30000 }) +// request拦截器 +service.interceptors.request.use( + config => { + if (store.getters.adminId && store.getters.token) { + config.headers={ + ADMIN_ID: store.getters.adminId, + ADMIN_TOKEN: store.getters.token, + }; + } + return config; + }, + error => { + Promise.reject(error); + } +); service.interceptors.response.use(res=>{ const status = Number(res.status) || 200; - console.log(res); + const data = res.data; if (status !== 200) { Message({ message: res.statusText, @@ -19,8 +36,21 @@ service.interceptors.response.use(res=>{ }) return Promise.reject(new Error(res.statusText)) } else { - console.log(res.data); - return res.data + if (data.code) { + if (data.code === 2) { + store.dispatch("fedLogout").then(() => { + Message.error("验证失败,请重新登录"); + router.push({ + path: "/login", + query: { redirect: router.currentRoute.fullPath } // 从哪个页面跳转过来 + }); + }); + } + if( data.code != 20000){ + Message.error(data.message); + } + } + return data } }) export default service diff --git a/src/views/UDIDownload/jobLog.vue b/src/views/UDIDownload/jobLog.vue index 5da563d..d600690 100644 --- a/src/views/UDIDownload/jobLog.vue +++ b/src/views/UDIDownload/jobLog.vue @@ -110,6 +110,7 @@ +
+ + + + + + + 日期: + + + + + + + 查询 + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/src/views/udplat/udplatGoods.vue b/src/views/udplat/udplatGoods.vue new file mode 100644 index 0000000..eb7f7e0 --- /dev/null +++ b/src/views/udplat/udplatGoods.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/views/udplat/udplatHospital.vue b/src/views/udplat/udplatHospital.vue new file mode 100644 index 0000000..b4eee13 --- /dev/null +++ b/src/views/udplat/udplatHospital.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/src/views/udplat/udplatLog.vue b/src/views/udplat/udplatLog.vue new file mode 100644 index 0000000..2651b64 --- /dev/null +++ b/src/views/udplat/udplatLog.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/src/views/udplat/udplatManufacture.vue b/src/views/udplat/udplatManufacture.vue new file mode 100644 index 0000000..7e5512e --- /dev/null +++ b/src/views/udplat/udplatManufacture.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/vue.config.js b/vue.config.js index 5030579..bd8436a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,6 +1,7 @@ module.exports = { baseUrl: process.env.NODE_ENV === "production" ? "./" : "/", outputDir: process.env.outputDir, + //assetsDir: 'static', configureWebpack: config => { if (process.env.NODE_ENV === "production") { // 为生产环境修改配置... @@ -15,7 +16,14 @@ module.exports = { // 为开发环境修改配置... 'source-map' } - + /*config.performance={ + hints:'warning', + maxEntrypointSize:500000000, + maxAssetSize:50000000, + assetFilter:function (assetFilename){ + return assetFilename.endsWith('.js'); + } + }*/ }, chainWebpack: config => { config.plugin("html").tap(args => {