wip: 🚧 通知公告重构临时提交
This commit is contained in:
@@ -107,7 +107,7 @@
|
||||
import { Client } from "@stomp/stompjs";
|
||||
|
||||
import { useUserStoreHook } from "@/store/modules/user";
|
||||
import { TOKEN_KEY } from "@/enums/CacheEnum";
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
const userStore = useUserStoreHook();
|
||||
const isConnected = ref(false);
|
||||
@@ -141,7 +141,7 @@ function connectWebSocket() {
|
||||
stompClient = new Client({
|
||||
brokerURL: socketEndpoint.value,
|
||||
connectHeaders: {
|
||||
Authorization: localStorage.getItem(TOKEN_KEY) || "",
|
||||
Authorization: getToken(),
|
||||
},
|
||||
debug: (str) => {
|
||||
console.log(str);
|
||||
|
||||
@@ -119,13 +119,10 @@
|
||||
@pagination="handleQuery()"
|
||||
/>
|
||||
</el-card>
|
||||
<NoticeModal ref="noticeModalRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import NoticeModal from "@/components/NoticeModal/index.vue";
|
||||
|
||||
defineOptions({
|
||||
name: "MyNotice",
|
||||
inheritAttrs: false,
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@click="recallNotice(scope.row.id)"
|
||||
@click="revokeNotice(scope.row.id)"
|
||||
>
|
||||
撤回
|
||||
</el-button>
|
||||
@@ -415,8 +415,8 @@ function releaseNotice(id: number) {
|
||||
});
|
||||
}
|
||||
|
||||
function recallNotice(id: number) {
|
||||
NoticeAPI.recallNotice(id).then((res) => {
|
||||
function revokeNotice(id: number) {
|
||||
NoticeAPI.revokeNotice(id).then((res) => {
|
||||
ElMessage.success("撤回成功");
|
||||
handleQuery();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user