新闻分页

This commit is contained in:
quantulr
2024-03-05 17:25:48 +08:00
parent 570c3f2112
commit 3afb373403
18 changed files with 2035 additions and 1886 deletions

View File

@ -5,3 +5,8 @@ export const listNews = (params) => request({
method: "GET",
params
});
export const getNewsInfo = (id) => request({
url: `/app/news/${id}`,
method: "GET",
})

View File

@ -10,16 +10,25 @@
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath == '/' ? 'active' : ''"
:class="pagePath === '/' ? 'active' : ''"
@click="handlePath('/')"
>
{{ t("headerMenu.home") }}
</div>
</li>
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath === '/news' ? 'active' : ''"
@click="handlePath('/news')"
>
{{ t("headerMenu.news") }}
</div>
</li>
<li class="menu-item1 solution">
<div
class="menu-item-tit"
:class="pagePath.indexOf('/solution/') != -1 ? 'active' : ''"
:class="pagePath.indexOf('/solution/') !== -1 ? 'active' : ''"
>
{{ t("headerMenu.resolution") }}
</div>
@ -28,7 +37,7 @@
v-for="item in categoryList"
class="pointer"
:class="
pagePath == `/solution/${item.id}` ? 'x_blue _active' : ''
pagePath === `/solution/${item.id}` ? 'x_blue _active' : ''
"
@click="
handlePath(
@ -79,7 +88,7 @@
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath == '/innovate' ? 'active' : ''"
:class="pagePath === '/innovate' ? 'active' : ''"
@click="handlePath('/innovate')"
>
{{ t("headerMenu.innovation") }}
@ -88,7 +97,7 @@
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath == '/activity' ? 'active' : ''"
:class="pagePath === '/activity' ? 'active' : ''"
@click="handlePath('/activity')"
>
{{ t("headerMenu.activity") }}
@ -97,7 +106,7 @@
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath == '/about' ? 'active' : ''"
:class="pagePath === '/about' ? 'active' : ''"
@click="handlePath('/about')"
>
{{ t("headerMenu.aboutUs") }}
@ -107,7 +116,7 @@
<div
v-if="!userStore.token"
class="menu-item-tit"
:class="pagePath == '/login' ? 'active' : ''"
:class="pagePath === '/login' ? 'active' : ''"
@click="handlePath('/login')"
>
{{ t("headerMenu.loginRegister") }}
@ -137,7 +146,7 @@
<div
v-if="userStore.token"
class="menu-item-tit"
:class="pagePath == '/login' ? 'active' : ''"
:class="pagePath === '/login' ? 'active' : ''"
@click="handlePage"
>
{{ t("headerMenu.personalCenter") }}
@ -145,7 +154,7 @@
<div
v-if="userStore.token"
class="menu-item-tit"
:class="pagePath == '/login' ? 'active' : ''"
:class="pagePath === '/login' ? 'active' : ''"
@click="logout"
>
{{ t("headerMenu.logout") }}
@ -352,7 +361,7 @@ dt {
display: inline-block;
padding: 25px 0;
font-size: 16px;
font-family: Source Han Sans CN;
font-family: Source Han Sans CN, sans-serif;
font-weight: 400;
color: #000;
cursor: pointer;
@ -398,6 +407,7 @@ dt {
.webHead {
.site-title {
padding-top: 8px;
height: 80px;
display: flex;
justify-content: start;
@ -407,10 +417,10 @@ dt {
font-weight: bold;
.site-logo {
width: 30px;
height: 30px;
object-fit: cover;
margin-right: 4px;
width: 90px;
height: 82px;
object-fit: contain;
margin-right: 8px;
}
}

View File

@ -4,9 +4,9 @@ import webContact_zh from "@/i18n/message/webContact/zh";
import webContact_ru from "@/i18n/message/webContact/ru";
import activity_ru from "@/i18n/message/activity/ru";
import activity_zh from "@/i18n/message/activity/zh";
import { admin_ru, admin_zh } from "@/i18n/message/admin";
import { routes_ru, routes_zh } from "@/i18n/message/routes";
import { tagsView_ru, tagsView_zh } from "@/i18n/message/tagsView";
import {admin_ru, admin_zh} from "@/i18n/message/admin";
import {routes_ru, routes_zh} from "@/i18n/message/routes";
import {tagsView_ru, tagsView_zh} from "@/i18n/message/tagsView";
import common_zh from "@/i18n/message/common/zh";
import common_ru from "@/i18n/message/common/ru";
import dict_zh from "@/i18n/message/dict/zh";
@ -39,6 +39,7 @@ const messages = {
switchSystem: "切换系统",
layoutSettings: "布局设置",
changeAvatar: "更换头像",
news: "新闻政策"
},
footer: {
copyRight: "中科云 版权所有",
@ -163,6 +164,7 @@ const messages = {
switchSystem: "Переключить систему",
layoutSettings: "Настройки макета",
changeAvatar: "Сменить аватар",
news: "Пресс-политика"
},
footer: {
copyRight: "Чжункейун Авторское право",

View File

@ -23,7 +23,7 @@ const table = {
cooperationMemo: "Совместный протокол",
customerConfirmSolution: "Подтверждение технического решения клиентом",
signServiceContract: "Подписание сервисного контракта (сумма контракта)",
endTopic: "Закрыть тему",
endTopic: "Закрыть тему (Полученная сумма)",
notEndTopic: "Тема не закрыта",
uploadFile: "Загрузить файл",
uploadTime: "Время загрузки",

View File

@ -23,7 +23,7 @@ const table = {
cooperationMemo: "合作备忘录",
customerConfirmSolution: "客户确认技术解决方案",
signServiceContract: "签署服务合同(合同额)",
endTopic: "结题",
endTopic: "结题(到款金额)",
notEndTopic: "未结题",
uploadFile: "上传文件",
uploadTime: "上传时间",

View File

@ -53,7 +53,7 @@
<script setup>
import variables from "@/assets/styles/variables.module.scss";
import logo from "@/assets/logo/logo.png";
import logoSmall from "@/assets/logo/logo_small.png";
import logoSmall from "@/assets/logo/咸海logo.png";
import useSettingsStore from "@/store/modules/settings";
import { useI18n } from "vue-i18n";

View File

@ -1,21 +1,22 @@
import router from "./router";
import { ElMessage } from "element-plus";
import {ElMessage} from "element-plus";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { getToken } from "@/utils/auth";
import { isHttp } from "@/utils/validate";
import { isRelogin } from "@/utils/request";
import {getToken} from "@/utils/auth";
import {isHttp} from "@/utils/validate";
import {isRelogin} from "@/utils/request";
import useUserStore from "@/store/modules/user";
import useSettingsStore from "@/store/modules/settings";
import usePermissionStore from "@/store/modules/permission";
NProgress.configure({ showSpinner: false });
NProgress.configure({showSpinner: false});
const whiteList = [
"/login",
"/auth-redirect",
"/bind",
"/register",
"/news",
"/",
"/solution/small",
"/solution/large",
@ -27,6 +28,7 @@ const whiteList = [
];
const whiteListReg = [
/\/solution\/detail\/[0-9]+/,
/\/news\/detail\/[0-9]+/,
/\/solution\/[0-9]+/,
/\/innovate\/detail\/[0-9]+/,
/\/searchList\/[\S]+/,
@ -38,7 +40,7 @@ router.beforeEach((to, from, next) => {
to.meta.title && useSettingsStore().setTitle(to.meta.title);
/* has token*/
if (to.path === "/login") {
next({ path: "/" });
next({path: "/"});
NProgress.done();
} else {
if (useUserStore().roles.length === 0) {
@ -59,7 +61,7 @@ router.beforeEach((to, from, next) => {
router.addRoute(route); // 动态添加可访问路由表
}
});
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
next({...to, replace: true}); // hack方法 确保addRoutes已完成
});
})
.catch((err) => {
@ -68,7 +70,7 @@ router.beforeEach((to, from, next) => {
.logOut()
.then(() => {
ElMessage.error(err);
next({ path: "/" });
next({path: "/"});
});
});
} else {

View File

@ -1,4 +1,4 @@
import { createRouter, createWebHistory } from "vue-router";
import {createRouter, createWebHistory} from "vue-router";
/* Layout */
import Layout from "@/layout";
import basicInfo from "../views/admin/enterprise/account/basicInfo.vue";
@ -25,7 +25,7 @@ import i18n from "@/i18n";
activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
}
*/
const { t } = i18n.global;
const {t} = i18n.global;
// 公共路由
export const constantRoutes = [
{
@ -198,6 +198,16 @@ export const constantRoutes = [
name: "about",
component: () => import("../views/website/about/about.vue"),
},
{
path: "news",
name: 'news-list',
component: () => import("../views/website/home/index.vue"),
},
{
path: "news/detail/:id",
name: 'news',
component: () => import("@/views/website/news/detail.vue")
}
],
},
@ -241,37 +251,37 @@ export const constantRoutes = [
path: "index",
component: () => import("@/views/identity/index"),
name: "index",
meta: { title: "身份选择" },
meta: {title: "身份选择"},
},
{
path: "enterprise",
component: () => import("@/views/identity/enterprise"),
name: "enterprise",
meta: { title: "企业入驻" },
meta: {title: "企业入驻"},
},
{
path: "expert",
component: () => import("@/views/identity/expert"),
name: "expert",
meta: { title: "专家入驻" },
meta: {title: "专家入驻"},
},
{
path: "research",
component: () => import("@/views/identity/research"),
name: "research",
meta: { title: "研究机构入驻" },
meta: {title: "研究机构入驻"},
},
{
path: "laboratory",
component: () => import("@/views/identity/laboratory"),
name: "laboratory",
meta: { title: "实验室入驻" },
meta: {title: "实验室入驻"},
},
{
path: "agent",
component: () => import("@/views/identity/agent"),
name: "agent",
meta: { title: "科技经纪人入驻" },
meta: {title: "科技经纪人入驻"},
},
],
}, //TODO:
@ -299,7 +309,7 @@ export const constantRoutes = [
path: "profile",
component: () => import("@/views/system/user/profile/index"),
name: "Profile",
meta: { title: "个人中心", icon: "user" },
meta: {title: "个人中心", icon: "user"},
},
],
},
@ -1341,7 +1351,7 @@ const router = createRouter({
if (savedPosition) {
return savedPosition;
} else {
return { top: 0 };
return {top: 0};
}
},
});

View File

@ -3,9 +3,10 @@ import Cookies from "js-cookie";
const useAppStore = defineStore("app", {
state: () => ({
sidebar: {
opened: Cookies.get("sidebarStatus")
? !!+Cookies.get("sidebarStatus")
: true,
// opened: Cookies.get("sidebarStatus")
// ? !!+Cookies.get("sidebarStatus")
// : true,
opened: true,
withoutAnimation: false,
hide: false,
},

View File

@ -161,7 +161,7 @@ if (route.query.id) {
<el-col :span="12">
<el-form-item
v-if="index === 2 || index === 3"
:label="t('admin.form.amount')"
:label="`${t('admin.form.amount')}${t('admin.table.tenThousandYuan')}`"
>
<el-input-number
v-model="updateStatusList[index].remark"

View File

@ -57,7 +57,7 @@
<el-row>
<el-col :span="24">
<el-form-item :label="t('admin.form.workLocation')" prop="wordAddress">
<el-input v-model="modelValue.wordAddress" />
<el-input v-model="modelValue.wordAddress"/>
</el-form-item>
</el-col>
</el-row>
@ -74,7 +74,7 @@
</el-col>
</el-row>
<field-options ref="researchsFormRef" v-model="modelValue" />
<field-options ref="researchsFormRef" v-model="modelValue"/>
<InputBoxAdd
ref="keywordsFormRef"
@ -87,7 +87,7 @@
<el-row v-if="isAdd">
<el-col :span="24">
<el-form-item :label="t('admin.form.idCard')">
<el-form-item :label="t('admin.form.idCard')" prop="idImage">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item prop="idImage.0">
@ -155,10 +155,10 @@
<script setup>
import InputBoxAdd from "../InputBoxAdd";
import FieldOptions from "../FieldOptions";
import { computed, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
import {computed, reactive, ref} from "vue";
import {useI18n} from "vue-i18n";
const { t } = useI18n();
const {t} = useI18n();
const formRef = ref();
const researchsFormRef = ref();
const keywordsFormRef = ref();
@ -206,11 +206,11 @@ const rules = reactive({
trigger: "blur",
},
],
mobile: [
phone: [
{
required: true,
message: computed(() =>
t("admin.form.placeholder", { type: t("admin.form.mobile") })
t("admin.form.placeholder", {type: t("admin.form.mobile")})
),
trigger: "blur",
},
@ -220,12 +220,20 @@ const rules = reactive({
// trigger: "blur",
// },
],
email: [
{
required: true,
message: computed(() =>
t("admin.form.placeholder", {type: t("admin.form.email")})
),
trigger: "blur",
},],
idCard: [
// {
// required: true,
// message: computed(() => t("admin.form.placeholder")),
// trigger: "blur",
// },
{
required: true,
message: computed(() => t("admin.form.placeholder")),
trigger: "blur",
},
],
wordAddress: [
{
@ -241,34 +249,41 @@ const rules = reactive({
trigger: "blur",
},
],
idImage: [
{
required: true,
trigger: "change",
message: computed(() => t("admin.validation.pleaseUpload")),
}
],
"idImage.0": [
// {
// required: true,
// message: computed(() => t("admin.validation.pleaseUpload")),
// trigger: ["blur", "change"],
// },
],
"idImage.1": [
// {
// required: true,
// message: computed(() => t("admin.validation.pleaseUpload")),
// trigger: ["blur", "change"],
// },
],
"idImage.2": [
// {
// required: true,
// message: computed(() => t("admin.validation.pleaseUpload")),
// trigger: ["blur", "change"],
// },
],
certificatePics: [
{
required: true,
message: computed(() => t("admin.validation.pleaseUpload")),
trigger: ["blur", "change"],
},
],
"idImage.1": [
{
required: true,
message: computed(() => t("admin.validation.pleaseUpload")),
trigger: ["blur", "change"],
},
],
"idImage.2": [
{
required: true,
message: computed(() => t("admin.validation.pleaseUpload")),
trigger: ["blur", "change"],
},
],
certificatePics: [
// {
// required: true,
// message: computed(() => t("admin.validation.pleaseUpload")),
// trigger: ["blur", "change"],
// },
],
});
const validateForm = async () => {

View File

@ -9,13 +9,13 @@
{{ t("admin.form.basicInfo") }}
</div>
<el-row>
<el-col :span="24">
<el-form-item :label="t('admin.form.expertAvatar')">
<ImageUpload v-model="modelValue.image" :limit="1" />
</el-form-item>
</el-col>
</el-row>
<!--FIXME: <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item :label="t('admin.form.expertAvatar')">-->
<!-- <ImageUpload v-model="modelValue.image" :limit="1" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="12">
@ -240,11 +240,11 @@
<script name="ExpertForm" setup>
import FieldOptions from "@/views/components/FieldOptions";
import InputBoxAdd from "@/views/components/InputBoxAdd";
import { countryOptions, educationOptions } from "@/utils/parameter";
import { useI18n } from "vue-i18n";
import { computed, toRefs } from "vue";
import {countryOptions, educationOptions} from "@/utils/parameter";
import {useI18n} from "vue-i18n";
import {computed, onActivated, reactive, ref, toRefs} from "vue";
const { t, locale } = useI18n();
const {t, locale} = useI18n();
const props = defineProps({
modelValue: Object,
@ -261,7 +261,7 @@ const props = defineProps({
default: 120,
},
});
const { modelValue, isAdd, showTitle, labelWidth } = toRefs(props);
const {modelValue, isAdd, showTitle, labelWidth} = toRefs(props);
const data = reactive({
rules: {
product: [
@ -373,7 +373,7 @@ const data = reactive({
{
required: true,
message: computed(() =>
t("admin.validation.required", { type: t("admin.form.workingTime") })
t("admin.validation.required", {type: t("admin.form.workingTime")})
),
trigger: ["change", "blur"],
},
@ -395,7 +395,7 @@ const data = reactive({
},
});
const { rules } = toRefs(data);
const {rules} = toRefs(data);
const researchOptions = ref([]);
const options = ref([]);
const formRef = ref();
@ -403,7 +403,8 @@ const cityFormRef = ref();
const fieldFormRef = ref();
const keywordsFormRef = ref();
const researchsFormRef = ref();
const setLaboratory = () => {};
const setLaboratory = () => {
};
const validateForm = async () => {
let formValid;
try {

View File

@ -10,15 +10,16 @@
<el-form-item
:label="`${title}:`"
:prop="fieldKey"
:rules="[
>
<!-- :rules="[
{
required: true,
type: 'array',
message: t('admin.validation.pleaseInputAndAdd'),
trigger: 'change',
},
]"
>
]"-->
<el-row type="flex" class="input-add-bar" justify="space-between">
<el-col :span="20">
<el-input v-model="dataVal" :placeholder="placeholder"></el-input>

View File

@ -1,9 +1,11 @@
<script setup>
import { reactive, ref, toRefs } from "vue";
import { listNews } from "@/api/website/home/news";
import {reactive, ref, toRefs} from "vue";
import {listNews} from "@/api/website/home/news";
import Pagination from "@/components/Pagination/index.vue";
import { useI18n } from "vue-i18n";
const { t, locale } = useI18n();
import {useI18n} from "vue-i18n";
import dayjs from "dayjs";
const {t, locale} = useI18n();
const file_base_url = `${import.meta.env.VITE_APP_BASE_API}/file`;
const total = ref(0);
const newsList = ref([]);
@ -12,12 +14,12 @@ const data = reactive({
latestNews: {},
queryParams: {
pageNum: 1,
pageSize: 8,
pageSize: 10,
classification: "0",
},
});
const { queryParams, latestNews } = toRefs(data);
const {queryParams, latestNews} = toRefs(data);
const getList = () => {
listNews(queryParams.value).then((resp) => {
newsList.value = resp.rows;
@ -26,7 +28,7 @@ const getList = () => {
};
const getLatestNews = () => {
listNews({ pageNum: 1, pageSize: 1 }).then((resp) => {
listNews({pageNum: 1, pageSize: 1}).then((resp) => {
if (resp.total) {
latestNews.value = resp.rows[0];
}
@ -44,7 +46,7 @@ getList();
<template>
<div class="news-container" style="height: 100%">
<div class="left">
<img class="cover-image" :src="`${file_base_url}${latestNews?.cover}`" />
<img class="cover-image" :src="`${file_base_url}${latestNews?.cover}`"/>
<p class="title">{{ latestNews?.title }}</p>
</div>
<div class="right">
@ -58,14 +60,21 @@ getList();
</el-tabs>
<ul class="news-list">
<li class="news-item" v-for="news in newsList" :key="news.id">
<a :href="`/news/detail/${news.id}`" target="_blank">
<span class="title">{{
locale === "zh" ? news.title : locale === "ru" ? news.titleRu : null
}}</span>
<span class="time">
{{ news.create_time }}
{{ dayjs(news.createTime).format("YYYY-MM-DD") }}
</span>
</a>
</li>
</ul>
<pagination v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"/>
</div>
<!-- <div class="news-list">
@ -90,20 +99,26 @@ getList();
.news-container {
padding: 20px;
display: flex;
.left {
flex: 4;
height: 100%;
// display: flex;
// flex-direction: column;
// justify-content: center;
width: calc(50vw - 20px);
height: calc(100vh - 200px);
display: flex;
flex-direction: column;
.cover-image {
height: calc(100vh - 200px - 24px - 12px);
//flex: 1;
width: 100%;
aspect-ratio: 4/3;
//aspect-ratio: 4/3;
object-fit: cover;
}
.title {
height: 24px;
text-align: center;
font-size: 20px;
width: 100%;
font-weight: bold;
margin-top: 12px;
margin-bottom: 0;
@ -112,23 +127,34 @@ getList();
white-space: nowrap;
}
}
.right {
flex: 4;
width: calc(50vw - 20px);
margin-left: 12px;
height: 100%;
padding: 12px;
.news-list {
.news-item {
list-style: disc;
& > a {
height: 40px;
display: flex;
align-items: center;
cursor: pointer;
justify-content: space-between;
.title {
flex: 1;
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.time {
color: gray;
font-size: 14px;
}
}
}
}
}

View File

@ -52,12 +52,14 @@
</template>
<script setup>
import { computed, onMounted, reactive, ref, shallowRef } from "vue";
import {computed, onActivated, onMounted, reactive, ref, shallowRef} from "vue";
import index0 from "./comp/index0.vue";
import index1 from "./comp/index1.vue";
import index8 from "./comp/index8.vue";
import index9 from "@/views/website/home/comp/index9.vue";
import {useRoute} from "vue-router";
const route = useRoute()
const loading = ref(true);
setTimeout(() => {
loading.value = false;
@ -193,14 +195,14 @@ const handleIndicatorClick = (idx) => {
console.log(idx);
let boxIndex;
let _mapIndex;
if (idx === 1) {
boxIndex = 1;
if (idx <= 2) {
boxIndex = idx;
_mapIndex = null;
} else if (idx <= 5) {
boxIndex = 2;
_mapIndex = idx - 2;
} else {
} else if (idx <= 6) {
boxIndex = 3;
_mapIndex = idx - 3;
} else {
boxIndex = 4;
_mapIndex = null;
}
@ -219,6 +221,13 @@ const handleIndicatorClick = (idx) => {
mapIndex.value = _mapIndex;
}
};
onMounted(() => {
// console.log(route.name)
if (route.name === "news-list") {
handleIndicatorClick(2)
}
})
</script>
<style lang="scss" scoped>

View File

@ -1,7 +1,7 @@
<template>
<div class="login">
<div class="content">
<img class="loginImg" src="@/assets/images/login.png" alt="" srcset="" />
<img class="loginImg" src="@/assets/images/login.png" alt="" srcset=""/>
<div class="login-form">
<el-tabs v-model="loginForm.mode" v-if="isLogin == 1">
<el-tab-pane
@ -59,7 +59,7 @@
/>
</template>
</el-input>
<WebGetCode v-model:mobile="loginForm.username" />
<WebGetCode v-model:mobile="loginForm.username"/>
</div>
</el-form-item>
<el-form-item>
@ -132,8 +132,8 @@
</el-form-item>
</el-form>
</div>
<Register v-model:isLogin="isLogin" v-else-if="isLogin == 2" />
<Retrieve v-model:isLogin="isLogin" v-else-if="isLogin == 3" />
<Register v-model:isLogin="isLogin" v-else-if="isLogin == 2"/>
<Retrieve v-model:isLogin="isLogin" v-else-if="isLogin == 3"/>
</div>
</div>
@ -149,15 +149,15 @@ import Retrieve from "../retrieve";
import Register from "../register";
import WebGetCode from "@/components/webGetCode";
import useUserStore from "@/store/modules/user";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
import { computed, reactive, ref } from "vue"; // const store = useStore();
import {useRouter} from "vue-router";
import {useI18n} from "vue-i18n";
import {computed, reactive, ref} from "vue"; // const store = useStore();
// const store = useStore();
const router = useRouter();
const userStore = useUserStore();
// const { proxy } = getCurrentInstance();
const { t } = useI18n();
const {t} = useI18n();
const isLogin = ref(1);
const loginForm = ref({
@ -203,7 +203,7 @@ const isCheck = (rule, value, callback) => {
}
};
const isCheckRules = {
isCheck: [{ required: true, validator: isCheck, trigger: "change" }],
isCheck: [{required: true, validator: isCheck, trigger: "change"}],
};
// const codeUrl = ref("");
@ -218,7 +218,7 @@ const handleLogin = async () => {
if (loginValid && isCheckValid) {
loading.value = true;
if (loginForm.value.rememberMe) {
Cookies.set("username", loginForm.value.username, { expires: 30 });
Cookies.set("username", loginForm.value.username, {expires: 30});
Cookies.set("password", loginForm.value.password, {
expires: 30,
});
@ -240,7 +240,7 @@ const handleLogin = async () => {
userStore
.login(formData)
.then(() => {
router.push({ path: redirect.value || "/identity/index" });
router.push({path: redirect.value || "/identity/index"});
})
.catch(() => {
loading.value = false;
@ -276,7 +276,7 @@ getCookie();
.content {
// padding: 0 250px;
// padding: 0 30px;
width: 1400px;
width: 100%;
margin: 0 auto;
flex: 1;
background: #b1ccff;
@ -285,8 +285,10 @@ getCookie();
justify-content: space-between;
.loginImg {
width: 705px;
height: 458px;
width: calc(100vw - 516px);
//width: 705px;
//height: 458px;
aspect-ratio: 705/458;
}
}

View File

@ -0,0 +1,65 @@
<script setup>
import {getNewsInfo} from "@/api/website/home/news";
import {useRoute} from "vue-router";
import {reactive, toRefs} from "vue";
import {useI18n} from "vue-i18n";
import WebFooter from "@/components/webFooter/index.vue";
const {t, locale} = useI18n();
const file_base_url = `${import.meta.env.VITE_APP_BASE_API}/file`;
const data = reactive({
news: {}
})
const {news} = toRefs(data)
const route = useRoute()
const getNews = () => {
const id = route.params.id
getNewsInfo(id).then((resp) => {
news.value = resp.data
})
}
getNews()
</script>
<template>
<div class="container">
<div class="news-body">
<img class="cover-image" :src="`${file_base_url}${news.cover}`"/>
<h1 class="title">{{locale === "zh" ? news.title : locale === "ru" ? news.titleRu : null }}</h1>
<p class="content">{{ locale === "zh" ? news.content : locale === "ru" ? news.contentRu : null}}</p>
</div>
<web-footer></web-footer>
</div>
</template>
<style scoped lang="scss">
.container {
background-color: #f2f6ff;
.news-body {
background-color: #ffffff;
width: 1000px;
margin: 0 auto;
.cover-image {
width: 100%;
aspect-ratio: 6/2;
object-fit: cover;
}
h1.title {
text-align: center;
font-weight: bold;
font-size: 28px;
}
p.content {
font-size: 16px;
line-height: 24px;
margin: 0;
padding: 24px;
}
}
}
</style>

View File

@ -32,8 +32,8 @@ export default defineConfig(({mode, command}) => {
// https://cn.vitejs.dev/config/#server-proxy
"/dev-api": {
// target: "http://101.34.131.16:1618",
target: "http://129.211.170.150/api",
// target: "http://192.168.0.200:1619",
// target: "http://129.211.170.150/api",
target: "http://192.168.0.200:1619",
// target: 'http://172.18.3.127:1618',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, ""),