Commit 2ed9c7d7 by linjinhong

fix:修改问题

parent d6018825
...@@ -282,20 +282,6 @@ export default { ...@@ -282,20 +282,6 @@ export default {
.on("error", () => { .on("error", () => {
res.json({ code: 500, msg: "文件下载失败" }); res.json({ code: 500, msg: "文件下载失败" });
}); });
// let ws=fs.createWriteStream(dir );
// console.log(downloadByDesignId)
//
// ws.write(downloadByDesignId.data);
// ws.on('drain',function () {
// console.log("内存干了");
// });
// ws.on('error',function (err) {
// res.json({code: 500, msg: '文件下载失败'})
// });
// ws.on('close',function (err) {
//
// });
// ws.end()
} catch (err) { } catch (err) {
console.log(err); console.log(err);
res.json({ code: 500, msg: err }); res.json({ code: 500, msg: err });
...@@ -489,7 +475,7 @@ export default { ...@@ -489,7 +475,7 @@ export default {
msg = `清理错误: ${error.message}`; msg = `清理错误: ${error.message}`;
console.error(`清理错误: ${error.message}`); console.error(`清理错误: ${error.message}`);
} }
res.json({ code: 500, msg: msg }); res.json({ code: 205, msg: msg });
} }
}, },
saveToPng: async (req, res) => { saveToPng: async (req, res) => {
......
...@@ -61,6 +61,9 @@ service.interceptors.response.use( ...@@ -61,6 +61,9 @@ service.interceptors.response.use(
if (res.code === 411) { if (res.code === 411) {
return Promise.resolve(res); return Promise.resolve(res);
} }
if (res.code === 205) {
return Promise.resolve(res);
}
if (res.code === 403) { if (res.code === 403) {
Vue.prototype.$dataStore.delete("user"); Vue.prototype.$dataStore.delete("user");
Vue.prototype.$message.error({ Vue.prototype.$message.error({
......
...@@ -234,36 +234,11 @@ function insertAfter(newElement, targetElement) { ...@@ -234,36 +234,11 @@ function insertAfter(newElement, targetElement) {
} }
} }
export function extractValue(str, delimiter = "_", positionType = "last") { export function extractValue(str) {
// 如果字符串不包含分隔符,返回空字符串 console.log(238, str);
if (!str.includes(delimiter)) return "";
// 分割字符串
const parts = str.split(delimiter);
let position; // 如果字符串不包含分隔符,返回空字符串
if (!str.includes("_")) return "";
// 根据位置类型确定要提取的位置 if (str.includes("_A_")) return "A";
switch (positionType) { if (str.includes("_B_")) return "B";
case "first":
position = 0;
break;
case "second":
position = 1;
break;
case "third":
position = 2;
break;
case "last":
position = parts.length - 2;
break;
default:
position = parts.length - 1;
}
// 检查位置是否有效
if (position < 0 || position >= parts.length) return "";
// 返回指定位置的值
return parts[position];
} }
...@@ -263,6 +263,20 @@ export default { ...@@ -263,6 +263,20 @@ export default {
if (typeof this.detail.imageAry == "string") { if (typeof this.detail.imageAry == "string") {
this.detail.imageAry = JSON.parse(this.detail.imageAry); this.detail.imageAry = JSON.parse(this.detail.imageAry);
} }
this.detail.imageAry = this.detail.imageAry.sort((a, b) => {
// 检查 a.title 是否为 '正' 或 'A'
const isAPriority = a.title === "正" || a.title === "A";
// 检查 b.title 是否为 '正' 或 'A'
const isBPriority = b.title === "正" || b.title === "A";
// 如果 a 是优先项而 b 不是,a 排前面
if (isAPriority && !isBPriority) return -1;
// 如果 b 是优先项而 a 不是,b 排前面
if (!isAPriority && isBPriority) return 1;
// 其他情况保持原顺序(稳定排序)
return 0;
});
console.log(249, this.detail.imageAry); console.log(249, this.detail.imageAry);
}, },
col: { col: {
...@@ -1126,6 +1140,7 @@ export default { ...@@ -1126,6 +1140,7 @@ export default {
this.hasSize = !!size; this.hasSize = !!size;
this.detail.designImageSize = size; this.detail.designImageSize = size;
console.log(this.detail, "this.detail"); console.log(this.detail, "this.detail");
this.imgList = []; this.imgList = [];
this.selectIndex = -1; this.selectIndex = -1;
if (value.length > 0) { if (value.length > 0) {
......
...@@ -128,6 +128,17 @@ module.exports = { ...@@ -128,6 +128,17 @@ module.exports = {
win: { win: {
requestedExecutionLevel: "requireAdministrator", requestedExecutionLevel: "requireAdministrator",
target: [
{
target: "nsis",
arch: ["x64", "ia32"], // 支持64位和32位系统
},
],
},
nsis: {
oneClick: false, // 禁用一键安装
allowToChangeInstallationDirectory: true, // 允许用户更改安装目录
perMachine: true, // 为所有用户安装
}, },
}, },
}, },
......
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