Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
41fe0800
Commit
41fe0800
authored
Jun 17, 2024
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增前端账号冻结功能
parent
f422d8ef
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
38 deletions
+81
-38
axios.ts
src/configs/axios.ts
+6
-1
index.ts
src/router/index.ts
+4
-2
router.ts
src/router/router.ts
+1
-1
user.ts
src/store/user.ts
+8
-1
request.ts
src/utils/request.ts
+5
-0
DenyAccess.vue
src/views/Auth/DenyAccess.vue
+57
-0
DenyAccess.vue
src/views/SellTemplate/DenyAccess.vue
+0
-33
No files found.
src/configs/axios.ts
View file @
41fe0800
...
...
@@ -117,8 +117,13 @@ service.interceptors.response.use(
useUserStore
().
setUserLoginOut
()
},
1000
);
}
const
currentDeniedStatus
=
useUserStore
().
getDenied
if
(
response
.
data
.
resultCode
==
ApiResult
.
STATIC_ACCESS
){
window
.
location
.
href
=
'/denyAccess'
useUserStore
().
setUserDeniedStatus
(
true
)
if
(
!
currentDeniedStatus
)
window
.
location
.
href
=
'/denyAccess'
}
else
{
useUserStore
().
setUserDeniedStatus
(
false
)
if
(
currentDeniedStatus
)
window
.
location
.
href
=
'/login'
}
if
(
response
.
data
.
attach
){
if
(
response
.
data
.
attach
.
userinfo
){
...
...
src/router/index.ts
View file @
41fe0800
...
...
@@ -10,7 +10,7 @@ const router = createRouter({
})
const
whiteList
=
[
'/autoLogin'
,
'/login'
,
'/notfound'
,
'/regist'
,
'/'
,
'/forgot'
,
'/newpass'
,
'/notsupported'
]
const
whiteList
=
[
'/autoLogin'
,
'/login'
,
'/notfound'
,
'/regist'
,
'/'
,
'/forgot'
,
'/newpass'
,
'/notsupported'
,
'/denyAccess'
]
const
managerMenu
=
[
'/market'
,
'/editor_admin'
]
let
loadingInstance
:
any
=
null
...
...
@@ -32,7 +32,9 @@ router.beforeEach((to:any, from:any, next:any) => {
}
const
path
=
`/
${
to
.
path
.
split
(
'/'
)[
1
]}
`
if
((
whiteList
.
includes
(
path
)
||
user
.
getUserToken
!=
''
||
to
.
path
.
includes
(
'/j/'
))
&&
!
to
.
query
.
uid
)
{
if
(
useUserStore
().
getDenied
&&
path
!=
'/denyAccess'
)
next
(
'/denyAccess'
)
else
if
(
!
useUserStore
().
getDenied
&&
path
==
'/denyAccess'
)
next
(
'/space'
)
else
if
((
whiteList
.
includes
(
path
)
||
user
.
getUserToken
!=
''
||
to
.
path
.
includes
(
'/j/'
))
&&
!
to
.
query
.
uid
)
{
if
(
managerMenu
.
includes
(
to
.
path
)
&&
user
.
getUser
.
isTemplate
!=
1
){
next
(
'/notfound'
);
}
...
...
src/router/router.ts
View file @
41fe0800
...
...
@@ -83,7 +83,7 @@ const routes: RouteRecordRaw[] = [
},
{
path
:
'/denyAccess'
,
component
:
()
=>
import
(
'@/views/
SellTemplate
/DenyAccess.vue'
),
component
:
()
=>
import
(
'@/views/
Auth
/DenyAccess.vue'
),
meta
:{
title
:
'禁止访问'
}
...
...
src/store/user.ts
View file @
41fe0800
...
...
@@ -32,7 +32,8 @@ export interface AutoLoginResult{
export
const
useUserStore
=
defineStore
(
'user'
,
{
state
:()
=>
({
token
:
''
as
string
,
userInfo
:{}
as
any
userInfo
:{}
as
any
,
denied
:
false
,
}),
getters
:
{
getUserToken
:
(
state
)
=>
{
...
...
@@ -41,6 +42,9 @@ export const useUserStore = defineStore('user', {
getUser
:
(
state
)
=>
{
return
state
.
userInfo
;
},
getDenied
:(
state
)
=>
{
return
state
.
denied
},
getUserTheme
:
(
state
)
=>
{
let
rate
:
CustomerRate
=
'FREE'
if
(
state
.
userInfo
.
it
)
rate
=
'EN'
...
...
@@ -134,6 +138,9 @@ export const useUserStore = defineStore('user', {
setOldSaPermission
(
ia
:
boolean
){
this
.
userInfo
.
ia
=
ia
this
.
userInfo
.
ic
=
false
},
setUserDeniedStatus
(
status
:
boolean
){
this
.
denied
=
status
}
},
persist
:
{
...
...
src/utils/request.ts
View file @
41fe0800
...
...
@@ -18,6 +18,11 @@ export interface Result {
class
Api
{
constructor
(){
}
static
Post
=
(
cmd
:
string
,
msg
:
any
):
Promise
<
HttpResponse
>=>
{
if
(
useUserStore
().
getDenied
&&
cmd
!=
'triptemplate_GetFontList'
){
return
new
Promise
((
resolve
,
reject
)
=>
{
reject
(
'Access Denied'
)
})
}
let
datas
:
any
let
language
=
'zh_CN'
let
currencyCode
=
'CNY'
...
...
src/views/Auth/DenyAccess.vue
0 → 100644
View file @
41fe0800
<
template
>
<div
class=
"window-width window-height column flex-center items-center"
style=
"background-color: #f1f2f4"
>
<div
class=
"rounded bg-white q-pa-xl light-shadow column flex-center items-center"
style=
"width: 650px"
>
<div
style=
"width: 100%"
>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/pptTD.png"
style=
"height: 27px"
/>
</div>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638533817842486720.png"
style=
"width: 300px"
class=
"q-mt-xl"
/>
<div
class=
"row items-center q-mt-xl"
>
<div
class=
"pingfangr q-ml-xl"
style=
"font-size: 18px"
>
Access Denied
</div>
</div>
<div
class=
"q-mt-lg text-info text-small text-center"
style=
"font-size: 14px"
>
系统判定你进行了恶意访问,当前无法进行系统使用,封禁剩余时间:
<el-countdown
title=
""
v-if=
"countValue"
format=
"HH[小时]mm[分]ss[秒]"
:value=
"countValue"
value-style=
"font-size:13px;color:red;"
class=
"q-mt-md"
@
finish=
"liftingHandler"
/>
</div>
<div
class=
"q-mt-xl text-center"
style=
"font-size: 14px"
>
<el-button
type=
"info"
size=
"large"
class=
"ppt-button text-weight-bold"
@
click=
"
redicetTo('https://work.weixin.qq.com/kfid/kfc378aada578ca8b0e')
"
>
点击申诉
</el-button>
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ApiResult
}
from
"@/configs/axios"
;
import
FontService
from
"@/services/FontService"
;
import
{
useUserStore
}
from
"@/store"
;
import
{
openNewBlank
}
from
"@/utils/common"
;
import
{
ref
}
from
"vue"
;
import
{
useRouter
}
from
"vue-router"
;
const
countValue
=
ref
();
const
router
=
useRouter
()
const
redicetTo
=
(
url
:
string
)
=>
openNewBlank
(
url
);
const
navigationTo
=
(
path
:
string
)
=>
router
.
push
({
path
})
const
validator
=
async
()
=>
{
try
{
let
response
=
await
FontService
.
GetAllFontsAsync
();
if
(
response
.
data
.
resultCode
==
ApiResult
.
STATIC_ACCESS
)
{
countValue
.
value
=
new
Date
(
response
.
data
.
attach
.
replaceAll
(
"-"
,
"/"
)
).
getTime
();
}
}
catch
(
error
)
{
}
};
const
liftingHandler
=
()
=>
{
useUserStore
().
setUserDeniedStatus
(
false
)
navigationTo
(
'/login'
)
}
validator
();
</
script
>
<
style
></
style
>
\ No newline at end of file
src/views/SellTemplate/DenyAccess.vue
deleted
100644 → 0
View file @
f422d8ef
<
template
>
<div
class=
"window-width window-height column flex-center items-center"
style=
"background-color: #f1f2f4"
>
<div
class=
"rounded bg-white q-pa-xl light-shadow column flex-center items-center"
style=
"width: 650px;"
>
<div
style=
"width: 100%;"
>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/pptTD.png"
style=
"height: 27px;"
>
</div>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638533817842486720.png"
style=
"width: 300px;"
class=
"q-mt-xl"
>
<div
class=
"row items-center q-mt-xl "
>
<div
class=
"pingfangr q-ml-xl"
style=
"font-size: 18px;"
>
Access Denied
</div>
</div>
<div
class=
"q-mt-lg text-info text-small text-center"
style=
"font-size: 14px;"
>
系统判定你进行了恶意访问,当前无法进行系统使用,需等待xx小时xx分钟xx秒以后才能使用。
</div>
<div
class=
"q-mt-xl text-center"
style=
"font-size: 14px;"
>
<el-button
type=
"info"
size=
"large"
class=
"ppt-button text-weight-bold"
@
click=
"redicetTo('https://work.weixin.qq.com/kfid/kfc378aada578ca8b0e')"
>
点击申诉
</el-button>
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ApiResult
}
from
"@/configs/axios"
;
import
ConfigService
from
"@/services/ConfigService"
;
import
FileService
from
"@/services/FileService"
;
import
{
ref
}
from
"vue"
;
import
{
useRouter
}
from
"vue-router"
;
import
{
openNewBlank
}
from
'@/utils/common'
const
redicetTo
=
(
url
:
string
)
=>
openNewBlank
(
url
)
</
script
>
<
style
>
</
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment