Skip to content

Commit

Permalink
feat: add more link rule
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Sep 2, 2024
1 parent da0278c commit 3b9a104
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ The core idea of this plugin is: `Everything is a Page` . You can set a page to
/p/[id] - Regular Link
/post/[id] - Regular Link
-----------------------------------------------------------------------------------
/link/[id] - VIP Exclusive Link, "Only used when deploying in VIP Service Provider mode"
/doc/[id] - VIP Exclusive Link, "Only used when deploying in VIP Service Provider mode"
/article/[id] - VIP Exclusive Link, "Only used when deploying in VIP Service Provider mode"
/share/[id] - VIP Exclusive Link, "Only used when deploying in VIP Service Provider mode"
/x/[id] - VIP Exclusive Link, "Only used when deploying in VIP Service Provider mode"
/a/[id] - VIP Exclusive Link, "Only used when deploying in VIP Service Provider mode"
/d/[id] - VIP Exclusive Link, "Only used when deploying in VIP Service Provider mode"
Expand Down
2 changes: 1 addition & 1 deletion README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
/p/[id] - 普通链接
/post/[id] - 普通链接
-----------------------------------------------------------------------------------
/link/[id] - VIP 专属链接,「仅 VIP 服务商模式部署时使用」
/doc/[id] - VIP 专属链接,「仅 VIP 服务商模式部署时使用」
/article/[id] - VIP 专属链接,「仅 VIP 服务商模式部署时使用」
/share/[id] - VIP 专属链接,「仅 VIP 服务商模式部署时使用」
/x/[id] - VIP 专属链接,「仅 VIP 服务商模式部署时使用」
/a/[id] - VIP 专属链接,「仅 VIP 服务商模式部署时使用」
/d/[id] - VIP 专属链接,「仅 VIP 服务商模式部署时使用」
Expand Down
1 change: 0 additions & 1 deletion components/static/Detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const props = defineProps({
})

const logger = createAppLogger("static-share-page")
const env = useRuntimeConfig()
const { t } = useI18n()
const route = useRoute()
const id = props.pageId ?? ((route.params.id ?? "") as string)
Expand Down
5 changes: 3 additions & 2 deletions composables/useAuthModeFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export const useAuthModeFetch = () => {
})
const resJson = await res.json()
if (resJson.code === 0) {
resText = JSON.stringify(resJson.data)
const dataJson = JSON.parse(resJson.data)
resText = JSON.stringify(dataJson.post)
} else {
ElMessage.error("文档获取失败,错误信息如下=>" + resJson.msg)
}
Expand Down Expand Up @@ -108,7 +109,7 @@ export const useAuthModeFetch = () => {
}

const fetchConfig = async (filename: string, providerMode: boolean): Promise<string> => {
console.log("providerMode=>",providerMode)
console.log("providerMode=>", providerMode)
let resText: string
if (providerMode) {
logger.info(`fetch config text ${filename} in provider mode`)
Expand Down
File renamed without changes.
33 changes: 33 additions & 0 deletions pages/article/[id].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
- Copyright (c) 2023, Terwer . All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation. Terwer designates this
- particular file as subject to the "Classpath" exception as provided
- by Terwer in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
- or visit www.terwer.space if you need additional information or have any
- questions.
-->
<script setup lang="ts">
definePageMeta({
layout: false,
})
</script>

<template>
<static-detail-page />
</template>
33 changes: 33 additions & 0 deletions pages/d/[id].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
- Copyright (c) 2023, Terwer . All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation. Terwer designates this
- particular file as subject to the "Classpath" exception as provided
- by Terwer in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
- or visit www.terwer.space if you need additional information or have any
- questions.
-->
<script setup lang="ts">
definePageMeta({
layout: false,
})
</script>

<template>
<static-detail-page />
</template>
33 changes: 33 additions & 0 deletions pages/doc/[id].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
- Copyright (c) 2023, Terwer . All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation. Terwer designates this
- particular file as subject to the "Classpath" exception as provided
- by Terwer in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
- or visit www.terwer.space if you need additional information or have any
- questions.
-->
<script setup lang="ts">
definePageMeta({
layout: false,
})
</script>

<template>
<static-detail-page />
</template>
33 changes: 33 additions & 0 deletions pages/link/[id].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
- Copyright (c) 2023, Terwer . All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation. Terwer designates this
- particular file as subject to the "Classpath" exception as provided
- by Terwer in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
- or visit www.terwer.space if you need additional information or have any
- questions.
-->
<script setup lang="ts">
definePageMeta({
layout: false,
})
</script>

<template>
<static-detail-page />
</template>
33 changes: 33 additions & 0 deletions pages/x/[id].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
- Copyright (c) 2023, Terwer . All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation. Terwer designates this
- particular file as subject to the "Classpath" exception as provided
- by Terwer in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
- or visit www.terwer.space if you need additional information or have any
- questions.
-->
<script setup lang="ts">
definePageMeta({
layout: false,
})
</script>

<template>
<static-detail-page />
</template>

0 comments on commit 3b9a104

Please sign in to comment.