Skip to content

Commit

Permalink
feat: 代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingkang committed Sep 13, 2020
1 parent 1e457e4 commit baa632b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 50 deletions.
4 changes: 4 additions & 0 deletions src/common/constant/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// cookie key config
export const COOKIE_DEFAULT_CONFIG = {
TOKEN: 'ADMIN-TOKEN'
};
5 changes: 3 additions & 2 deletions src/services/login.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import request from '@/utils/request';
import { request } from 'umi';
import { LoginParamsType } from '@/common/types/login';

export async function fetchLogin(data: LoginParamsType) {
return request.post('/api/login/account', {
return request('/api/login/account', {
method: 'POST',
data
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/date.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import moment, { Moment } from 'moment';
import moment from 'moment';

/**
* 格式化时间
* @param date
* @param format
*/
export function formatDate(
date: Moment | Date | string | number,
date: moment.Moment | Date | string | number,
format = 'YYYY-MM-DD HH:mm:ss'
): string {
if (!date) return '';
Expand Down
46 changes: 0 additions & 46 deletions src/utils/request.ts

This file was deleted.

0 comments on commit baa632b

Please sign in to comment.