Skip to content

Commit

Permalink
fix: 优化功能提示
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Jul 2, 2023
1 parent 6dfcd58 commit a3efbb9
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 32 deletions.
13 changes: 1 addition & 12 deletions locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,5 @@ export default {
"change.ip.title": "Change IP",
"share.accessCodeEnabled.tip":
"Special note: If you have enabled the authorization code after detection, please know if the document or settings are updated and need to be shared again.",
"share.accessCodeEnabled.tip0": "Special Notes:",
"share.accessCodeEnabled.tip1":
"1. If you have detected that you have enabled the authorization code, the sharing function is limited in this case, please make sure that you have understood the function limitations.",
"share.accessCodeEnabled.tip2": "The specific manifestations are:",
"share.accessCodeEnabled.tip3":
"(1) The document is shared statically, and it cannot be automatically updated after sharing, and you need to manually re-enable sharing if there is an update;",
"share.accessCodeEnabled.tip4": "(2) Sharing expiration is not supported, only sharing and unsharing are supported.",
"share.accessCodeEnabled.tip5": "(3) Does not support modifying the theme and does not support SEO.",
"share.accessCodeEnabled.tip6":
"2. If you need to experience the full function, you can cancel the authorization code and then share it.",
"share.accessCodeEnabled.tip7":
"3. If you really need to use the authorization code, you can ignore this prompt, but please make sure that you have fully understood the functional limitations in this mode.",
"share.public.tip": "Currently in public sharing mode",
}
9 changes: 1 addition & 8 deletions locales/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,5 @@ export default {
"form.nodata": "暂无数据",
"change.ip.title": "切换IP",
"share.accessCodeEnabled.tip": "特别提示:检测到您已开启授权码,若文档或者设置有更新,需重新分享,请知悉。",
"share.accessCodeEnabled.tip0": "特别提示:",
"share.accessCodeEnabled.tip1": "1、检测到您已开启授权码,此情况下分享功能受限,请确保已了解功能限制。",
"share.accessCodeEnabled.tip2": "具体表现为:",
"share.accessCodeEnabled.tip3": "(1)文档为静态分享,分享过后无法自动更新,有更新需要手动重新开启共享;",
"share.accessCodeEnabled.tip4": "(2)不支持分享过期,仅支持分享与取消分享。",
"share.accessCodeEnabled.tip5": "(3)不支持修改主题,不支持SEO。",
"share.accessCodeEnabled.tip6": "2、如需体验完整功能,可取消授权码后再分享。",
"share.accessCodeEnabled.tip7": "3、如果确实需要使用授权码,可忽略此提示,但请确保您已经完全了解此模式下的功能限制。",
"share.public.tip": "当前处于公共分享模式",
}
36 changes: 28 additions & 8 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const generateDynamicV = () => {
}

const isDev = process.env.NODE_ENV === "development"
const appBase = "/"
const appBase = "/plugins/siyuan-blog/"
const staticV = generateDynamicV()

// https://nuxt.com/docs/api/configuration/nuxt-config
Expand All @@ -28,7 +28,14 @@ export default defineNuxtConfig({
},

// build modules
modules: ["@vueuse/nuxt", "@nuxtjs/i18n", "@element-plus/nuxt", "@nuxtjs/color-mode", "@pinia/nuxt", "@nuxt/image"],
modules: [
"@vueuse/nuxt",
"@nuxtjs/i18n-edge",
"@element-plus/nuxt",
"@nuxtjs/color-mode",
"@pinia/nuxt",
"@nuxt/image",
],

// vueuse
vueuse: {
Expand All @@ -51,7 +58,7 @@ export default defineNuxtConfig({
define: {
"process.env.DEV_MODE": `"${isDev}"`,
"process.env.APP_BASE": `"${appBase}"`,
"process.env.SSR": `"true"`,
"process.env.SSR": `"false"`,
},
plugins: [],
},
Expand All @@ -62,6 +69,14 @@ export default defineNuxtConfig({
themes: ["dark"],
},

// https://nuxt.com/docs/guide/going-further/custom-routing#hash-mode-spa
ssr: false,
router: {
options: {
hashMode: true,
},
},

css: ["~/assets/siyuan/style.styl", "~/assets/siyuan/index.styl"],

app: {
Expand Down Expand Up @@ -98,12 +113,17 @@ export default defineNuxtConfig({

// 环境变量
runtimeConfig: {
siyuanAuthToken: process.env.NUXT_SIYUAN_AUTH_TOKEN,
siyuanCookie: process.env.NUXT_SIYUAN_COOKIE,
// siyuanAuthToken: process.env.NUXT_SIYUAN_AUTH_TOKEN,
siyuanAuthToken: "",
// siyuanCookie: process.env.NUXT_SIYUAN_COOKIE,
siyuanCookie: "",
public: {
defaultType: process.env.NUXT_PUBLIC_DEFAULT_TYPE ?? "siyuan",
siyuanApiUrl: process.env.NUXT_PUBLIC_SIYUAN_API_URL ?? "http://127.0.0.1:6807",
waitTime: process.env.NUXT_PUBLIC_WAIT_TIME,
// defaultType: process.env.NUXT_PUBLIC_DEFAULT_TYPE,
defaultType: "siyuan",
// siyuanApiUrl: process.env.NUXT_PUBLIC_SIYUAN_API_URL,
siyuanApiUrl: "",
// waitTime: process.env.NUXT_PUBLIC_WAIT_TIME,
waitTime: "0",
},
},
})
26 changes: 22 additions & 4 deletions pages/share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,6 @@ const handleIpChange = (val: string) => {

<template>
<div id="share">
<div v-if="formData.accessCodeEnabled" class="share-item">
<el-alert type="warning" :description="t('share.accessCodeEnabled.tip')"></el-alert>
</div>

<div class="share-item share-subject">
<div class="item-left">
{{ t("share.share") }}
Expand Down Expand Up @@ -327,6 +323,25 @@ const handleIpChange = (val: string) => {
</div>
-->
</div>
<el-divider class="share-split" />

<div class="share-item">
<div class="item-left">
<el-space direction="vertical">
<el-text>
<el-icon>
<el-icon-apple />
</el-icon>
<span v-if="formData.accessCodeEnabled" class="share-warn-tip">
{{ t("share.accessCodeEnabled.tip") }}
</span>
<span v-else>
{{ t("share.public.tip") }}
</span>
</el-text>
</el-space>
</div>
</div>
</div>
</template>

Expand Down Expand Up @@ -386,4 +401,7 @@ const handleIpChange = (val: string) => {
display inline-flex
.change-ip-title
margin-right 10px
.share-warn-tip
color: red;
padding-left: 6px;
</style>

0 comments on commit a3efbb9

Please sign in to comment.