Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
45d83da5c7 | |||
4fa123baa8 |
@@ -3,6 +3,7 @@ package api
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"wireguard-ui/component"
|
"wireguard-ui/component"
|
||||||
"wireguard-ui/http/param"
|
"wireguard-ui/http/param"
|
||||||
@@ -77,6 +78,10 @@ func (DashboardApi) ConnectionList(c *gin.Context) {
|
|||||||
for _, iaip := range peer.AllowedIPs {
|
for _, iaip := range peer.AllowedIPs {
|
||||||
ipAllocation += iaip.String() + ","
|
ipAllocation += iaip.String() + ","
|
||||||
}
|
}
|
||||||
|
// 去除一下最右边的逗号
|
||||||
|
if len(ipAllocation) > 0 {
|
||||||
|
ipAllocation = strings.TrimRight(ipAllocation, ",")
|
||||||
|
}
|
||||||
connections = append(connections, vo.DataTraffic{
|
connections = append(connections, vo.DataTraffic{
|
||||||
Name: clientInfo.Name,
|
Name: clientInfo.Name,
|
||||||
Email: clientInfo.Email,
|
Email: clientInfo.Email,
|
||||||
|
@@ -50,13 +50,13 @@ func Authorization() gin.HandlerFunc {
|
|||||||
// 查询用户
|
// 查询用户
|
||||||
user, err := service.User().GetUserById(userClaims.ID)
|
user, err := service.User().GetUserById(userClaims.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
response.R(c).FailedWithError("用户不存在")
|
response.R(c).AuthorizationFailed("用户不存在")
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if user.Status != constant.Enabled {
|
if user.Status != constant.Enabled {
|
||||||
response.R(c).FailedWithError("用户状态异常,请联系管理员处理!")
|
response.R(c).AuthorizationFailed("用户状态异常,请联系管理员处理!")
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,6 @@ export async function addDynamicRoutes() {
|
|||||||
// 有token的情况
|
// 有token的情况
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const permissionStore = usePermissionStore()
|
const permissionStore = usePermissionStore()
|
||||||
!userStore.id && (await userStore.getUserInfo())
|
!userStore.id && (await userStore.getUserInfo())
|
||||||
|
|
||||||
@@ -49,8 +48,8 @@ export async function addDynamicRoutes() {
|
|||||||
router.addRoute(NOT_FOUND_ROUTE)
|
router.addRoute(NOT_FOUND_ROUTE)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
$message.error('初始化用户信息失败: ' + error)
|
|
||||||
userStore.logout()
|
userStore.logout()
|
||||||
|
$message.error('初始化用户信息失败: ' + error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@ export default {
|
|||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/client',
|
redirect: '/client',
|
||||||
meta: {
|
meta: {
|
||||||
|
title: '客户端',
|
||||||
order: 2,
|
order: 2,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@@ -6,6 +6,7 @@ export default {
|
|||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/setting',
|
redirect: '/setting',
|
||||||
meta: {
|
meta: {
|
||||||
|
title: '设置',
|
||||||
order: 3,
|
order: 3,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@@ -6,6 +6,7 @@ export default {
|
|||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/user',
|
redirect: '/user',
|
||||||
meta: {
|
meta: {
|
||||||
|
title: '管理员',
|
||||||
order: 1,
|
order: 1,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@@ -6,6 +6,7 @@ export default {
|
|||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/workbench',
|
redirect: '/workbench',
|
||||||
meta: {
|
meta: {
|
||||||
|
title: '工作台',
|
||||||
order: 0,
|
order: 0,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
4838
web/stats.html
Normal file
4838
web/stats.html
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user