新增短链接

This commit is contained in:
ember 2025-12-05 00:42:46 +08:00
parent 97fe554325
commit c7a9f7048b
5 changed files with 18 additions and 8 deletions

File diff suppressed because one or more lines are too long

2
dist/index.html vendored
View File

@ -1 +1 @@
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>NEU小站课程评分系统</title><script defer="defer" src="/js/chunk-vendors.3aa9144b.js"></script><script defer="defer" src="/js/app.28be9dbd.js"></script><link href="/css/chunk-vendors.f2db5e15.css" rel="stylesheet"><link href="/css/app.854aac6c.css" rel="stylesheet"></head><body><noscript><strong>本系统需要JavaScript支持请启用JavaScript后继续。</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>NEU小站课程评分系统</title><script defer="defer" src="/js/chunk-vendors.3aa9144b.js"></script><script defer="defer" src="/js/app.416daf4a.js"></script><link href="/css/chunk-vendors.f2db5e15.css" rel="stylesheet"><link href="/css/app.d4fad9bc.css" rel="stylesheet"></head><body><noscript><strong>本系统需要JavaScript支持请启用JavaScript后继续。</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

2
dist/js/app.416daf4a.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -41,8 +41,8 @@
</div>
<div class="action-area">
<button class="share-btn" @click="shareCourse">
<span class="icon">🔗</span> 复制链接
<button class="share-btn" @click="shareCourse(true)">
<span class="icon">🔗</span> 复制链接
</button>
</div>
</div>
@ -588,8 +588,18 @@ export default {
base64Encode(value) { return btoa(value); },
shareCourse() {
const shareText = `https://course.xn--xhq44jb2fzpc.com/detail/${this.courseId}`;
shareCourse(useShortLink = false) {
let shareText;
//
if (useShortLink === true) {
// courseId Base64 URL (RFC 4648)
const base64Str = btoa(String(this.courseId));
const base64Url = base64Str.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
shareText = `https://s.ember.ac.cn/c/${base64Url}`;
} else {
shareText = `https://course.xn--xhq44jb2fzpc.com/detail/${this.courseId}`;
}
this.copyToClipboard(shareText);
this.showShareModal = true;
setTimeout(() => { this.showShareModal = false; }, 3000);