123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- import { http } from '@/utils/http'
- const userGroupUrl = '/org/findAllOrgByPOrgNo'
- //注册方法
- const userRegisterUrl = '/system/registerUser'
- //登录方法
- const userLoginUrl = '/system/login'
- const loginTestUrl = '/system/getVersion'
- const homeUrl = ''
- const updatePasUrl = '/system/updatePassword'
- const getPositionUrl = '/param/findAllByType'
- const subLeaveUrl = '/leave/saveRecord'
- //请假列表
- const leaveRecordUrl = '/leave/findAllByCurrentUser'
- const updateLeaveUrl = '/leave/updateRecord'
- //首页API
- export const homeApi = (val: any) => {
- return http<any>(
- {
- method: 'post',
- url: homeUrl,
- data: { val }
- })
- }
- //getAPI
- export const userGroupApi = () => {
- return http<any>(
- {
- method: 'get',
- url: userGroupUrl
- })
- }
- //注册API
- export const userRegisterApi = (val: any) => {
- return http<any>(
- {
- method: 'post',
- url: userRegisterUrl,
- data: { ...val }
- })
- }
- //登录API
- export const userLoginApi = (val: any) => {
- return http<any>(
- {
- method: 'get',
- url: `${userLoginUrl}?userNo=${val.userNo}&password=${val.password}`,
- })
- }
- //修改密码
- export const updatePasApi = (val: any) => {
- return http<any>(
- {
- method: 'get',
- url: `${updatePasUrl}?oldPassword=${val.oldPassword}&password=${val.password}&userNo=${val.id}`,
- })
- }
- export const getPositionApi = () => {
- return http<any>(
- {
- method: 'get',
- url: `${getPositionUrl}?type=1`,
- })
- }
- //提交请假表单
- export const subLeaveApi = (val: any) => {
- return http<any>({
- method: 'post',
- url: subLeaveUrl,
- data: { ...val }
- })
- }
- //修改请假表单
- export const updateLeaveApi = (val: any) => {
- return http<any>({
- method: 'post',
- url: updateLeaveUrl,
- data: { ...val }
- })
- }
- //提交请假列表
- export const leaveRecordApi = (val: any) => {
- return http<any>({
- method: 'get',
- url: `${leaveRecordUrl}?pageNum=${val.pageNum}&pageSize=${val.pageSize}`,
- })
- }
- export const loginTestApi = () => {
- return http<any>({
- method: 'get',
- url: `${loginTestUrl}`,
- })
- }
|