File tree Expand file tree Collapse file tree 5 files changed +21
-3
lines changed
Expand file tree Collapse file tree 5 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " sub-store-front-end" ,
3- "version" : " 2.15.77 " ,
3+ "version" : " 2.15.78 " ,
44 "private" : true ,
55 "scripts" : {
66 "dev" : " vite --host" ,
Original file line number Diff line number Diff line change 8383 </div >
8484 </div >
8585 <p v-if =" !appearanceSetting.isSimpleMode" class =" sub-item-remark" >
86- <span >创建时间: {{ createTime }}</span >
86+ <span >{{ t(`sharePage.createTimeLabel`) }} {{ createTime }}</span >
8787 </p >
8888 <p class =" sub-item-remark" >
89- <span >到期时间: {{ expiresTime }}</span >
89+ <span >{{ t(`sharePage.expiredLabel`) }} {{ expiresTime }}</span >
9090 </p >
9191
9292 <!-- 分享备注 -->
@@ -345,6 +345,12 @@ const secretPath = computed(() => {
345345const getShareUrl = () => {
346346 try {
347347 const { type, name, token } = props .data ;
348+ if (! secretPath .value .startsWith (' /' )) {
349+ Toast .fail (t (' sharePage.magicPathErrorNotify' ));
350+ throw new Error (
351+ t (" sharePage.magicPathErrorNotify" ),
352+ );
353+ }
348354 const shareUrl = ` ${host .value .replace (
349355 new RegExp (` ${secretPath .value }$ ` ),
350356 " " ,
Original file line number Diff line number Diff line change @@ -779,6 +779,9 @@ export default {
779779 noOriginalTips : "Failed to jump, check if the source data has been deleted." ,
780780 leftTime : "Remaining time" ,
781781 expired : "Expired" ,
782+ expiredLabel : "Expiration Time: " ,
783+ createTimeLabel : "Creation Time: " ,
784+ magicPathErrorNotify : "SUB_STORE_FRONTEND_BACKEND_PATH should start with /, please check the configuration!" ,
782785 createShare : {
783786 expiresValue : {
784787 label : "Valid for" ,
Original file line number Diff line number Diff line change @@ -769,6 +769,9 @@ export default {
769769 noOriginalTips : "跳转失败, 检查源数据是否已删除" ,
770770 leftTime : "剩余" ,
771771 expired : "已过期" ,
772+ expiredLabel : "过期时间:" ,
773+ createTimeLabel : "创建时间:" ,
774+ magicPathErrorNotify : "SUB_STORE_FRONTEND_BACKEND_PATH 必须以 / 开头,当前分享链接异常,请检查运行环境" ,
772775 createShare : {
773776 expiresValue : {
774777 label : "有效期时长" ,
Original file line number Diff line number Diff line change @@ -550,6 +550,12 @@ const handleCreateShare = async () => {
550550 if (res ?.data ?.status === " success" ) {
551551 isCreateShareLinkSuccess .value = true ;
552552 const { token } = res .data .data ;
553+ if (! secretPath .value .startsWith (' /' )) {
554+ Toast .fail (t (' sharePage.magicPathErrorNotify' ));
555+ throw new Error (
556+ t (" sharePage.magicPathErrorNotify" ),
557+ );
558+ }
553559 const shareUrl = ` ${host .value .replace (new RegExp (` ${secretPath .value }$ ` ), " " )}/share/${typeMap [form .type ]}/${encodeURIComponent (
554560 props .data .name ,
555561 )}?token=${encodeURIComponent (token )} ` ;
You can’t perform that action at this time.
0 commit comments