Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 53 additions & 53 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
module.exports = {
//root: true 用于指定它是最顶层的配置,即它在任何情况下都会被采用,而不会被继承覆盖
root: true,
//env 指定代码运行的环境
env : {
browser: true,
node : true,
es2021 : true,
es6 : true
},
//extends 指定继承的配置
extends : ["plugin:vue/essential"],
//plugins 指定使用的插件
plugins : ["@typescript-eslint"],
// parserOptions 指定解析器选项
parserOptions: { parser: "babel-eslint" },
plugins : ["vue"],
// rules 指定自定义的规则
rules : {
eqeqeq : "off",
curly : "error",
quotes : ["error", "double"],
"arrow-parens" : 0,
"generator-star-spacing" : 0,
"no-unused-vars" : "warn",
"no-debugger" : process.env.NODE_ENV === "production" ? "error" : "off",
indent : [2, 4, { SwitchCase: 1 }],
"space-before-function-paren": ["error", "never"],
"no-constant-condition" : ["warn"],
"no-empty" : ["off"],
"comma-spacing" : ["error", { after: true }],
"key-spacing" : [
"error",
{
singleLine: {},
multiLine : { align: "colon" }
}
],
"object-curly-newline" : ["error", { multiline: true }],
"array-bracket-newline": ["error", { multiline: true }],
curly : ["error", "all"],
quotes : ["error", "double"],
indent : ["error", "tab"],
"brace-style" : ["error", "stroustrup", { allowSingleLine: false }],
"space-infix-ops" : ["error"],
"comma-dangle" : ["warn", "never"]
},
//overrides 指定某些文件的指定规则 */
overrides: [
{
files: ["*.vue"],
rules: { "vue/multi-word-component-names": 0 }
}
]
//root: true 用于指定它是最顶层的配置,即它在任何情况下都会被采用,而不会被继承覆盖
root: true,
//env 指定代码运行的环境
env: {
browser: true,
node: true,
es2021: true,
es6: true,
},
//extends 指定继承的配置
extends: ["plugin:vue/essential"],
//plugins 指定使用的插件
plugins: ["@typescript-eslint"],
// parserOptions 指定解析器选项
parserOptions: { parser: "babel-eslint" },
plugins: ["vue"],
// rules 指定自定义的规则
rules: {
eqeqeq: "off",
curly: "error",
quotes: ["error", "double"],
"arrow-parens": 0,
"generator-star-spacing": 0,
"no-unused-vars": "warn",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
indent: [2, 4, { SwitchCase: 1 }],
"space-before-function-paren": ["error", "never"],
"no-constant-condition": ["warn"],
"no-empty": ["off"],
"comma-spacing": ["error", { after: true }],
"key-spacing": [
"error",
{
singleLine: {},
multiLine: { align: "colon" },
},
],
"object-curly-newline": ["error", { multiline: true }],
"array-bracket-newline": ["error", { multiline: true }],
curly: ["error", "all"],
quotes: ["error", "double"],
indent: ["error", "tab"],
"brace-style": ["error", "stroustrup", { allowSingleLine: false }],
"space-infix-ops": ["error"],
"comma-dangle": ["warn", "never"],
},
//overrides 指定某些文件的指定规则 */
overrides: [
{
files: ["*.vue"],
rules: { "vue/multi-word-component-names": 0 },
},
],
};

