diff --git a/.eslintrc.json b/.eslintrc.json index 4b8f3f5..7fc22a3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,20 +1,20 @@ { - "env": { - "browser": true, - "es2021": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:vue/vue3-essential" - ], - "parserOptions": { - "ecmaVersion": "latest", - "parser": "@typescript-eslint/parser" - }, - "plugins": [ - "@typescript-eslint", - "vue" - ], - "rules": {} + "env": { + "browser": true, + "es2021": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:vue/vue3-essential" + ], + "parserOptions": { + "ecmaVersion": "latest", + "parser": "@typescript-eslint/parser" + }, + "plugins": [ + "@typescript-eslint", + "vue" + ], + "rules": {} } diff --git a/src/api/Requester.ts b/src/api/Requester.ts index 44de72c..09bc338 100644 --- a/src/api/Requester.ts +++ b/src/api/Requester.ts @@ -3,16 +3,19 @@ import {md5Hex} from "./CryptoUtils"; import {User} from "../entities/User.ts"; export const baseUrl = 'http://localhost:8081'; + export interface Result { data: T; message: string; status: number; timestamp: number } + export interface Page { data: T[]; total: number; } + export type PageResult = Result> const instance = axios.create({ baseURL: baseUrl, @@ -30,7 +33,7 @@ axios.interceptors.request.use(function (config) { // 添加响应拦截器 axios.interceptors.response.use(function (response) { const authorization = response.headers['Set-Authorization']; - if (authorization){ + if (authorization) { window.sessionStorage.setItem("authorization", authorization); } return response; diff --git a/src/assets/vue.svg b/src/assets/vue.svg deleted file mode 100644 index 770e9d3..0000000 --- a/src/assets/vue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/entities/Auth.ts b/src/entities/Auth.ts index f222322..aead60d 100644 --- a/src/entities/Auth.ts +++ b/src/entities/Auth.ts @@ -1,3 +1,3 @@ export enum Auth { - user,admin + user, admin } \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 3c7f557..d7866df 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,10 @@ -import { createApp } from 'vue' +import {createApp} from 'vue' import './style.css' import App from './App.vue' import Mobile from './views/AppMobile.vue' import PC from './views/AppPC.vue' import {createRouter, createWebHashHistory} from "vue-router"; + const router = createRouter({ history: createWebHashHistory(), routes: [ diff --git a/src/views/AppMobile.vue b/src/views/AppMobile.vue index 4fc2e0a..5abfde4 100644 --- a/src/views/AppMobile.vue +++ b/src/views/AppMobile.vue @@ -1,27 +1,38 @@