diff --git a/config/vite.config.dev.ts b/config/vite.config.dev.ts index 6e3a086..75f7f76 100644 --- a/config/vite.config.dev.ts +++ b/config/vite.config.dev.ts @@ -13,8 +13,8 @@ export default mergeConfig( }, proxy: { '/api': { - target: 'http://59.110.238.182:8081', - // target: 'http://192.168.3.158:8081', + target: 'http://106.53.179.133:8081', + // target: 'http://192.168.243.246:8081', // target: 'http://localhost:5173', changeOrigin: true, }, diff --git a/index.html b/index.html index 3eeb81f..a8bba25 100644 --- a/index.html +++ b/index.html @@ -3,10 +3,9 @@ - + - 中山学院学习平台 + 票据管理系统 diff --git a/package.json b/package.json index 67786de..a86716a 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,7 @@ "type:check": "vue-tsc --noEmit --skipLibCheck", "lint-staged": "npx lint-staged", "prepare": "husky install", - "start": "npm run dev" - - }, "lint-staged": { "*.{js,ts,jsx,tsx}": [ @@ -40,6 +37,8 @@ "axios": "^0.24.0", "dayjs": "^1.11.5", "echarts": "^5.4.0", + "exceljs": "^4.4.0", + "file-saver": "^2.0.5", "lodash": "^4.17.21", "mitt": "^3.0.0", "nprogress": "^0.2.0", @@ -50,12 +49,14 @@ "vue": "^3.2.40", "vue-echarts": "^6.2.3", "vue-i18n": "^9.2.2", - "vue-router": "^4.0.14" + "vue-router": "^4.0.14", + "xlsx": "^0.18.5" }, "devDependencies": { "@arco-plugins/vite-vue": "^1.4.5", "@commitlint/cli": "^17.1.2", "@commitlint/config-conventional": "^17.1.0", + "@types/file-saver": "^2.0.7", "@types/lodash": "^4.14.186", "@types/mockjs": "^1.0.7", "@types/nprogress": "^0.2.0", diff --git a/src/api/interceptor.ts b/src/api/interceptor.ts index 360865f..b9f43c9 100644 --- a/src/api/interceptor.ts +++ b/src/api/interceptor.ts @@ -75,10 +75,12 @@ axios.interceptors.response.use( const { response } = error; console.log('error', error); - if (response.status === '401') { + if (response.status === 401) { + router.push({ name: 'login', }); + } else { Message.error({ diff --git a/src/api/role.ts b/src/api/role.ts index 9681312..1587fc2 100644 --- a/src/api/role.ts +++ b/src/api/role.ts @@ -18,8 +18,13 @@ export interface RoleListRecord extends RoleRecord { } // 查询所有的角色列表、 -export function queryRoleList() { - return axios.get('/api/rest/role'); +export function queryRoleList(data: any) { + // return axios.get('/api/rest/role',data); + return axios({ + url: '/api/rest/role', // 路径 + method: 'get', + params: data, // 参数 + }) } // 切换启用状态 diff --git a/src/api/ticket.ts b/src/api/ticket.ts index d22ebec..d470181 100644 --- a/src/api/ticket.ts +++ b/src/api/ticket.ts @@ -7,7 +7,7 @@ export interface TicketCreateRecord { type: string; contactEmail: string; companyName: string; - attachId: string; + attachId: []; auditorId: string; submit: boolean; userId: undefined; @@ -15,6 +15,9 @@ export interface TicketCreateRecord { } export interface TicketRecord extends TicketCreateRecord { +auditor: any; +createTime(createTime: any): unknown; +deptName: any; value: any; id: undefined; status: string @@ -83,3 +86,8 @@ export function home(data: any){ params: data, // 参数 }); } + +// 首页统计图 +export function chart(){ + return axios.get('/api/rest/bill/trend') +} \ No newline at end of file diff --git a/src/api/user.ts b/src/api/user.ts index c2b13be..5e532d5 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -29,6 +29,8 @@ export interface PasswordReSetModel { // 添加用户数据 export interface CreateRecord { +value: any; +code: any; username: string; nickName: string; @@ -107,10 +109,15 @@ export function resetPassword(data: PasswordReSetModel) { } // 注册用户 -export function create(data: CreateRecord) { +export function register(data: CreateRecord) { return axios.post('/api/rest/user/register', data); } +// 新建用户 +export function create(data: CreateRecord) { + return axios.post('/api/rest/user', data); +} + // 模糊查询用户列表 export function queryUserList(params: any) { return axios({ @@ -158,6 +165,11 @@ export function deptAudit(id: string,roleId:string){ }); } +// 获取验证码 +export function code(data: string){ + return axios.get(`/api/rest/user/send-email?email=${data}`); +} + export function switchRole(roleId: number) { return axios.patch(`/api/user/self/switch-role/${roleId}`); } diff --git a/src/components/footer/index.vue b/src/components/footer/index.vue index 9a250cc..9ba905a 100644 --- a/src/components/footer/index.vue +++ b/src/components/footer/index.vue @@ -1,16 +1,16 @@ diff --git a/src/components/navbar/index.vue b/src/components/navbar/index.vue index cc2c7ae..70ca45e 100644 --- a/src/components/navbar/index.vue +++ b/src/components/navbar/index.vue @@ -2,10 +2,7 @@