This commit is contained in:
duanxiaohai 2024-07-17 16:46:45 +08:00
commit dc41019941
5 changed files with 120 additions and 112 deletions

View File

@ -1,17 +1,16 @@
import axios from 'axios'; import axios from "axios";
import { ElMessage } from 'element-plus' import { ElMessage } from "element-plus";
import tools from '@/utils/tools' import tools from "@/utils/tools";
import router from '../router'; import router from "../router";
// axios.defaults.baseURL = '/api' // axios.defaults.baseURL = '/api'
axios.defaults.timeout = 120000 axios.defaults.timeout = 120000;
// HTTP request 拦截器 // HTTP request 拦截器
axios.interceptors.request.use( axios.interceptors.request.use(
(config) => { (config) => {
let token = tools.data.get('token'); let token = tools.data.get("token");
if (token) { if (token) {
config.headers['x-token'] = token config.headers["x-token"] = token;
} }
return config; return config;
}, },
@ -31,14 +30,14 @@ axios.interceptors.response.use(
ElMessage.error("请重新登录!"); ElMessage.error("请重新登录!");
// window.location.href = '/#/login?returnURL=' + window.location.href // window.location.href = '/#/login?returnURL=' + window.location.href
window.location.href = window.location.href =
'http://220.191.238.50:996/api/login?returnURL=' + "http://220.191.238.50:996/api/login?returnURL=" +
window.location.href window.location.href;
} else if (error.response.status == 404) { } else if (error.response.status == 404) {
ElMessage.error("Status:404正在请求不存在的服务器记录"); ElMessage.error("Status:404正在请求不存在的服务器记录");
} else if (error.response.status == 500) { } else if (error.response.status == 500) {
ElMessage.error({ ElMessage.error({
title: '请求错误', title: "请求错误",
message: "Status:500服务器发生错误" message: "Status:500服务器发生错误",
}); });
} else { } else {
ElMessage.error(`Status:${error.response.status},未知错误!`); ElMessage.error(`Status:${error.response.status},未知错误!`);
@ -51,15 +50,15 @@ axios.interceptors.response.use(
); );
var http = { var http = {
/** get /** get
* @param {接口地址} url * @param {接口地址} url
* @param {请求参数} params * @param {请求参数} params
*/ */
get: function (url, params) { get: function (url, params) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.get(url, { axios
params: params .get(url, {
params: params,
}) })
.then((response) => { .then((response) => {
if (response.data.code == 400 && response.data.msg) { if (response.data.code == 400 && response.data.msg) {
@ -70,7 +69,7 @@ var http = {
.catch((error) => { .catch((error) => {
reject(error); reject(error);
}); });
}) });
}, },
/** post /** post
@ -79,7 +78,8 @@ var http = {
*/ */
post: function (url, params) { post: function (url, params) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.post(url, params) axios
.post(url, params)
.then((response) => { .then((response) => {
if (response.data.code == 400 && response.data.msg) { if (response.data.code == 400 && response.data.msg) {
ElMessage.error(response.data.msg); ElMessage.error(response.data.msg);
@ -89,12 +89,13 @@ var http = {
.catch((error) => { .catch((error) => {
reject(error); reject(error);
}); });
}) });
}, },
put: function (url, params) { put: function (url, params) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.put(url, params) axios
.put(url, params)
.then((response) => { .then((response) => {
if (response.data.code == 400 && response.data.msg) { if (response.data.code == 400 && response.data.msg) {
ElMessage.error(response.data.msg); ElMessage.error(response.data.msg);
@ -104,12 +105,13 @@ var http = {
.catch((error) => { .catch((error) => {
reject(error); reject(error);
}); });
}) });
}, },
delete: function (url, params) { delete: function (url, params) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.delete(url, params) axios
.delete(url, params)
.then((response) => { .then((response) => {
if (response.data.code == 400 && response.data.msg) { if (response.data.code == 400 && response.data.msg) {
ElMessage.error(response.data.msg); ElMessage.error(response.data.msg);
@ -119,14 +121,14 @@ var http = {
.catch((error) => { .catch((error) => {
reject(error); reject(error);
}); });
}) });
}, },
download: function (url) { download: function (url) {
let user = tools.data.get('user'); let user = tools.data.get("user");
let token = "x-token=" + user.token; let token = "x-token=" + user.token;
url = url + (url.indexOf("?") > 0 ? "&" : "?") + token; url = url + (url.indexOf("?") > 0 ? "&" : "?") + token;
window.open(url); window.open(url);
} },
} };
export default http; export default http;

View File

@ -864,6 +864,7 @@ onBeforeUnmount(() => {
} }
.left_1 { .left_1 {
cursor: pointer;
background-image: url(@/assets/images/sjfx/lnsjfx.png); background-image: url(@/assets/images/sjfx/lnsjfx.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;

View File

@ -561,7 +561,7 @@ const selectChange2 = () => {
setTimeout(() => { setTimeout(() => {
showR.value = true; showR.value = true;
}, 300); }, 100);
}; };
// const ratingBtn = (item) => { // const ratingBtn = (item) => {
@ -1568,6 +1568,7 @@ onMounted(() => {
.schoolbs { .schoolbs {
// width: 128px; // width: 128px;
cursor: pointer;
height: 41px; height: 41px;
padding: 0px 20px 0 30px; padding: 0px 20px 0 30px;
background-image: url(@/assets/eduImg/jyImg1.png); background-image: url(@/assets/eduImg/jyImg1.png);

View File

@ -413,6 +413,7 @@
class="ylws_item" class="ylws_item"
v-for="(item, index) in data.ylwsList" v-for="(item, index) in data.ylwsList"
:key="index" :key="index"
:style="{'cursor': item.name=='医院卫生院' ? 'pointer' : ''}"
@click="showDialog2(item.name, '/api/ggfwyth/yywsyList')" @click="showDialog2(item.name, '/api/ggfwyth/yywsyList')"
> >
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
@ -2507,6 +2508,7 @@ onBeforeMount(async () => {
justify-content: space-around; justify-content: space-around;
&_item { &_item {
cursor: pointer;
box-sizing: border-box; box-sizing: border-box;
width: 160px; width: 160px;
height: 112px; height: 112px;
@ -3184,6 +3186,7 @@ table {
margin-bottom: 15px; margin-bottom: 15px;
padding-top: 20px; padding-top: 20px;
.jtsyBoxtop1 { .jtsyBoxtop1 {
cursor: pointer;
position: relative; position: relative;
display: flex; display: flex;
overflow: hidden; overflow: hidden;

View File

@ -1087,6 +1087,7 @@ const getData = () => {
align-items: center; align-items: center;
.history1 { .history1 {
cursor: pointer;
font-size: 26px; font-size: 26px;
color: #ffffff; color: #ffffff;
line-height: 30px; line-height: 30px;