diff --git a/.templates/$$var_template/$$var_filename.js b/.templates/$$var_template/$$var_filename.js new file mode 100644 index 0000000..1518755 --- /dev/null +++ b/.templates/$$var_template/$$var_filename.js @@ -0,0 +1,2 @@ +export default function $$var_textInFile() { +} diff --git a/.templates/.editorconfig b/.templates/.editorconfig new file mode 100644 index 0000000..689fb50 --- /dev/null +++ b/.templates/.editorconfig @@ -0,0 +1,21 @@ +# @see https://editorconfig-specification.readthedocs.io/en/latest/ + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +charset = utf-8 + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab diff --git a/.templates/template-sample-react-component/index.jsx b/.templates/template-sample-react-component/index.jsx new file mode 100644 index 0000000..d52bbc7 --- /dev/null +++ b/.templates/template-sample-react-component/index.jsx @@ -0,0 +1,12 @@ +import React from "react"; +import classNames from "classnames/bind"; + +import styles from "./index.scss"; + +const cx = classNames.bind(styles); + +function __templateNameToPascalCase__() { + return
请选择岗位
diff --git a/template.config.js b/template.config.js new file mode 100644 index 0000000..6040229 --- /dev/null +++ b/template.config.js @@ -0,0 +1,34 @@ +/** + * This file is a configuration file generated by the `Template` extension on `vscode` + * @see https://marketplace.visualstudio.com/items?itemName=yongwoo.template + */ +module.exports = { + // You can change the template path to another path + templateRootPath: "./.templates", + // After copying the template file the `replaceFileTextFn` function is executed + replaceFileTextFn: (fileText, templateName, utils) => { + // @see https://www.npmjs.com/package/change-case + const { changeCase } = utils; + // You can change the text in the file + return fileText + .replace(/__templateName__/g, templateName) + .replace( + /__templateNameToPascalCase__/g, + changeCase.pascalCase(templateName) + ) + .replace( + /__templateNameToParamCase__/g, + changeCase.paramCase(templateName) + ); + }, + renameFileFn: (fileName, templateName, utils) => { + const { path } = utils; + const { base } = path.parse(fileName); + return base.replace(/__templateName__/gm, templateName); + }, + renameSubDirectoriesFn: (directoryName, templateName, _utils) => { + const { changeCase } = _utils; + const newDirectoryName = changeCase.paramCase(templateName); + return directoryName.replace(/__templateName__/g, newDirectoryName); + } +}; diff --git a/vite.config.js b/vite.config.js index 93ef7a3..988bfef 100644 --- a/vite.config.js +++ b/vite.config.js @@ -23,8 +23,21 @@ export default defineConfig({ ] }) ], + + //代理设置 server: { - host: '0.0.0.0' + port: 5173, + host: '0.0.0.0', + base: './', + cors: true, // 默认启用并允许任何源 + open: true, // 在服务器启动时自动在浏览器中打开应用程序 + proxy: { + '/api': { + target: 'http://117.88.94.226:5380', + changeOrigin: true, + rewrite: (path) => path.replace(/^\/api/, 'api') + } + } }, resolve: {