Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ver 2.4 #37

Merged
merged 18 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@

<script setup>
import { ref } from 'vue'
import { sendErrorDialog, sendSuccessDialog, sendWarningDialog } from '@/utils/dialog'
import { finishLoadingBar, startLoadingBar } from '@/utils/loadingbar'
import { get } from '@/utils/request'
import userData from '@/utils/stores/userData/store'
import Message from '@/utils/dialog.js'
import { finishLoadingBar, startLoadingBar } from '@/utils/loadingbar.js'
import { get } from '@/utils/request.js'
import userData from '@/utils/stores/userData/store.js'

const message = new Message()

const commentList = ref([])
const formRef = ref(null)
Expand All @@ -59,7 +61,7 @@ function timestampToTime(timestamp) {
function submitComment() {
startLoadingBar()
if (newYear.value.comment === '') {
sendErrorDialog('内容不可为空!')
message.warning('内容不可为空!')
finishLoadingBar()
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@

<script setup>
import { ref } from 'vue'
import { sendSuccessDialog, sendWarningDialog } from '@/utils/dialog'
import { finishLoadingBar, startLoadingBar } from '@/utils/loadingbar'
import { get } from '@/utils/request'
import userData from '@/utils/stores/userData/store'
import { sendSuccessDialog, sendWarningDialog } from '@/utils/dialog.js'
import { finishLoadingBar, startLoadingBar } from '@/utils/loadingbar.js'
import { get } from '@/utils/request.js'
import userData from '@/utils/stores/userData/store.js'
import { marked } from 'marked'

const prizesList = ref([
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "locyanfrp",
"private": true,
"version": "2.3",
"version": "2.4",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -10,11 +10,11 @@
"format": "prettier --write src/"
},
"dependencies": {
"@vicons/fa": "^0.12.0",
"@vicons/fluent": "^0.12.0",
"@vicons/ionicons4": "^0.12.0",
"@vicons/ionicons5": "^0.12.0",
"@vicons/material": "^0.12.0",
"@vicons/fa": "^0.12.0",
"@vicons/fluent": "^0.12.0",
"axios": "^1.7.7",
"highlight.js": "^11.10.0",
"js-cookie": "^3.0.5",
Expand All @@ -33,6 +33,7 @@
"vue-native-websocket": "^2.0.15",
"vue-route": "^1.5.1",
"vue-router": "^4.4.5",
"vue-turnstile": "^1.0.11",
"vuex": "^4.1.0"
},
"devDependencies": {
Expand Down
19 changes: 13 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<the-message />
<loading-bar />
<the-dialog />
<notification />
<the-notification />
<n-layout v-show="loading">
<n-el class="load-container">
<n-spin></n-spin>
Expand Down Expand Up @@ -57,7 +57,7 @@ import {
NNotificationProvider,
useOsTheme
} from 'naive-ui'
import Notification from '@components/TheNotification.vue'
import TheNotification from '@components/TheNotification.vue'
import TheFooter from '@components/TheFooter.vue'
import TheHeader from '@components/TheHeader.vue'
import UserInfo from '@components/UserInfo.vue'
Expand All @@ -73,11 +73,13 @@ import hljs from 'highlight.js/lib/core'
import ini from 'highlight.js/lib/languages/ini'
import nginx from 'highlight.js/lib/languages/nginx'
import api from '@/api'
import { sendWarningMessage } from '@/utils/message'
import Notification from '@/utils/notification'
import { logout } from '@/utils/profile'
import router from '@router'
import { useRoute, useRouter } from 'vue-router'

const notification = new Notification()

// 手机状态下收缩菜单栏
const collapsed = ref(true)
if (document.body.clientWidth >= 1000) {
Expand Down Expand Up @@ -121,9 +123,9 @@ vRouter.afterEach(() => {
async function fetchUserInfo() {
let rs
try {
rs = await api.v2.user.info.root.get(userData.getters.get_username)
rs = await api.v2.user.info.root.get(userData.getters.get_user_id)
} catch (e) {
sendWarningMessage('查询用户信息失败: ' + e + ',请重新登录后台!')
notification.warning('查询用户信息失败', e + ',请重新登录后台!')
}
if (!rs) return
if (rs.status === 200) {
Expand All @@ -142,7 +144,7 @@ async function fetchUserInfo() {
return true
}
if (rs.status === 401) {
sendWarningMessage('登录过期或未登录,请重新登录后台!')
notification.warning('授权失效', '请重新登录后台!')
logout()
}
return false
Expand All @@ -151,6 +153,11 @@ async function fetchUserInfo() {
watch(
() => route.meta,
(value) => {
if (value.noSidebar) {
showMainSidebar.value = false
showGuestSidebar.value = false
return
}
if (value.needLogin) {
showMainSidebar.value = true
showGuestSidebar.value = false
Expand Down
4 changes: 2 additions & 2 deletions src/api/base.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const base = {
api_v1_url: 'https://api.locyanfrp.cn',
api_v2_url: 'https://api-v2.locyanfrp.cn/api/v2',
// api_v2_url: 'http://localhost:18080/api/v2',
// api_v2_url: 'https://api-v2.locyanfrp.cn/api/v2',
api_v2_url: 'http://localhost:18080/api/v2',
buildResponse: (res: any, useDataPath: boolean = true) => {
const message =
res.data?.message ??
Expand Down
2 changes: 0 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import v1 from './v1'
import v2 from './v2'

const api = {
v1: v1,
v2: v2
}

Expand Down
15 changes: 0 additions & 15 deletions src/api/v1/Account/EditEmail.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/api/v1/Account/SendEditMail.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/api/v1/Account/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/api/v1/App/GetBroadCast.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/api/v1/App/GetCSApp.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/api/v1/App/_root.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/api/v1/App/index.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/api/v1/Donate/GetDonateInfo.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/api/v1/Donate/GetDonateList.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/api/v1/Donate/SetMessage.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/api/v1/Donate/index.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/api/v1/Proxies/GetConfigFile.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/api/v1/Proxies/GetRandomPort.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/api/v1/Proxies/index.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/api/v1/User/DoResetPassowrdEmailSend.ts

This file was deleted.

Loading
Loading