From 4fe89b0398cd428950ca36bfe5d25f813217eec4 Mon Sep 17 00:00:00 2001
From: lijiaqi <1205620597@qq.com>
Date: Sat, 1 Jun 2024 09:49:09 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E5=9C=B0?=
=?UTF-8?q?=E5=9D=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env_1.development | 4 ++
.env_1.production | 3 +
.env_1.test | 4 ++
.eslintrc_1.cjs | 65 +++++++++++++++++++
.prettierrc_1.json | 9 +++
.stylelintrc_1.cjs | 53 ++++++++++++++++
README_1.md | 18 ++++++
_1.eslintignore | 2 +
_1.gitignore | 24 +++++++
_1.stylelintignore | 4 ++
index_1.html | 15 +++++
mock/user_1.ts | 69 +++++++++++++++++++++
src/api/user/crouse.js | 6 +-
src/views/course/basicCourseInformation.vue | 1 -
14 files changed, 273 insertions(+), 4 deletions(-)
create mode 100644 .env_1.development
create mode 100644 .env_1.production
create mode 100644 .env_1.test
create mode 100644 .eslintrc_1.cjs
create mode 100644 .prettierrc_1.json
create mode 100644 .stylelintrc_1.cjs
create mode 100644 README_1.md
create mode 100644 _1.eslintignore
create mode 100644 _1.gitignore
create mode 100644 _1.stylelintignore
create mode 100644 index_1.html
create mode 100644 mock/user_1.ts
diff --git a/.env_1.development b/.env_1.development
new file mode 100644
index 0000000..57ed20d
--- /dev/null
+++ b/.env_1.development
@@ -0,0 +1,4 @@
+# 变量必须以 VITE_ 为前缀才能暴露给外部读取
+NODE_ENV = 'development'
+VITE_APP_TITLE = '无糖运营平台'
+VITE_APP_BASE_API = '/api'
\ No newline at end of file
diff --git a/.env_1.production b/.env_1.production
new file mode 100644
index 0000000..141fffa
--- /dev/null
+++ b/.env_1.production
@@ -0,0 +1,3 @@
+NODE_ENV = 'production'
+VITE_APP_TITLE = '无糖运营平台'
+VITE_APP_BASE_API = '/prod-api'
\ No newline at end of file
diff --git a/.env_1.test b/.env_1.test
new file mode 100644
index 0000000..536fa85
--- /dev/null
+++ b/.env_1.test
@@ -0,0 +1,4 @@
+ # 变量必须以 VITE_ 为前缀才能暴露给外部读取
+NODE_ENV = 'test'
+VITE_APP_TITLE = '无糖运营平台'
+VITE_APP_BASE_API = '/test-api'
\ No newline at end of file
diff --git a/.eslintrc_1.cjs b/.eslintrc_1.cjs
new file mode 100644
index 0000000..1f95324
--- /dev/null
+++ b/.eslintrc_1.cjs
@@ -0,0 +1,65 @@
+// @see https://eslint.bootcss.com/docs/rules/
+
+module.exports = {
+ env: {
+ browser: true,
+ es2021: true,
+ node: true,
+ jest: true,
+ },
+ globals: {
+ VANTA: 'readonly', //VANTA 已经cdn引入 这里拒绝eslint报错 全局声明一下
+ ElMessage: 'readonly',
+ ElMessageBox: 'readonly',
+ ElLoading: 'readonly',
+ },
+ /* 指定如何解析语法 */
+ parser: 'vue-eslint-parser',
+ /** 优先级低于 parse 的语法解析配置 */
+ parserOptions: {
+ ecmaVersion: 'latest',
+ sourceType: 'module',
+ parser: '@typescript-eslint/parser',
+ jsxPragma: 'React',
+ ecmaFeatures: {
+ jsx: true,
+ },
+ },
+ /* 继承已有的规则 */
+ extends: [
+ 'eslint:recommended',
+ 'plugin:vue/vue3-essential',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:prettier/recommended',
+ ],
+ plugins: ['vue', '@typescript-eslint'],
+ /*
+ * "off" 或 0 ==> 关闭规则
+ * "warn" 或 1 ==> 打开的规则作为警告(不影响代码执行)
+ * "error" 或 2 ==> 规则作为一个错误(代码不能执行,界面报错)
+ */
+ rules: {
+ // eslint(https://eslint.bootcss.com/docs/rules/)
+ 'no-var': 'error', // 要求使用 let 或 const 而不是 var
+ 'no-multiple-empty-lines': ['warn', { max: 1 }], // 不允许多个空行
+ 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
+ 'no-unexpected-multiline': 'error', // 禁止空余的多行
+ 'no-useless-escape': 'off', // 禁止不必要的转义字符
+
+ // typeScript (https://typescript-eslint.io/rules)
+ '@typescript-eslint/no-unused-vars': 'error', // 禁止定义未使用的变量
+ '@typescript-eslint/prefer-ts-expect-error': 'off', // 禁止使用 @ts-ignore
+ '@typescript-eslint/ban-ts-ignore': 'off',
+ '@typescript-eslint/no-explicit-any': 'off', // 禁止使用 any 类型
+ '@typescript-eslint/no-non-null-assertion': 'off',
+ '@typescript-eslint/no-namespace': 'off', // 禁止使用自定义 TypeScript 模块和命名空间。
+ '@typescript-eslint/semi': 'off',
+
+ // eslint-plugin-vue (https://eslint.vuejs.org/rules/)
+ 'vue/multi-word-component-names': 'off', // 要求组件名称始终为 “-” 链接的单词
+ 'vue/script-setup-uses-vars': 'error', // 防止
+
+
+