Skip to content

Commit f7fa595

Browse files
committed
删除多余的代码
1 parent b776d13 commit f7fa595

File tree

6 files changed

+30
-67
lines changed

6 files changed

+30
-67
lines changed

src/components/demo/Demo.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<div>
3+
<h1>Demo案例</h1>
4+
</div>
5+
</template>
6+
7+
<script lang="ts">
8+
import { Vue, Component } from 'vue-property-decorator';
9+
10+
@Component({})
11+
export default class Demo extends Vue {
12+
13+
}
14+
</script>
15+
16+
<style scoped>
17+
</style>

src/components/demo/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Demo from './Demo.vue';
2+
export default Demo;

src/components/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import AppBreadcrumb from './app-breadcrumb';
22
import AppHeader from './app-header';
33
import AppSidebar from './app-sidebar';
44
import Framement from './framement';
5+
import Demo from './demo';
56

67
const components: { [propsName: string]: any } = {
78
AppBreadcrumb,
89
AppHeader,
910
AppSidebar,
1011
Framement,
12+
Demo,
1113
};
1214

1315
const install = (Vue: any): void => {

src/utils/axios-config.ts

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @Company:
77
* @Date: 2019-08-16 16:57:42
88
* @LastEditors: 水痕
9-
* @LastEditTime: 2019-08-21 10:21:16
9+
* @LastEditTime: 2019-08-21 10:37:01
1010
*/
1111

1212
import axios from 'axios';
@@ -35,9 +35,9 @@ export const axiosConfig = (): void => {
3535
/********************************封装请求的 start********************************/
3636
function request(config: { [propsName: string]: any }) {
3737
// 配置请求头
38-
config.headers['X-Origin'] = 'admin-web';
39-
config.headers[authToken] = storage.getItem(authToken);
40-
config.headers[authMobile] = storage.getItem(authMobile);
38+
// config.headers['X-Origin'] = 'admin-web';
39+
// config.headers[authToken] = storage.getItem(authToken);
40+
// config.headers[authMobile] = storage.getItem(authMobile);
4141

4242
// 处理请求地址
4343
const input = config.url;
@@ -71,62 +71,3 @@ export const axiosConfig = (): void => {
7171
// 拦截响应
7272
axios.interceptors.response.use(response, responseError);
7373
};
74-
75-
// class AxiosRequest {
76-
// private baseUrl: string;
77-
// private timeout: number;
78-
// constructor(baseUrl: string = prefix, timeout: number = 60 * 1000) {
79-
// this.baseUrl = baseUrl;
80-
// this.timeout = timeout;
81-
// }
82-
83-
// public request(config: { [propsName: string]: any }) {
84-
// const instance = axios.create({
85-
// baseURL: this.baseUrl,
86-
// timeout: this.timeout,
87-
// });
88-
// /********************************设置请求拦截 start********************************/
89-
// instance.interceptors.request.use(this.requestSuccess, this.requestError);
90-
// /********************************设置请求拦截 end********************************/
91-
// /********************************设置响应拦截 start********************************/
92-
// instance.interceptors.response.use(
93-
// this.responseSuccess,
94-
// this.responseError,
95-
// );
96-
// /********************************设置响应拦截 end********************************/
97-
// return instance(config);
98-
// }
99-
100-
// private requestSuccess(config: { [propsName: string]: any }) {
101-
// config.headers['X-Origin'] = 'admin-web';
102-
// config.headers[authToken] = storage.getItem(authToken);
103-
// config.headers[authMobile] = storage.getItem(authMobile);
104-
// return config;
105-
// }
106-
107-
// private requestError(rejection: { data: any }) {
108-
// return this.useOrigin(rejection)
109-
// ? Promise.reject(rejection)
110-
// : Promise.reject(rejection.data);
111-
// }
112-
113-
// private responseSuccess(res: any): any {
114-
// return this.isPlainRequest(res.config.url) || this.useOrigin(res)
115-
// ? res
116-
// : res.data;
117-
// }
118-
119-
// private responseError(error: any) {
120-
// return Promise.reject(error);
121-
// }
122-
123-
// private useOrigin(res: any) {
124-
// return res.config.useOrigin;
125-
// }
126-
127-
// private isPlainRequest(input: string) {
128-
// return /\.(html?|xml|txt)$/.test(input);
129-
// }
130-
// }
131-
132-
// export const axiosConfig = new AxiosRequest();

src/views/demo1/demo11/demo11.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div class="demo11">
33
<h1>我是demo11页面</h1>
4+
<Demo></Demo>
45
</div>
56
</template>
67

src/views/shared/login/Login.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ export default class Login extends Vue {
5757
private submitForm(formType: string): void {
5858
(this.$refs[formType] as any).validate((valid: boolean) => {
5959
if (valid) {
60-
console.log('--------')
61-
axios.post('/api/v1/user/login', { userName: this.loginForm.email, password: this.loginForm.password }).then((data: any) => {
62-
console.log(data);
63-
});
60+
axios.post('/api/v1/user/login', { userName: this.loginForm.email, password: this.loginForm.password })
61+
.then((data: any) => {
62+
console.log(data);
63+
});
6464
// 设置本地存储
6565
storage.setItem(OperatedProduct, this.loginForm.email);
6666
if (this.$route.query.backUrl) {

0 commit comments

Comments
 (0)