/*
Expand Down
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
8 changes: 4 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const prodPlugins =
process.env.NODE_ENV === "production" ? ["transform-remove-console"] : []; // 判断当前环境是否为生产环境,如果是,则将transform-remove-console加入prodPlugins数组中
process.env.NODE_ENV === "production" ? ["transform-remove-console"] : []; // 判断当前环境是否为生产环境,如果是,则将transform-remove-console加入prodPlugins数组中
module.exports = {
// 导出配置,使用@vue/cli-plugin-babel/preset作为预设,并将prodPlugins数组中的插件作为插件
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [...prodPlugins]
// 导出配置,使用@vue/cli-plugin-babel/preset作为预设,并将prodPlugins数组中的插件作为插件
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [...prodPlugins],
};
4 changes: 4 additions & 0 deletions doc/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
## 相关问题

请在此处链接相关的 issue。(可选)

## 截图

如果适用,请添加截图以帮助解释您的更改。(可选)

## 检查清单

- [x] 我已阅读贡献指南。
- [x] 我已遵循此项目的编码风格规范。
- [x] 我的代码符合必要的文档要求。
- [x] 我已添加了证明我的更改正常工作的测试。
- [x] 我已更新必要的文档内容。

## 其他信息

在此处添加任何其他上下文或信息,以提供有关这个拉取请求的更多详细信息。
16 changes: 10 additions & 6 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<!DOCTYPE html>
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
properly without JavaScript enabled. Please enable it to
continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
Expand Down
24 changes: 12 additions & 12 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class="root">
<Header></Header>
<!-- 路由出口 -->
<router-view></router-view>
<Footer></Footer>
</div>
<div class="root">
<Header></Header>
<!-- 路由出口 -->
<router-view></router-view>
<Footer></Footer>
</div>
</template>

<script>
Expand All @@ -13,12 +13,12 @@ import Header from "./components/Header/Header";
import Footer from "./components/Footer/Footer";

export default {
name : "App",
//注册组件
components: {
Header,
Footer
}
name: "App",
//注册组件
components: {
Header,
Footer,
},
};
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import request from "./request";
import mockRequest from "./mockRequest";

export const getData = () => request.get("/getData", { params: { id: 1 } });
export const postData = () => request.post("/postData", { params: { id: 1 } });
export const postData = () => request.post("/postData", { params: { id: 1 } });
32 changes: 16 additions & 16 deletions src/api/localRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ import "/node_modules/nprogress/nprogress.css";
// });
//使用create方法创建axios实例
export const requests = axios.create({
timeout: 7000, // 请求超时时间
baseURL: "/ipa",
headers: { "Content-Type": "application/json;charset=UTF-8" }
timeout: 7000, // 请求超时时间
baseURL: "/ipa",
headers: { "Content-Type": "application/json;charset=UTF-8" },
});

//请求拦截器
requests.interceptors.request.use((config) => {
//进度条开始
nprogress.start();
return config;
//进度条开始
nprogress.start();
return config;
});

//响应拦截器
requests.interceptors.response.use(
(res) => {
//成功的回调函数
//进度条结束
nprogress.done();
return res.data;
},
(Error) => {
//失败的回调函数
return Promise.reject(new Error("faile"));
}
(res) => {
//成功的回调函数
//进度条结束
nprogress.done();
return res.data;
},
(Error) => {
//失败的回调函数
return Promise.reject(new Error("faile"));
},
);

export default requests;
32 changes: 16 additions & 16 deletions src/api/mockRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ import "/node_modules/nprogress/nprogress.css";
// });
//使用create方法创建axios实例
export const requests = axios.create({
timeout: 7000, // 请求超时时间
baseURL: "/mock",
headers: { "Content-Type": "application/json;charset=UTF-8" }
timeout: 7000, // 请求超时时间
baseURL: "/mock",
headers: { "Content-Type": "application/json;charset=UTF-8" },
});

//请求拦截器
requests.interceptors.request.use((config) => {
//进度条开始
nprogress.start();
return config;
//进度条开始
nprogress.start();
return config;
});

//响应拦截器
requests.interceptors.response.use(
(res) => {
//成功的回调函数
//进度条结束
nprogress.done();
return res.data;
},
(Error) => {
//失败的回调函数
return Promise.reject(new Error("faile"));
}
(res) => {
//成功的回调函数
//进度条结束
nprogress.done();
return res.data;
},
(Error) => {
//失败的回调函数
return Promise.reject(new Error("faile"));
},
);

export default requests;
Loading
Loading