Commit 823c64d2 authored by 小费同学阿's avatar 小费同学阿 💬

文章管理

parent 663556a7
......@@ -67,14 +67,14 @@ export const constantRoutes = [
component: () => import('@/views/document-management/privacy-policy/privacy-policy'),
hidden: true
},
//设备详情页路由
// 设备详情页路由
{
path:'/equipment-management',
path: '/equipment-management',
component: Layout,
hidden: true,
permissions: ['*:*:*'],
children: [
//设备
// 设备
{
path: 'equipment-management/equipment-detail:id',
props: true,
......@@ -84,19 +84,19 @@ export const constantRoutes = [
meta: {
title: '设备详情',
icon: 'dashboard',
activeMenu: '/equipment-management/equipment-management',
activeMenu: '/equipment-management/equipment-management'
}
}
},
]
},
{
path:'/customer-management',
path: '/customer-management',
component: Layout,
hidden: true,
permissions: ['*:*:*'],
children: [
//设备
// 设备
{
path: 'pet-owner-management',
props: true,
......@@ -106,9 +106,9 @@ export const constantRoutes = [
meta: {
title: '宠主管理',
icon: 'dashboard',
activeMenu: '/customer-management/pet-owner-management',
activeMenu: '/customer-management/pet-owner-management'
}
}
},
]
},
......@@ -178,7 +178,7 @@ export const constantRoutes = [
name: 'ArticleDetail',
props: true,
meta: {
title: '文章详情',icon: 'component'
title: '文章详情', icon: 'component'
}
},
// 文章添加路由
......@@ -195,26 +195,26 @@ export const constantRoutes = [
]
},
//行政详情路由
// 行政详情路由
{
path:'/administrative-management',
path: '/administrative-management',
component: Layout,
hidden: true,
permissions: ['*:*:*'],
children: [
{
"name":"Department-management",
"path":"department-management",
"hidden":false,
'name': 'Department-management',
'path': 'department-management',
'hidden': false,
component: () => import('@/views/administrative-management/department-management/department-management'),
"meta":{
"title":"科室管理",
"icon":"download",
"noCache":false,
"link":null
'meta': {
'title': '科室管理',
'icon': 'download',
'noCache': false,
'link': null
}
},
//兽医
// 兽医
{
path: 'veterinary-management/veterinary-detail/:id',
props: true,
......@@ -224,10 +224,10 @@ export const constantRoutes = [
meta: {
title: '兽医详情',
icon: 'dashboard',
activeMenu: '/administrative-management/veterinary-management',
activeMenu: '/administrative-management/veterinary-management'
}
},
//人员
// 人员
{
path: 'personnel-management/personnel-detail/:id',
props: true,
......@@ -237,10 +237,10 @@ export const constantRoutes = [
meta: {
title: '人员详情',
icon: 'dashboard',
activeMenu: '/administrative-management/personnel-management',
activeMenu: '/administrative-management/personnel-management'
}
},
//科室
// 科室
{
path: 'department-management/department-detail/:id',
props: true,
......@@ -250,7 +250,7 @@ export const constantRoutes = [
meta: {
title: '科室详情',
icon: 'dashboard',
activeMenu: '/administrative-management/department-management',
activeMenu: '/administrative-management/department-management'
}
},
// 诊室
......@@ -263,7 +263,7 @@ export const constantRoutes = [
meta: {
title: '诊室详情',
icon: 'dashboard',
activeMenu: '/administrative-management/consulting-room-management',
activeMenu: '/administrative-management/consulting-room-management'
}
},
// 诊室新增
......@@ -276,21 +276,21 @@ export const constantRoutes = [
meta: {
title: '诊室新增',
icon: 'dashboard',
activeMenu: '/administrative-management/consulting-room-management',
activeMenu: '/administrative-management/consulting-room-management'
}
}
]
},
//病历路由
// 病历路由
{
path: '',
hidden: true,
component: Layout,
redirect: 'index',
children: [
//病历详情页
// 病历详情页
{
path:'/medical-detail/:id',
path: '/medical-detail/:id',
props: true,
permissions: ['*:*:*'],
component: () => import('@/views/medical-record-management/medical-detail'),
......@@ -298,20 +298,20 @@ export const constantRoutes = [
meta: {
title: '病历详情',
icon: 'dashboard',
activeMenu: '/medical-record-management',
activeMenu: '/medical-record-management'
}
},
//预约设备页面
// 预约设备页面
{
path:'/reservation-equipment/:id:pet',
path: '/reservation-equipment/:id:pet',
props: true,
permissions: ['*:*:*'],
component: ()=>import('@/views/medical-record-management/reservation-equipment'),
name:'ReservationEquipment',
meta:{
title:'预约设备',
icom:'dashboard',
activeMenu: '/medical-record-management/medical-detail',
component: () => import('@/views/medical-record-management/reservation-equipment'),
name: 'ReservationEquipment',
meta: {
title: '预约设备',
icom: 'dashboard',
activeMenu: '/medical-record-management/medical-detail'
}
}
]
......@@ -343,7 +343,7 @@ export const constantRoutes = [
component: () => import('@/views/hospital-management/hospital-update'),
name: 'HospitalUpdate',
meta: { title: '医院修改页', icon: 'dashboard', activeMenu: '/hospital-management' }
},
}
]
},
{
......@@ -448,7 +448,7 @@ export const dynamicRoutes = [
meta: {
title: '宠物主人详情',
icon: 'dashboard',
activeMenu: '/customer-management/pet-owner-management',
activeMenu: '/customer-management/pet-owner-management'
}
}, {
path: 'pet-management/pet-detail/:id',
......@@ -459,18 +459,18 @@ export const dynamicRoutes = [
meta: {
title: '宠物详情',
icon: 'dashboard',
activeMenu: '/customer-management/pet-management',
activeMenu: '/customer-management/pet-management'
}
}]
},
//行政详情路由
// 行政详情路由
{
path:'/administrative-management',
path: '/administrative-management',
component: Layout,
hidden: true,
permissions: ['*:*:*'],
children: [
//兽医
// 兽医
{
path: 'veterinary-management/veterinary-detail/:id',
props: true,
......@@ -480,10 +480,10 @@ export const dynamicRoutes = [
meta: {
title: '兽医详情',
icon: 'dashboard',
activeMenu: '/administrative-management/veterinary-management',
activeMenu: '/administrative-management/veterinary-management'
}
},
//人员
// 人员
{
path: 'personnel-management/personnel-detail/:id',
props: true,
......@@ -493,10 +493,10 @@ export const dynamicRoutes = [
meta: {
title: '人员详情',
icon: 'dashboard',
activeMenu: '/administrative-management/personnel-management',
activeMenu: '/administrative-management/personnel-management'
}
},
//科室
// 科室
{
path: 'department-management/department-detail/:id',
props: true,
......@@ -506,16 +506,16 @@ export const dynamicRoutes = [
meta: {
title: '科室详情',
icon: 'dashboard',
activeMenu: '/administrative-management/department-management',
activeMenu: '/administrative-management/department-management'
}
}
]
},
}
]
// 防止连续点击多次路由报错
let routerPush = Router.prototype.push;
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(err => err)
}
......
......@@ -4,15 +4,17 @@
<el-card class="box-card">
<!-- 头部标题-->
<div style="padding-top:32px;text-align: center;">
<span style="font-size: 24px;
<span
style="font-size: 24px;
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
font-weight: bold;
color: #333333;">查看</span>
color: #333333;"
>查看</span>
</div>
<div style="padding: 20px;">
<div style="display: flex">
<!-- 文章信息 -->
<div class="tip-green"/>
<div class="tip-green" />
<div
style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei;font-weight: bold;color: #333333;"
>文章信息
......@@ -23,18 +25,23 @@ color: #333333;">查看</span>
<div style="display:flex;">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item style="padding-top: 32px;" label="文章标题" prop="articleTitle">
<el-input disabled v-model="form.articleTitle" placeholder="请输入文章标题"/>
<el-input v-model="form.articleTitle" disabled placeholder="请输入文章标题" />
</el-form-item>
<el-form-item label="权重" prop="articleWeight">
<el-input-number disabled v-model="form.articleWeight" :max="9999" :min="1" controls-position="right"
></el-input-number>
<el-input-number
v-model="form.articleWeight"
disabled
:max="9999"
:min="1"
controls-position="right"
/>
</el-form-item>
<el-form-item label="文章封面" prop="articleCover">
<!-- 0-- 文章信息的页面--文章封面 -->
<div class="base-msg">
<div class="petPicture" style="padding-bottom: 20px;">
<el-card shadow="hover" style="width: 150px;height: 150px;position: center">
<el-image :src="baseURL+form.articleCover" fit="cover"/>
<el-image :src="baseURL+form.articleCover" fit="cover" />
</el-card>
</div>
</div>
......@@ -43,14 +50,13 @@ color: #333333;">查看</span>
<div style="display: flex; ">
<div style="padding-right: 15px;">
<el-switch
disabled
v-model="form.articleStatus"
disabled
active-color="#13ce66"
active-value="0"
inactive-color="#ff4949"
inactive-value="1"
>
</el-switch>
/>
</div>
<div v-if="form.articleStatus==='0'" style="padding-top: 1px;">已上架</div>
<div v-else-if="form.articleStatus==='1'" style="padding-top: 1px;">已下架</div>
......@@ -59,7 +65,7 @@ color: #333333;">查看</span>
<!-- 2-- 文章信息--文章内容 -->
<div style="display: flex">
<!-- 文章内容-->
<div class="tip-green"/>
<div class="tip-green" />
<div
style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei;font-weight: bold;color: #333333;"
>文章内容
......@@ -68,7 +74,7 @@ color: #333333;">查看</span>
<!-- 2-- 文章信息的页面--文章内容 -->
<div class="base-msg" style="padding-top: 32px; padding-bottom: 20px; padding-left: 1%;">
<el-row>
<div v-html="form.articleContent"></div>
<div v-html="form.articleContent" />
</el-row>
</div>
</el-form>
......@@ -84,13 +90,13 @@ color: #333333;">查看</span>
</template>
<script>
//导入获取文章信息的接口
// 导入获取文章信息的接口
import { checkRole } from '@/utils/permission'
import { selectDictLabel } from '@/utils/ruoyi'
import { addArticle, getArticle, listArticle, updateArticle } from '@/api/business/article'
import { addArticle, getArticle, updateArticle } from '@/api/business/article'
export default {
name: 'article-edit',
name: 'ArticleEdit',
// 数据字典
dicts: ['article_status'],
......@@ -112,7 +118,7 @@ export default {
open: false,
// 状态位
value: true,
// 表单参数
// 表单参数
form: {},
// 表单校验
rules: {
......@@ -187,7 +193,6 @@ export default {
.box-card {
}
//模块tip样式--绿色
.tip-green {
height: 30px;
......@@ -222,7 +227,6 @@ export default {
//margin-left: 5%;
}
//表格内容选中后的样式-all
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #F6FCF5 !important;
......
......@@ -4,15 +4,17 @@
<el-card class="box-card">
<!-- 头部标题-->
<div style="padding-top:32px;text-align: center;">
<span style="font-size: 24px;
<span
style="font-size: 24px;
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
font-weight: bold;
color: #333333;">编辑</span>
color: #333333;"
>编辑</span>
</div>
<div style="padding: 20px;">
<div style="display: flex">
<!-- 0-- 文章信息--标签头 -->
<div class="tip-green"/>
<div class="tip-green" />
<div style="padding-top: 3px;padding-left: 18px; color: #666666; font-weight: 600; font-size: 17px;">文章信息
</div>
</div>
......@@ -21,32 +23,36 @@ color: #333333;">编辑</span>
<div style="display:flex;">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="form.articleTitle" placeholder="请输入文章标题"/>
<el-input v-model="form.articleTitle" placeholder="请输入文章标题" />
</el-form-item>
<el-form-item label="权重" prop="articleWeight">
<el-input-number v-model="form.articleWeight" :max="9999" :min="1" controls-position="right"
></el-input-number>
<el-input-number
v-model="form.articleWeight"
:max="9999"
:min="1"
controls-position="right"
/>
</el-form-item>
<el-form-item label="文章封面" prop="articleCover">
<image-upload v-model="form.articleCover" limit="1"/>
<image-upload v-model="form.articleCover" limit="1" />
</el-form-item>
<el-form-item label="状态" prop="articleStatus">
<div style="display: flex;">
<div style="padding-right: 15px;">
<el-switch v-model="form.articleStatus"
<el-switch
v-model="form.articleStatus"
active-color="#13ce66"
active-value="0"
inactive-color="#ff4949"
inactive-value="1"
>
</el-switch>
/>
</div>
<div v-if="form.articleStatus==='0'" style="padding-top: 1px;">已上架</div>
<div v-else-if="form.articleStatus==='1'" style="padding-top: 1px;">已下架</div>
</div>
</el-form-item>
<el-form-item label="文章内容">
<editor v-model="form.articleContent" :min-height="192"/>
<editor v-model="form.articleContent" :min-height="192" />
</el-form-item>
</el-form>
</div>
......@@ -62,13 +68,13 @@ color: #333333;">编辑</span>
</template>
<script>
//导入获取文章信息的接口
// 导入获取文章信息的接口
import { checkRole } from '@/utils/permission'
import { selectDictLabel } from '@/utils/ruoyi'
import { addArticle, getArticle, listArticle, updateArticle } from '@/api/business/article'
import { addArticle, getArticle, updateArticle } from '@/api/business/article'
export default {
name: 'article-edit',
name: 'ArticleEdit',
// 数据字典
dicts: ['article_status'],
......@@ -87,7 +93,7 @@ export default {
open: false,
// 状态位
value: true,
// 表单参数
// 表单参数
form: {},
// 表单校验
rules: {
......@@ -163,7 +169,6 @@ export default {
margin: 20px 20px 20px 20px;
}
//模块tip样式--绿色
.tip-green {
height: 30px;
......@@ -198,7 +203,6 @@ export default {
margin-left: 5%;
}
//表格内容选中后的样式-all
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #F6FCF5 !important;
......
......@@ -4,15 +4,17 @@
<el-card class="box-card">
<!-- 头部标题-->
<div style="padding-top:32px;text-align: center;">
<span style="font-size: 24px;
<span
style="font-size: 24px;
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
font-weight: bold;
color: #333333;">新增</span>
color: #333333;"
>新增</span>
</div>
<div style="padding: 20px;">
<div style="display: flex">
<!-- 0-- 文章信息--标签头 -->
<div class="tip-green"/>
<div class="tip-green" />
<div style="padding-top: 3px;padding-left: 18px; color: #666666; font-weight: 600; font-size: 17px;">文章信息
</div>
</div>
......@@ -21,31 +23,31 @@ color: #333333;">新增</span>
<div style="display:flex;">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="form.articleTitle" maxlength="40" show-word-limit placeholder="请输入文章标题"/>
<el-input v-model="form.articleTitle" maxlength="40" show-word-limit placeholder="请输入文章标题" />
</el-form-item>
<el-form-item label="权重" prop="articleWeight">
<el-input-number v-model="form.articleWeight" :min="1" :max="9999" controls-position="right"></el-input-number>
<el-input-number v-model="form.articleWeight" :min="1" :max="9999" controls-position="right" />
</el-form-item>
<el-form-item label="文章封面" prop="articleCover">
<image-upload v-model="form.articleCover" limit="1"/>
<image-upload v-model="form.articleCover" limit="1" />
</el-form-item>
<el-form-item label="状态" prop="articleStatus">
<div style="display: flex;">
<div style="padding-right: 15px;">
<el-switch v-model="form.articleStatus"
<el-switch
v-model="form.articleStatus"
active-color="#13ce66"
active-value="0"
inactive-color="#ff4949"
inactive-value="1"
>
</el-switch>
/>
</div>
<div v-if="form.articleStatus==='0'" style="padding-top: 1px;">已上架</div>
<div v-else-if="form.articleStatus==='1'" style="padding-top: 1px;">已下架</div>
</div>
</el-form-item>
<el-form-item label="文章内容">
<editor v-model="form.articleContent" :min-height="192"/>
<editor v-model="form.articleContent" :min-height="192" />
</el-form-item>
</el-form>
</div>
......@@ -61,13 +63,12 @@ color: #333333;">新增</span>
</template>
<script>
//导入获取文章信息的接口
import { checkRole } from '@/utils/permission'
// 导入获取文章信息的接口
import { selectDictLabel } from '@/utils/ruoyi'
import { addArticle, getArticle, listArticle, updateArticle } from '@/api/business/article'
import { addArticle } from '@/api/business/article'
export default {
name: 'article-insert',
name: 'ArticleInsert',
// 数据字典
dicts: ['article_status'],
......@@ -86,14 +87,14 @@ export default {
open: false,
// 状态位
value: true,
// 表单参数
// 表单参数
form: {
// 权重
articleWeight: '0',
// 状态位
articleStatus: '0',
// 创建时间
articleCreateTime:''
articleCreateTime: ''
},
// 表单校验
rules: {
......@@ -107,7 +108,7 @@ export default {
this.addDate()
},
methods: {
//获取当前年月日
// 获取当前年月日
addDate() {
const nowDate = new Date()
const date = {
......@@ -118,7 +119,6 @@ export default {
const newmonth = date.month > 10 ? date.month : '0' + date.month
const day = date.date > 10 ? date.date : '0' + date.date
this.form.articleCreateTime = date.year + '-' + newmonth + '-' + day
},
/** 提交按钮 */
submitForm() {
......@@ -149,7 +149,6 @@ export default {
margin: 20px 20px 20px 20px;
}
//模块tip样式--绿色
.tip-green {
height: 30px;
......@@ -184,7 +183,6 @@ export default {
margin-left: 5%;
}
//表格内容选中后的样式-all
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #F6FCF5 !important;
......
......@@ -3,15 +3,15 @@
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<el-row>
<el-col :span="12" class="left-login">
<img class="logo-login" src="../assets/images/logo1.png" />
<img class="logo-login" src="../assets/images/logo1.png">
<div class="chinese-title">萌宠医院信息管理系统</div>
<span class="english-title">Pet Hospital Information Management System</span>
<img class="picture-login" src="../assets/images/pic1.png" />
<img class="picture-login" src="../assets/images/pic1.png">
</el-col>
<el-col :span="12" class="right-login">
<div class="right-layout">
<div class="top">
<img class="question-mark" src="../assets/images/shuoming.png" /> 登录说明
<img class="question-mark" src="../assets/images/shuoming.png"> 登录说明
</div>
<h3 class="title">用户登录 User Login</h3>
<div class="welcome">欢迎来到萌宠医院信息管理系统平台,请登录您的账号!</div>
......@@ -41,7 +41,7 @@
</el-input>
</el-form-item>
<div class="input-prompt">验证码</div>
<el-form-item prop="code" v-if="captchaEnabled">
<el-form-item v-if="captchaEnabled" prop="code">
<el-input
v-model="loginForm.code"
auto-complete="off"
......@@ -52,7 +52,7 @@
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
<img :src="codeUrl" class="login-code-img" @click="getCode">
</div>
</el-form-item>
<el-form-item style="width:100%;">
......@@ -67,7 +67,7 @@
</el-button>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-button style="position: absolute; right: 40px" type="text">忘记密码</el-button>
<div style="float: right;" v-if="register">
<div v-if="register" style="float: right;">
<router-link class="link-type" :to="'/register'">立即注册</router-link>
</div>
</el-form-item>
......@@ -83,30 +83,30 @@
</template>
<script>
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie'
import { encrypt, decrypt } from '@/utils/jsencrypt'
export default {
name: "Login",
name: 'Login',
data() {
return {
codeUrl: "",
codeUrl: '',
loginForm: {
username: "admin",
password: "admin123",
username: 'admin',
password: 'admin123',
rememberMe: false,
code: "",
uuid: ""
code: '',
uuid: ''
},
loginRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" }
{ required: true, trigger: 'blur', message: '请输入您的账号' }
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" }
{ required: true, trigger: 'blur', message: '请输入您的密码' }
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
code: [{ required: true, trigger: 'change', message: '请输入验证码' }]
},
loading: false,
// 验证码开关
......@@ -114,66 +114,66 @@ export default {
// 注册开关
register: false,
redirect: undefined
};
}
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect;
this.redirect = route.query && route.query.redirect
},
immediate: true
}
},
created() {
this.getCode();
this.getCookie();
this.getCode()
this.getCookie()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
this.codeUrl = 'data:image/gif;base64,' + res.img
this.loginForm.uuid = res.uuid
}
});
})
},
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const username = Cookies.get('username')
const password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
};
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true;
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
Cookies.set('username', this.loginForm.username, { expires: 30 })
Cookies.set('password', encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
this.$store.dispatch('Login', this.loginForm).then(() => {
this.$router.push({ path: this.redirect || '/' }).catch(() => {})
}).catch(() => {
this.loading = false;
this.loading = false
if (this.captchaEnabled) {
this.getCode();
this.getCode()
}
});
})
}
});
})
}
}
};
}
</script>
<style>
......
This diff is collapsed.
......@@ -33,13 +33,13 @@ module.exports = {
}
}
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分,具体配置参考文档
module.exports = {
// 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
......@@ -64,12 +64,13 @@ module.exports = {
port: port,
open: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Origin': '*'
},
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8091`,
// target: `http://localhost:8091`,
target: `http://114.67.241.140:8091`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
......@@ -90,7 +91,7 @@ module.exports = {
output: {
library: 'pet-business-web',
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_pet-business-web`,
jsonpFunction: `webpackJsonp_pet-business-web`
},
resolve: {
alias: {
......@@ -106,7 +107,7 @@ module.exports = {
algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8 // 压缩率小于1才会压缩
})
],
]
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test
......@@ -166,8 +167,8 @@ module.exports = {
})
config.optimization.runtimeChunk('single'),
{
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
to: './' //到根目录下
from: path.resolve(__dirname, './public/robots.txt'), // 防爬虫文件
to: './' // 到根目录下
}
}
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment