feat: 完善对象存储上传与真实条码二维码引擎,彻底剥离保底Mock数据
这个提交包含在:
26
admin/.arco-cli/after-init.js
普通文件
26
admin/.arco-cli/after-init.js
普通文件
@@ -0,0 +1,26 @@
|
||||
const { spawnSync } = require('child_process');
|
||||
|
||||
const isWindows = process.platform === 'win32';
|
||||
const cmd = isWindows ? 'pnpm.cmd' : 'pnpm';
|
||||
|
||||
const logInfo = (messages) => {
|
||||
messages.forEach((m) => {
|
||||
console.log(`\x1B[32m${m}\x1B[0m`);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = ({ projectName }) => {
|
||||
const { error } = spawnSync(cmd, ['add', 'arco-design-pro-vue']);
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
logInfo([
|
||||
'******************************************************************************',
|
||||
' Read README.md for help information. Execute following command to start',
|
||||
` $ cd ${projectName}`,
|
||||
' $ pnpm run dev',
|
||||
'******************************************************************************',
|
||||
]);
|
||||
};
|
||||
28
admin/.arco-cli/init.js
普通文件
28
admin/.arco-cli/init.js
普通文件
@@ -0,0 +1,28 @@
|
||||
const { spawnSync } = require('child_process');
|
||||
|
||||
const FRAMEWORK_LIST = ['cra', 'next', 'vite'];
|
||||
|
||||
const isWindows = process.platform === 'win32';
|
||||
const cmd = isWindows ? 'npm.cmd' : 'npm';
|
||||
|
||||
module.exports = function ({ framework, projectPath, simple }) {
|
||||
if (FRAMEWORK_LIST.indexOf(framework) > -1) {
|
||||
const command = ['run', `gen:${framework}`, '--'];
|
||||
if (projectPath) {
|
||||
command.push(`--projectPath=${projectPath}`);
|
||||
}
|
||||
if (simple) {
|
||||
command.push(`--simple`);
|
||||
}
|
||||
|
||||
const { stderr, error } = spawnSync(cmd, command);
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (stderr && stderr.toString()) {
|
||||
throw new Error(`Failed to copy project content.\n${stderr.toString()}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
在新工单中引用
屏蔽一个用户