Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
website-middleground
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 21f8edb4
authored
Oct 24, 2024
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
2cbc57a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
src/utils/http.ts
src/views/news/components/AddForm.vue
src/views/news/index.vue
src/utils/http.ts
View file @
21f8edb
...
...
@@ -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
...
...
src/views/news/components/AddForm.vue
View file @
21f8edb
...
...
@@ -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
)
}
}
})
};
...
...
src/views/news/index.vue
View file @
21f8edb
...
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-07-23 16:43:07
* @LastEditors: huyue
* @LastEditTime: 2024-10-2
1 15:09:55
* @LastEditTime: 2024-10-2
2 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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment