mirror of https://github.com/openspug/spug
fix issue
parent
6253dcceb5
commit
f8a757bc4a
|
@ -3,7 +3,7 @@
|
|||
# Released under the AGPL-3.0 License.
|
||||
from django.views.generic import View
|
||||
from libs import json_response, JsonParser, Argument
|
||||
from apps.notice.models import Notice
|
||||
from apps.home.models import Notice
|
||||
import json
|
||||
|
||||
|
|
@ -4,10 +4,12 @@
|
|||
from django.urls import path
|
||||
|
||||
from .views import *
|
||||
from apps.home.notice import NoticeView
|
||||
|
||||
urlpatterns = [
|
||||
path('statistic/', get_statistic),
|
||||
path('alarm/', get_alarm),
|
||||
path('deploy/', get_deploy),
|
||||
path('request/', get_request),
|
||||
path('notice/', NoticeView.as_view()),
|
||||
]
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug
|
||||
# Copyright: (c) <spug.dev@gmail.com>
|
||||
# Released under the AGPL-3.0 License.
|
|
@ -1,10 +0,0 @@
|
|||
# Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug
|
||||
# Copyright: (c) <spug.dev@gmail.com>
|
||||
# Released under the AGPL-3.0 License.
|
||||
from django.urls import path
|
||||
|
||||
from .views import *
|
||||
|
||||
urlpatterns = [
|
||||
path('', NoticeView.as_view()),
|
||||
]
|
|
@ -47,7 +47,7 @@ INSTALLED_APPS = [
|
|||
'apps.deploy',
|
||||
'apps.notify',
|
||||
'apps.repository',
|
||||
'apps.notice',
|
||||
'apps.home',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
|
|
@ -33,6 +33,5 @@ urlpatterns = [
|
|||
path('home/', include('apps.home.urls')),
|
||||
path('notify/', include('apps.notify.urls')),
|
||||
path('file/', include('apps.file.urls')),
|
||||
path('notice/', include('apps.notice.urls')),
|
||||
path('apis/', include('apps.apis.urls')),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|||
import { Button, Card, List, Modal, Form, Input, Switch, Divider } from 'antd';
|
||||
import { DownSquareOutlined, PlusOutlined, UpSquareOutlined, SoundOutlined } from '@ant-design/icons';
|
||||
import { http } from 'libs';
|
||||
import styles from "./index.module.less";
|
||||
import styles from './index.module.less';
|
||||
|
||||
function NoticeIndex(props) {
|
||||
const id = localStorage.getItem('id');
|
||||
|
@ -20,7 +20,7 @@ function NoticeIndex(props) {
|
|||
|
||||
function fetch() {
|
||||
setFetching(true);
|
||||
http.get('/api/notice/')
|
||||
http.get('/api/home/notice/')
|
||||
.then(res => {
|
||||
setRecords(res);
|
||||
for (let item of res) {
|
||||
|
@ -36,7 +36,7 @@ function NoticeIndex(props) {
|
|||
setLoading(true);
|
||||
const formData = form.getFieldsValue();
|
||||
formData['id'] = record.id;
|
||||
http.post('/api/notice/', formData)
|
||||
http.post('/api/home/notice/', formData)
|
||||
.then(() => {
|
||||
fetch()
|
||||
setRecord(null)
|
||||
|
@ -51,14 +51,14 @@ function NoticeIndex(props) {
|
|||
|
||||
function handleSort(e, info, sort) {
|
||||
e.stopPropagation();
|
||||
http.patch('/api/notice/', {id: info.id, sort})
|
||||
http.patch('/api/home/notice/', {id: info.id, sort})
|
||||
.then(() => fetch())
|
||||
}
|
||||
|
||||
function handleRead() {
|
||||
if (!notice.read_ids.includes(id)) {
|
||||
const formData = {id: notice.id, read: 1};
|
||||
http.patch('/api/notice/', formData)
|
||||
http.patch('/api/home/notice/', formData)
|
||||
.then(() => fetch())
|
||||
}
|
||||
setNotice(null);
|
||||
|
|
Loading…
Reference in New Issue