Compare commits
7 Commits
custom/281
...
release/v1
| Author | SHA1 | Date | |
|---|---|---|---|
| e8ccb87266 | |||
| 153c84266a | |||
| 7ae7a1d3bd | |||
| 1ebb94e9e2 | |||
| 9b53540f91 | |||
| 2223636184 | |||
| 6144dc72b8 |
@@ -38,6 +38,10 @@ const localDevConfig = ({
|
|||||||
uniacid: 1,
|
uniacid: 1,
|
||||||
domain: 'https://test.aigc-quickapp.com',
|
domain: 'https://test.aigc-quickapp.com',
|
||||||
},
|
},
|
||||||
|
'local-2': { // 测试平台
|
||||||
|
uniacid: 2,
|
||||||
|
domain: 'http://localhost:8050/',
|
||||||
|
},
|
||||||
})['2811']; // 选择要使用的环境配置
|
})['2811']; // 选择要使用的环境配置
|
||||||
|
|
||||||
export default localDevConfig;
|
export default localDevConfig;
|
||||||
@@ -6,13 +6,23 @@
|
|||||||
/**
|
/**
|
||||||
* 显示错误信息
|
* 显示错误信息
|
||||||
* @param {Exception} err
|
* @param {Exception} err
|
||||||
|
* @param {Boolean} useModal
|
||||||
*/
|
*/
|
||||||
const showError = (err) => {
|
const showError = (err, useModal = false) => {
|
||||||
|
const content = err?.message || err?.errMsg || err?.toString();
|
||||||
|
if (!useModal) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err?.message || err?.errMsg || err?.toString(),
|
title: content,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 3000
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
uni.showModal({
|
||||||
|
title: '错误提示',
|
||||||
|
content,
|
||||||
|
showCancel: false,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,43 +43,92 @@ export const makePhoneCall = (mobile) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拷贝文本
|
* 拷贝文本(返回 Promise)
|
||||||
* @param {*} text
|
* @param {*} text
|
||||||
* @param {*} options
|
* @param {*} options
|
||||||
|
* @returns {Promise} 返回 Promise,成功时 resolve,失败时 reject
|
||||||
*/
|
*/
|
||||||
export const copyText = (text, { copySuccess = '', copyFailed = '' } = {}) => {
|
export const copyTextAsync = (text, { copySuccess = '', copyFailed = '' } = {}) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// 输入验证
|
||||||
|
if (!text && text !== '') {
|
||||||
|
const error = new Error('复制文本不能为空');
|
||||||
|
showError(error);
|
||||||
|
reject(error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 超时监测
|
||||||
|
const timeoutId = setTimeout(() => {
|
||||||
|
let error = new Error('复制操作长时间无响应,请检查相关权限及配置是否正确');
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
error = new Error([
|
||||||
|
'复制操作长时间无响应!',
|
||||||
|
'原因:',
|
||||||
|
'1.微信平台->用户隐私保护指引->"剪贴板"功能未添加或审核未通过;',
|
||||||
|
'2.微信平台对剪贴板API调用频率有限制'
|
||||||
|
].join('\r\n'));
|
||||||
|
// #endif
|
||||||
|
showError(error, true);
|
||||||
|
reject(error);
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('copyText');
|
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: `${text}`,
|
data: `${text}`,
|
||||||
success: () => {
|
success: (res) => {
|
||||||
console.error('复制成功');
|
clearTimeout(timeoutId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (copySuccess) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: copySuccess,
|
title: copySuccess,
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showError(e);
|
showError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resolve(res);
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.error('复制失败:', err);
|
clearTimeout(timeoutId);
|
||||||
try {
|
try {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.message || err.errMsg || copyFailed,
|
title: err.message || err.errMsg || copyFailed || '复制失败',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showError(e);
|
showError(e);
|
||||||
}
|
}
|
||||||
|
reject(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
showError(err);
|
showError(err);
|
||||||
|
reject(err);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拷贝文本(回调形式,兼容旧代码)
|
||||||
|
* @param {*} text
|
||||||
|
* @param {*} options
|
||||||
|
* @param {Function} callback 回调函数,接收 (success, error) 参数
|
||||||
|
*/
|
||||||
|
export const copyText = (text, options = {}, callback) => {
|
||||||
|
copyTextAsync(text, options)
|
||||||
|
.then(res => {
|
||||||
|
if (callback) callback(true, null);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
if (callback) callback(false, err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"mp-weixin": "node scripts/mp-weixin.patch.js"
|
"mp-weixin": "node scripts/mp-weixin.patch.js",
|
||||||
|
"mp-weixin:patch": "node scripts/mp-weixin.patch.js --no-zip",
|
||||||
|
"mp-weixin:dev": "node scripts/mp-weixin.patch.js --mode development",
|
||||||
|
"mp-weixin:dev:patch": "node scripts/mp-weixin.patch.js --mode development --no-zip"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dart-sass": "^1.25.0",
|
"dart-sass": "^1.25.0",
|
||||||
|
|||||||
@@ -1,19 +1,38 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="padding: 20rpx;" :style="themeColor">
|
<view class="view-container" :style="themeColor">
|
||||||
<rich-text :nodes="content"></rich-text>
|
<!-- 加载状态 -->
|
||||||
|
<view v-if="loading" class="loading-state">
|
||||||
|
<view class="loading-spinner"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 空状态 -->
|
||||||
|
<view v-else-if="!content" class="empty-state">
|
||||||
|
<view class="empty-icon">📄</view>
|
||||||
|
<text class="empty-title">暂无内容</text>
|
||||||
|
<text class="empty-desc">该协议内容暂未设置</text>
|
||||||
|
<button class="empty-button" @click="getcontent">重新加载</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 内容状态 -->
|
||||||
|
<rich-text v-else :nodes="content"></rich-text>
|
||||||
|
|
||||||
|
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import htmlParser from '@/common/js/html-parser';
|
import htmlParser from '@/common/js/html-parser';
|
||||||
|
import scroll from '@/common/js/scroll-view.js';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
content: '',
|
content: '',
|
||||||
type: '',
|
type: '',
|
||||||
uniacid:0
|
uniacid: 0,
|
||||||
|
loading: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mixins: [scroll],
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.type = option.type
|
this.type = option.type
|
||||||
this.uniacid = option.uniacid ? option.uniacid : 0
|
this.uniacid = option.uniacid ? option.uniacid : 0
|
||||||
@@ -26,6 +45,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getcontent() {
|
getcontent() {
|
||||||
|
this.loading = true
|
||||||
// privacy content
|
// privacy content
|
||||||
var data = {
|
var data = {
|
||||||
type: this.type
|
type: this.type
|
||||||
@@ -40,6 +60,10 @@ export default {
|
|||||||
title: res.data.title
|
title: res.data.title
|
||||||
})
|
})
|
||||||
this.content = res.data.content
|
this.content = res.data.content
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
this.loading = false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -47,6 +71,117 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
|
.view-container {
|
||||||
|
padding: 40rpx;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06), 0 1rpx 2rpx rgba(0, 0, 0, 0.09);
|
||||||
|
margin: 4rpx 20rpx;
|
||||||
|
// max-width: 800rpx;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
min-height: 100vh;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 增强纸张纹理效果
|
||||||
|
.view-container::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="0.5" fill="%23f5f5f5" opacity="0.3"/><circle cx="75" cy="75" r="0.3" fill="%23f0f0f0" opacity="0.2"/><circle cx="15" cy="85" r="0.4" fill="%23f8f8f8" opacity="0.25"/><circle cx="85" cy="15" r="0.2" fill="%23ebebeb" opacity="0.3"/><path d="M0 0L200 200M200 0L0 200" stroke="%23f2f2f2" stroke-width="0.3" fill="none" opacity="0.15"/></pattern></defs><rect width="200" height="200" fill="url(%23grain)"/></svg>');
|
||||||
|
opacity: 0.4;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载状态样式
|
||||||
|
.loading-state {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: 60vh;
|
||||||
|
padding: 40rpx;
|
||||||
|
|
||||||
|
.loading-spinner {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
border: 4rpx solid #f3f3f3;
|
||||||
|
border-top: 4rpx solid #6c8ebf;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 空状态样式
|
||||||
|
.empty-state {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: 60vh;
|
||||||
|
padding: 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.empty-icon {
|
||||||
|
font-size: 120rpx;
|
||||||
|
margin-bottom: 32rpx;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #4e5969;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-desc {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #8492a6;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-button {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
line-height: 70rpx;
|
||||||
|
background-color: #6c8ebf;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 35rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(108, 142, 191, 0.3);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #5a78a8;
|
||||||
|
transform: translateY(-2rpx);
|
||||||
|
box-shadow: 0 4rpx 12rpx rgba(108, 142, 191, 0.4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .mescroll-totop {
|
||||||
|
right: 27rpx !important;
|
||||||
|
bottom: 120rpx !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -10,8 +10,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 消息列表 -->
|
<!-- 消息列表 -->
|
||||||
<view v-for="(message, index) in messages" :key="`msg-${message.id || message.timestamp}-${index}`"
|
<view v-for="item in messagesWithKey" :key="item.__renderKey" class="message-item" :class="[item.role, { 'first-message': item.__index === 0 }]">
|
||||||
class="message-item" :class="[message.role, { 'first-message': index === 0 }]">
|
|
||||||
|
|
||||||
<!-- 用户消息 -->
|
<!-- 用户消息 -->
|
||||||
<view v-if="message.role === 'user'" class="user-message">
|
<view v-if="message.role === 'user'" class="user-message">
|
||||||
@@ -392,6 +391,19 @@ export default {
|
|||||||
isFetchingHistory: false
|
isFetchingHistory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 为每条消息生成兼容小程序的唯一 key
|
||||||
|
messagesWithKey() {
|
||||||
|
return this.messages.map((msg, idx) => {
|
||||||
|
const uniqueId = msg.id || msg.timestamp || idx;
|
||||||
|
return {
|
||||||
|
...msg,
|
||||||
|
__renderKey: `msg_${uniqueId}_${idx}`,
|
||||||
|
__index: idx // 保留原始索引,用于判断 first-message 等
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// 优先读取本地缓存的会话 ID
|
// 优先读取本地缓存的会话 ID
|
||||||
const localConvId = this.getConversationIdFromLocal();
|
const localConvId = this.getConversationIdFromLocal();
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"description": "项目配置文件",
|
"description": "项目配置文件",
|
||||||
"packOptions": {
|
"packOptions": {
|
||||||
"ignore": []
|
"ignore": [],
|
||||||
|
"include": []
|
||||||
},
|
},
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": true,
|
"urlCheck": true,
|
||||||
"es6": true,
|
"es6": true,
|
||||||
"enhance": false,
|
"enhance": true,
|
||||||
"postcss": true,
|
"postcss": true,
|
||||||
"preloadBackgroundData": false,
|
"preloadBackgroundData": false,
|
||||||
"minified": true,
|
"minified": true,
|
||||||
@@ -37,7 +38,15 @@
|
|||||||
"userConfirmedBundleSwitch": false,
|
"userConfirmedBundleSwitch": false,
|
||||||
"packNpmManually": false,
|
"packNpmManually": false,
|
||||||
"packNpmRelationList": [],
|
"packNpmRelationList": [],
|
||||||
"minifyWXSS": true
|
"minifyWXSS": true,
|
||||||
|
"condition": true,
|
||||||
|
"swc": false,
|
||||||
|
"disableSWC": true,
|
||||||
|
"minifyWXML": true,
|
||||||
|
"compileWorklet": true,
|
||||||
|
"localPlugins": false,
|
||||||
|
"disableUseStrict": false,
|
||||||
|
"useCompilerPlugins": false
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "2.16.1",
|
"libVersion": "2.16.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"libVersion": "3.12.0",
|
"libVersion": "3.12.0",
|
||||||
"projectname": "lucky_shop",
|
"projectname": "mp-weixin",
|
||||||
"condition": {},
|
"condition": {},
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": true,
|
"urlCheck": true,
|
||||||
|
|||||||
@@ -9,7 +9,10 @@
|
|||||||
* 如果这个文件开头已经有了这行代码,则不追加
|
* 如果这个文件开头已经有了这行代码,则不追加
|
||||||
*
|
*
|
||||||
* 使用:
|
* 使用:
|
||||||
* node fix-wechat-miniapp.js
|
* node fix-wechat-miniapp.js # 打补丁并创建 ZIP 文件(默认 mode=production)
|
||||||
|
* node fix-wechat-miniapp.js --no-zip # 只打补丁,不创建 ZIP 文件
|
||||||
|
* node fix-wechat-miniapp.js --mode development # 使用 development 模式打补丁
|
||||||
|
* node fix-wechat-miniapp.js --mode production # 使用 production 模式打补丁(默认)
|
||||||
*
|
*
|
||||||
* 注意:
|
* 注意:
|
||||||
* - 在 Windows 上路径使用反斜杠也是可以的;脚本使用 path.join 来兼容不同平台。
|
* - 在 Windows 上路径使用反斜杠也是可以的;脚本使用 path.join 来兼容不同平台。
|
||||||
@@ -29,8 +32,6 @@ async function commonPatch(mode = 'production') {
|
|||||||
// 根据当前脚本所在目录(scripts),定位到项目根目录
|
// 根据当前脚本所在目录(scripts),定位到项目根目录
|
||||||
const cwd = path.join(__dirname, '..');
|
const cwd = path.join(__dirname, '..');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const srcSitePath = path.join(cwd, 'site.js');
|
const srcSitePath = path.join(cwd, 'site.js');
|
||||||
const destDir = path.join(cwd, 'unpackage', 'dist', mode === 'production' ? 'build' : 'dev', 'mp-weixin');
|
const destDir = path.join(cwd, 'unpackage', 'dist', mode === 'production' ? 'build' : 'dev', 'mp-weixin');
|
||||||
const destSitePath = path.join(destDir, 'site.js');
|
const destSitePath = path.join(destDir, 'site.js');
|
||||||
@@ -47,6 +48,22 @@ async function commonPatch(mode = 'production') {
|
|||||||
// 确保目标目录存在
|
// 确保目标目录存在
|
||||||
await ensureDir(destDir);
|
await ensureDir(destDir);
|
||||||
|
|
||||||
|
// 复制 project.config.json 及 project.private.config.json 文件到 destDir 下面
|
||||||
|
const configFiles = ['project.config.json', 'project.private.config.json'];
|
||||||
|
for (const fileName of configFiles) {
|
||||||
|
const srcPath = path.join(cwd, fileName);
|
||||||
|
const destPath = path.join(destDir, fileName);
|
||||||
|
|
||||||
|
// 检查源文件是否存在
|
||||||
|
const fileExists = await exists(srcPath);
|
||||||
|
if (fileExists) {
|
||||||
|
await fsp.copyFile(srcPath, destPath);
|
||||||
|
console.log(`已拷贝: ${srcPath} -> ${destPath}`);
|
||||||
|
} else {
|
||||||
|
console.warn(`源文件不存在,跳过复制: ${srcPath}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 复制 site.js 到目标目录(覆盖)
|
// 复制 site.js 到目标目录(覆盖)
|
||||||
await fsp.copyFile(srcSitePath, destSitePath);
|
await fsp.copyFile(srcSitePath, destSitePath);
|
||||||
console.log(`已拷贝: ${srcSitePath} -> ${destSitePath}`);
|
console.log(`已拷贝: ${srcSitePath} -> ${destSitePath}`);
|
||||||
@@ -96,14 +113,26 @@ async function commonPatch(mode = 'production') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
// 解析命令行参数
|
||||||
|
const argv = process.argv.slice(2);
|
||||||
|
const options = {
|
||||||
|
noZip: argv.includes('--no-zip'),
|
||||||
|
mode: 'production' // 默认值
|
||||||
|
};
|
||||||
|
|
||||||
|
// 解析 --mode 参数
|
||||||
|
const modeIndex = argv.indexOf('--mode');
|
||||||
|
if (modeIndex !== -1 && modeIndex + 1 < argv.length) {
|
||||||
|
options.mode = argv[modeIndex + 1];
|
||||||
|
}
|
||||||
|
|
||||||
// 1) 打补丁
|
// 1) 打补丁
|
||||||
await commonPatch('production');
|
await commonPatch(options.mode);
|
||||||
// await commonPatch('development');
|
// await commonPatch('development');
|
||||||
|
|
||||||
// 2) 创建 ZIP 文件
|
// 2) 创建 ZIP 文件(如果未指定 --no-zip)
|
||||||
|
if (!options.noZip) {
|
||||||
const cwd = path.join(__dirname, '..');
|
const cwd = path.join(__dirname, '..');
|
||||||
const sourceDir = path.join(cwd, 'unpackage', 'dist', 'build', 'mp-weixin');
|
const sourceDir = path.join(cwd, 'unpackage', 'dist', 'build', 'mp-weixin');
|
||||||
const destDir = path.join(cwd, 'unpackage', 'dist', 'build');
|
const destDir = path.join(cwd, 'unpackage', 'dist', 'build');
|
||||||
@@ -112,6 +141,9 @@ async function main() {
|
|||||||
|
|
||||||
// 3) 自动打开zip所在的目录
|
// 3) 自动打开zip所在的目录
|
||||||
await openFileDirectory(zipFilePath);
|
await openFileDirectory(zipFilePath);
|
||||||
|
} else {
|
||||||
|
console.log('跳过创建 ZIP 文件和打开目录');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function exists(p) {
|
async function exists(p) {
|
||||||
|
|||||||
Reference in New Issue
Block a user