Skip to content

Commit 0c2a0a2

Browse files
author
jipengfei01
committed
feat: refactor routing and menu, as well as fix #6
1 parent 31b6745 commit 0c2a0a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2636
-3504
lines changed

package-lock.json

Lines changed: 158 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"dependencies": {
2121
"@types/diff": "^5.0.3",
22+
"@vueuse/core": "^10.2.1",
2223
"axios": "^1.2.2",
2324
"dayjs": "^1.11.7",
2425
"diff": "^5.1.0",
@@ -27,6 +28,7 @@
2728
"less": "^4.1.3",
2829
"md5": "^2.3.0",
2930
"normalize.css": "^8.0.1",
31+
"nprogress": "^0.2.0",
3032
"pinia": "^2.0.30",
3133
"postcss-preset-env": "^7.8.3",
3234
"qs": "^6.11.1",
@@ -46,6 +48,7 @@
4648
"@types/js-cookie": "^3.0.3",
4749
"@types/js-md5": "^0.7.0",
4850
"@types/node": "^18.11.18",
51+
"@types/nprogress": "^0.2.0",
4952
"@types/qs": "^6.9.7",
5053
"@types/url-parse": "^1.4.8",
5154
"@typescript-eslint/eslint-plugin": "^5.60.1",

src/App.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
</template>
1010
<script setup lang="ts">
1111
import { NConfigProvider, NMessageProvider, zhCN } from 'naive-ui'
12+
13+
import { useUserStore } from '@/store/user'
14+
15+
const userStore = useUserStore()
16+
17+
userStore.getUserInfo()
1218
const themeColor = 'rgba(22, 125, 255, 0.8)'
1319
const themeOverrides = {
1420
common: {

src/api/alert.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { AlertMsgData, GetAlertMsgsParams } from '@/model/alert'
1+
import type {
2+
AlertMsgData,
3+
GetAlertMsgsParams,
4+
PostAlertConfig,
5+
} from '@/model/alert'
26
import type { Res } from '@/utils/_fetch'
37
import _fetch from '@/utils/_fetch'
48

@@ -13,7 +17,7 @@ export const getAlertMessageApi = (data: GetAlertMsgsParams) => {
1317

1418
//获取用户未读告警数量
1519
export const getUnreadAlertMessageApi = () => {
16-
return _fetch<Res<{ result: any }>>({
20+
return _fetch<Res<number>>({
1721
method: 'GET',
1822
url: `/curvebs?method=alert.unread.num.get`,
1923
})
@@ -60,7 +64,7 @@ export const updateAlertCandidateApi = (data: Object) => {
6064
}
6165

6266
//更新告警配置
63-
export const updateAlertRuleApi = (data: Object) => {
67+
export const updateAlertRuleApi = (data: PostAlertConfig) => {
6468
return _fetch<Res<{ result: any }>>({
6569
method: 'POST',
6670
url: `/curvebs?method=alert.conf.update`,
@@ -70,17 +74,8 @@ export const updateAlertRuleApi = (data: Object) => {
7074

7175
//获取告警联系人候选人
7276
export const getAlertCandidateApi = () => {
73-
return _fetch<Res<{ result: any }>>({
77+
return _fetch<Res<string[]>>({
7478
method: 'GET',
7579
url: `/curvebs?method=alert.candidate.get`,
7680
})
7781
}
78-
79-
//更新告警联系人
80-
export const updateAlertUserApi = (data: Object) => {
81-
return _fetch<Res<{ result: any }>>({
82-
method: 'POST',
83-
url: `/curvebs?method=alert.user.update`,
84-
data,
85-
})
86-
}

0 commit comments

Comments
 (0)