Commit fc76859c authored by daniel's avatar daniel

fix(cdn): cdn优化加速

parent d67f6e08
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>赛包邮寄</title> <title>赛包邮寄</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<!-- <script nomodule <!-- <script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> --> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> -->
<script type="module" <script type="module"
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>后台管理系统</title> <title>后台管理系统</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<script type="module" <script type="module"
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
<script nomodule <script nomodule
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>免责声明</title> <title>免责声明</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<script type="module" <script type="module"
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
<script nomodule <script nomodule
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>赛事反馈</title> <title>赛事反馈</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<!-- <script nomodule <!-- <script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> --> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> -->
<script type="module" <script type="module"
...@@ -321,7 +321,7 @@ ...@@ -321,7 +321,7 @@
// 分类切换,刷新table // 分类切换,刷新table
const changeCategory = (index) => { const changeCategory = (index) => {
categoryIndex.value = index categoryIndex.value = index
pagination.value.page = 1 pagination.page = 1
getFeedBacks() getFeedBacks()
} }
const resetCategoryFormValue = () => { const resetCategoryFormValue = () => {
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>预约发枪</title> <title>预约发枪</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<!-- <script nomodule <!-- <script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> --> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> -->
<script type="module" <script type="module"
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>发票管理</title> <title>发票管理</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<!-- <script nomodule <!-- <script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> --> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> -->
<script type="module" <script type="module"
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>领物导航</title> <title>领物导航</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<!-- <script nomodule <!-- <script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> --> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> -->
<script type="module" <script type="module"
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>点位标注</title> <title>点位标注</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<script type="module" <script type="module"
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
<script nomodule <script nomodule
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>自选号规则</title> <title>自选号规则</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<!-- <script nomodule <!-- <script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> --> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> -->
<script type="module" <script type="module"
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>自助选号</title> <title>自助选号</title>
<!-- ... 保留原有的 Vue 引入 ... --> <!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script> <script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 --> <!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 --> <!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script> <script src="${ctxStatic}/navie-ui/index.min.js"></script>
<!-- <script nomodule <!-- <script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> --> src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> -->
<script type="module" <script type="module"
......
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>
<%@ taglib prefix="fnc" uri="/WEB-INF/tlds/fnc.tld" %>
<c:set var="ctx" value="${pageContext.request.contextPath}${fns:getAdminPath()}" />
<c:set var="path" value="${pageContext.request.contextPath}${fns:getPath()}" />
<c:set var="jaaproot" value="${pageContext.request.contextPath}" />
<c:set var="ctxStatic" value="${pageContext.request.contextPath}/static" />
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小程序链接+二维码</title>
<!-- ... 保留原有的 Vue 引入 ... -->
<script src="${ctxStatic}/vue/vue.global.min.js"></script>
<!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 -->
<script src="${ctxStatic}/navie-ui/index.min.js"></script>
<script type="module"
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
<script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
<!-- Favicon-->
<link rel="shortcut icon" href="https://img.geexek.com/files/home/favicon.ico">
<!-- 自定义css -->
<link rel="stylesheet" href="${ctxStatic}/css/base.css">
<!-- Bootstrap CSS-->
<link rel="stylesheet"
href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
<!-- theme stylesheet-->
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/style.default.css?v=<%=System.currentTimeMillis()%>"
id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<!-- Favicon-->
<link rel="shortcut icon" href="https://img.geexek.com/files/home/favicon.ico">
<link rel="stylesheet"
href="${ctxStatic}/cmpt/setting.css?v=<%=System.currentTimeMillis()%>">
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script>
<style>
#app {
padding: 0 20px 20px 20px;
}
.layout {
min-height: 100vh;
}
.carousel-img {
width: 100%;
height: 240px;
object-fit: cover;
}
[v-cloak] {
display: none;
}
.n-message .n-message__icon>* {
position: absolute;
left: 0;
top: -5px !important;
right: 0;
bottom: 0;
}
.n-dialog__icon>* {
position: absolute;
left: 0;
top: -2px !important;
right: 0;
bottom: 0;
}
.light-green {
height: 108px;
background-color: rgba(0, 128, 0, 0.12);
}
.green {
height: 108px;
background-color: rgba(0, 128, 0, 0.24);
}
/* Quill编辑器样式 */
#editor {
height: 200px;
background: #fff;
}
.ql-toolbar {
border-radius: 4px 4px 0 0;
background: #f5f5f5;
}
.ql-container {
border-radius: 0 0 4px 4px;
}
</style>
</head>
<body>
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
<jsp:include page="../common/menu.jsp"></jsp:include>
<div id="app" class="flex-1" v-cloak>
<n-config-provider :locale="locale" :date-locale="dateLocale">
<n-modal-provider>
<n-message-provider>
<n-notification-provider>
<my-app></my-app>
</n-notification-provider>
</n-message-provider>
</n-modal-provider>
</n-config-provider>
</div>
</div>
<script type="text/x-template" id="my-app">
<n-spin :show="loading" >
<n-space vertical :size="16" class="w-full">
<n-space class="w-full">
<n-card title="小程序二维码" style="width:30vw;">
<div class="flex flex-col w-full items-start gap-y-3">
<div class="flex flex-col w-full items-start gap-y-3">
<span class="flex-shrink-0">小程序地址 </span>
<n-input v-model:value="params.path" placeholder="请输入小程序路径,例如:pages/index/index" />
<span class="flex-shrink-0">二维码宽度 </span>
<n-input-number :min="1" :max="1280" v-model:value="params.width" placeholder="请输入二维码宽度最大1280" />
<n-button type="primary" @click="generateQrCode" block>
生成小程序二维码
</n-button>
</div>
</div>
</n-card>
<!-- 只允许上传png -->
<n-card title="小程序二维码" style="width:30vw;">
<n-image
v-if="qrImage"
width="300"
:src="qrImage"
/>
<span v-else>未生成</span>
</n-card>
</n-space>
<n-space class="w-full">
<n-card title="小程序短连接" style="width:30vw;">
<div class="flex flex-col w-full items-start gap-y-3">
<div class="flex flex-col w-full items-start gap-y-3">
<span class="flex-shrink-0">小程序地址 </span>
<n-input v-model:value="params.page" placeholder="请输入小程序路径,例如:pages/index/index" />
<span class="flex-shrink-0">小程序参数 </span>
<n-input v-model:value="params.query" placeholder="请输入小程序参数,例如:key=value&key2=value2" />
<n-button type="primary" @click="generateUrlLink" block>
生成小程序UrlLink
</n-button>
<n-button type="primary" @click="generateUrlScheme" block>
生成小程序UrlScheme
</n-button>
</div>
</div>
</n-card>
<!-- 纵向布局 -->
<n-space vertical :size="16">
<n-card title="小程序短链接UrlLink" style="width:30vw;" >
<n-space vertical :size="16">
<n-alert title="功能描述" type="success">
获取小程序 URL Link,适用于短信、邮件、网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放,详见获取 URL Link
</n-alert>
<span >{{urlLink||'未生成'}}</span>
<n-button type="primary" v-if="urlLink" @click="copyUrlLink" block>
复制小程序UrlLink
</n-button>
</n-space>
</n-card>
<n-card title="小程序UrlScheme" style="width:30vw;">
<n-space vertical :size="16">
<n-alert title="功能描述" type="success">
该接口用于获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放,详见获取 URL scheme。
</n-alert>
<span >{{urlSchema||'未生成'}}</span>
<n-button v-if="urlSchema" type="primary" @click="copyUrlScheme" block>
复制小程序UrlScheme
</n-button>
</n-space>
</n-card>
</n-space>
</n-space>
</n-space>
</n-spin>
</script>
<script>
// 枚举class
class SuperEnum {
constructor(param) {
const keyObj = {};
const valueObj = {};
const nameObj = {};
if (!Array.isArray(param)) {
throw new TypeError('param is not an array!');
}
param.forEach((element) => {
if (!element.key || !element.name) {
return;
}
// 使用对象存储键值对,方便快速查找
keyObj[element.key] = element;
valueObj[element.value] = element;
nameObj[element.name] = element;
// 动态添加属性
this[element.key] = element;
this[element.name] = element;
if (element.key !== element.value) {
this[element.value] = element;
}
});
// 保存源数组
this.data = param;
this.keyObj = keyObj;
this.valueObj = valueObj;
this.nameObj = nameObj;
// 防止被修改
Object.freeze(this);
}
getColorByKey(key) {
const prop = this.keyOf(key);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.color;
}
getData() {
return this.data;
}
getKeyByName(name) {
const prop = this.nameOf(name);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.key;
}
getNameByKey(key) {
const prop = this.keyOf(key);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.name;
}
getNameByValue(value) {
const prop = this.valueOf(value);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.name;
}
getValueByKey(key) {
const prop = this.keyOf(key);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.value;
}
getValueByName(name) {
const prop = this.nameOf(name);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.value;
}
keyOf(key) {
return this.keyObj[key];
}
nameOf(name) {
return this.nameObj[name];
}
valueOf(value) {
return this.valueObj[value];
}
}
// to 方法,封装try catch
const to = async (
promise,
errorExt,
) => {
try {
const data = await promise
const result = [null, data]
return result
} catch (error) {
if (errorExt) {
const parsedError = Object.assign({}, error, errorExt)
return [parsedError, undefined]
}
return [error, undefined]
}
}
</script>
<script>
const { createApp, defineComponent, onBeforeUnmount, reactive, ref, onMounted, h, computed } = Vue;
const { useMessage, useNotification, dateZhCN, zhCN } = naive
const qrCodeUrl = window.location.origin + '/gk/wechatMini/wxQrCode'
const urlLinkUrl = window.location.origin + '/gk/wechatMini/wxUrlLink'
const urlSchemaUrl = window.location.origin + '/gk/wechatMini/wxUrlSchema'
// const cmpt = JSON.parse('${fns:toJson(cmpt)}');
const MyApp = defineComponent({
name: 'MyApp',
template: '#my-app',
setup() {
const message = useMessage()
const notification = useNotification()
const loading = ref(false)
/***---------------- 设置信息 start -----------------*/
const params = reactive({
path: '',
width: 1280,
page: '',
query: '',
cmptId: getCId(),
})
const qrImage = ref('')
const urlLink = ref('')
const urlSchema = ref('')
// 文件下载
const generateQrCode = () => {
if (!params.path) {
message.error('请填写生成的小程序路径')
return
}
loading.value = true
qrImage.value = qrCodeUrl + '?' + new URLSearchParams(params)
// 判断图片是否存在
const img = new Image()
img.src = qrImage.value
img.onload = function () {
loading.value = false
}
img.onerror = function () {
message.error('小程序二维码加载失败')
loading.value = false
}
}
// 生成小程序链接urlLink
const generateUrlLink = async () => {
if (!params.page) {
message.error('请填写生成的小程序路径')
return
}
loading.value = true
const messageReactive = message.loading('生成中...', {
duration: 0
})
// 发起请求
const [err, data] = await to(fetch(urlLinkUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json()))
loading.value = false
messageReactive.destroy()
if (data.code === 200) {
message.success('生成成功')
urlLink.value = data.content
} else {
message.error(data.msg)
}
}
// 生成小程序链接urlLink
const generateUrlScheme = async () => {
if (!params.page) {
message.error('请填写生成的小程序路径')
return
}
loading.value = true
const messageReactive = message.loading('生成中...', {
duration: 0
})
// 发起请求
const [err, data] = await to(fetch(urlSchemaUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json()))
loading.value = false
messageReactive.destroy()
if (data.code === 200) {
message.success('生成成功')
urlSchema.value = data.content
} else {
message.error(data.msg)
}
}
// 复制小程序链接urlLink
const copyUrlLink = () => {
if (!urlLink.value) {
message.error('请先生成小程序链接')
return
}
copyText(urlLink.value)
message.success('复制成功')
}
// 复制小程序链接urlScheme
const copyUrlScheme = () => {
if (!urlSchema.value) {
message.error('请先生成小程序链接')
return
}
copyText(urlSchema.value)
message.success('复制成功')
}
// 复制文本
const copyText = async (text) => {
try {
await navigator.clipboard.writeText(text);
console.log("复制成功:", text);
} catch (err) {
console.error("复制失败:", err);
}
};
onMounted(() => {
qrImage.value = ""
urlLink.value = ""
urlSchema.value = ""
})
return {
loading,
generateQrCode,
qrImage,
params,
generateUrlLink,
generateUrlScheme,
copyUrlLink,
copyUrlScheme,
urlLink,
urlSchema
}
}
})
const app = Vue.createApp({
setup() {
return {
locale: zhCN,
dateLocale: dateZhCN
}
}
})
app.component('my-app', MyApp)
app.use(naive)
app.mount('#app')
</script>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment