Commit 21f8edb4 by 胡悦

修复bug

1 parent 2cbc57a4
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-08-23 11:04:56
* @LastEditors: huyue
* @LastEditTime: 2024-07-29 16:14:07
* @LastEditTime: 2024-10-22 10:43:36
*/
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'
// import { Toast } from 'vant';
......@@ -76,6 +76,8 @@ service.interceptors.response.use((r: AxiosResponse) => {
localStorage.removeItem('sessionId')
const [href] = window.location.href.split('/#/')
location.href = `${href}/#/login`
} else {
Message.error(res.message || res.msg || '出错了,请联系管理员')
}
// Message(res.message)
break
......
......@@ -64,8 +64,10 @@ const handleSubmit = () => {
let api = 'gw.api.news.information.add'
if (params.id) api = 'gw.api.news.information.update'
const res = await req(api, params)
res ? Message.success('数据保存成功') : Message.error('数据保存失败')
if (res) router.go(-1)
if (res) {
Message.success('数据保存成功')
router.go(-1)
}
}
})
};
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-07-23 16:43:07
* @LastEditors: huyue
* @LastEditTime: 2024-10-21 15:09:55
* @LastEditTime: 2024-10-22 11:12:48
-->
<script lang="ts" setup>
import { ref } from 'vue'
......@@ -11,6 +11,7 @@ import { req } from "../../utils/request";
import { Message } from "@arco-design/web-vue";
import { TableItem } from "./interface";
import { useRouter } from "vue-router";
import dayjs from "dayjs";
const router = useRouter();
const data = ref({
page: {
......@@ -39,6 +40,7 @@ const columns = [
{
title: "修改时间",
dataIndex: "updatedTime",
slotName: 'updatedTime'
},
{
title: "发布时间",
......@@ -114,7 +116,8 @@ getTableData()
</div>
<a-table class="table" :columns="columns" :data="tableData" row-key="id" :pagination="false" :bordered="false">
<template #index="{ rowIndex }"> {{ data.page.pageSize * (data.page.pageNum - 1) + rowIndex + 1 }} </template>
<template #publishTime="{ record }">{{ record.publishTime || '-' }}</template>
<template #updatedTime="{ record }">{{ record.updatedTime ? dayjs(record.updatedTime).format('YYYY-MM-DD HH:mm') : '-' }}</template>
<template #publishTime="{ record }">{{ record.publishTime ? dayjs(record.publishTime).format('YYYY-MM-DD HH:mm') : '-' }}</template>
<template #operation="{ record }">
<a-popconfirm :content="'是否确认下架'" @ok="publishOrDown(record)">
<!-- <a-button type="text" v-if="record.systemPublishStatus === 1 || record.systemPublishStatus === 2">发布</a-button> -->
......@@ -159,4 +162,9 @@ getTableData()
.table {
margin-top: 10px;
}
</style>
<style>
.arco-btn-text {
padding-left: 0 !important;
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!