Commit 21f8edb4 by 胡悦

修复bug

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