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
028523e4
Commit
028523e4
authored
May 22, 2024
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面水印和健康检测功能
parent
ba118a1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
4 deletions
+71
-4
App.vue
src/App.vue
+5
-3
Index.vue
src/components/WaterMake/Index.vue
+65
-0
domainManager.ts
src/utils/domainManager.ts
+1
-1
No files found.
src/App.vue
View file @
028523e4
<
template
>
<
template
>
<router-view/>
<WaterMake></WaterMake>
</
template
>
<
script
lang=
"ts"
setup
>
...
...
@@ -11,11 +11,12 @@ import { LOCALSTORAGE_KEY_DISCARDED_DB } from '@/configs/storage';
import
{
storeToRefs
}
from
'pinia'
;
import
{
injectKeyTemplate
}
from
'./types/injectKey'
;
import
UserServices
from
'./services/UserService'
;
import
WaterMake
from
'./components/WaterMake/Index.vue'
const
{
token
}
=
storeToRefs
(
useUserStore
())
const
snapshotStore
=
useSnapshotStore
()
const
mainStore
=
useMainStore
()
const
{
databaseId
}
=
storeToRefs
(
mainStore
)
const
{
token
}
=
storeToRefs
(
useUserStore
())
const
searchData
=
ref
({}
as
any
)
provide
(
injectKeyTemplate
,
searchData
)
const
autoSave
=
ref
(
0
)
...
...
@@ -57,4 +58,5 @@ setInterval(() => {
#app
{
height
:
100%
;
}
</
style
>
\ No newline at end of file
src/components/WaterMake/Index.vue
0 → 100644
View file @
028523e4
<
template
>
<el-watermark
v-if=
"water && water.status && showWater"
class=
"travel-watermark"
:content=
"water.wmtype==1?water.content:''"
:z-index=
"9999999"
:rotate=
"water.ag"
:gap=
"gaps[water.de-1]"
:offset=
"[0,0]"
:image=
"water.wmtype==2?water.content:''"
:font=
"
{fontSize:water.cz,color:water.color}"
>
</el-watermark>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ApiResult
}
from
"@/configs/axios"
import
SettingService
from
"@/services/SettingService"
import
{
useUserStore
}
from
"@/store"
import
{
storeToRefs
}
from
"pinia"
import
{
ref
,
watch
}
from
"vue"
import
{
useRouter
}
from
"vue-router"
const
{
token
}
=
storeToRefs
(
useUserStore
())
const
water
=
ref
<
any
>
()
const
gaps
=
[[
100
,
100
],[
150
,
150
],[
200
,
200
]]
const
exportRule
=
[
'/editor/'
]
const
previewRule
=
[
'/play/'
,
'/preview/'
,
'/team_preview/'
]
const
ruleRouter
=
ref
<
string
[]
>
([])
//const currentUrl = ref
<
string
>
(
''
)
const
showWater
=
ref
(
false
)
const
router
=
useRouter
()
const
loadWater
=
async
()
=>
{
if
(
!
token
.
value
||
token
.
value
==
''
)
return
ruleRouter
.
value
=
[]
const
response
=
await
SettingService
.
GetWmAsync
()
if
(
response
.
data
.
resultCode
==
ApiResult
.
SUCCESS
){
water
.
value
=
response
.
data
.
data
if
(
water
.
value
.
ra
==
0
||
water
.
value
.
ra
==
1
)
ruleRouter
.
value
.
push
(...
previewRule
)
if
(
water
.
value
.
ra
==
0
||
water
.
value
.
ra
==
2
)
ruleRouter
.
value
.
push
(...
exportRule
)
waterVisibleHandler
()
}
}
const
waterVisibleHandler
=
()
=>
{
const
url
=
router
.
currentRoute
.
value
.
path
showWater
.
value
=
ruleRouter
.
value
.
findIndex
(
x
=>
url
.
includes
(
x
))
!=-
1
}
watch
(()
=>
router
.
currentRoute
.
value
.
path
,
(
toPath
)
=>
{
waterVisibleHandler
()
},{
immediate
:
true
,
deep
:
true
})
loadWater
()
</
script
>
<
style
>
.travel-watermark
{
position
:
fixed
!important
;
top
:
0
;
left
:
0
;
width
:
100vw
;
height
:
100vh
;
z-index
:
9999999
;
pointer-events
:
none
!important
;
}
</
style
>
\ No newline at end of file
src/utils/domainManager.ts
View file @
028523e4
...
...
@@ -3,7 +3,7 @@ export const domainManager = () => {
const
obj
=
{
domainUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"https://reborn.oytour.com/api/common/post"
:
"http://192.168.10.214/api/common/post"
,
//上传站点
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"https://upload.oytour.com"
:
"http://192.168.5.
46
:8120"
,
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"https://upload.oytour.com"
:
"http://192.168.5.
214
:8120"
,
//文件站点
ViittoFileUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://imgfile.oytour.com"
:
'http://192.168.10.214:8130'
,
// 通知erp
...
...
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