public.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. import request from '@/utils/request'
  2. // 登录方法
  3. export function login(data) {
  4. return request({
  5. url: '/auth/loginApp ',
  6. headers: {
  7. isToken: false
  8. },
  9. method: 'post',
  10. data
  11. })
  12. }
  13. // 登录方法
  14. export function tokenLogin(token) {
  15. return request({
  16. url: `/auth/tokenlogin?token=${token}&loginType=0`,
  17. headers: {
  18. isToken: false
  19. },
  20. method: 'get'
  21. })
  22. }
  23. // 注册方法
  24. export function register(data) {
  25. return request({
  26. url: '/auth/register',
  27. headers: {
  28. isToken: false
  29. },
  30. method: 'post',
  31. data: data
  32. })
  33. }
  34. // 获取菜单
  35. export function getMenu() {
  36. return request({
  37. url: '/system/menu/getRouters',
  38. method: 'get'
  39. })
  40. }
  41. // 获取天气预警
  42. export function getTheAreaWeather(orgId) {
  43. return request({
  44. url: `/core/weatherWarning/getTheAreaWeather/${orgId}`,
  45. method: 'get'
  46. })
  47. }
  48. // 刷新方法
  49. export function refreshToken() {
  50. return request({
  51. url: '/auth/refresh',
  52. method: 'post'
  53. })
  54. }
  55. // 获取用户详细信息
  56. export function userInfo() {
  57. return request({
  58. url: '/system/user/getInfo',
  59. method: 'get'
  60. })
  61. }
  62. // 获取用户详细信息
  63. export function getDot() {
  64. return request({
  65. url: '/core/center/haveRead',
  66. method: 'get'
  67. })
  68. }
  69. // 退出方法
  70. export function logout() {
  71. return request({
  72. url: '/auth/logoutApp',
  73. method: 'delete'
  74. })
  75. }
  76. // 获取验证码
  77. export function getCodeImg() {
  78. return request({
  79. url: '/code',
  80. headers: {
  81. isToken: false
  82. },
  83. method: 'get',
  84. timeout: 20000
  85. })
  86. }
  87. // 查询部门下拉树结构
  88. export function deptTreeList(id) {
  89. return request({
  90. url: '/system/dept/deptTree',
  91. method: 'get',
  92. params: {
  93. id
  94. }
  95. })
  96. }
  97. //根据字典类型查询字典值接口
  98. export function getDict(dictType) {
  99. return request({
  100. url: '/system/dict/data/type/' + dictType,
  101. method: 'get'
  102. })
  103. }
  104. //通过组织机构ID获取人员
  105. export function getOrgPeople(orgId) {
  106. return request({
  107. url: `/system/user/getByOrgId/${orgId}`,
  108. method: 'get'
  109. })
  110. }
  111. //上传文件
  112. export function upload(data, type) {
  113. return request({
  114. url: '/file/file/upload',
  115. method: 'post',
  116. headers: {
  117. 'Content-Type': 'multipart/form-data'
  118. },
  119. data,
  120. params: {
  121. busType: type
  122. }
  123. })
  124. }
  125. //上传base64文件
  126. export function uploadBase64(data) {
  127. return request({
  128. url: '/file/file/uploadBase64',
  129. method: 'post',
  130. data
  131. })
  132. }
  133. //修改前的 机构树 组织机构用户使用的树
  134. export function userAndOrgTree(removeId) {
  135. return request({
  136. url: '/system/dept/deptTree',
  137. method: 'get',
  138. params: removeId
  139. })
  140. }
  141. //驾驶舱行社树
  142. export function hangsheAndOrgTree(removeId) {
  143. return request({
  144. url: '/system/dept/deptTree/hangshe',
  145. method: 'get',
  146. params: removeId
  147. })
  148. }
  149. //常规业务使用的树
  150. export function deptTreeSelect(data) {
  151. if (!data) {
  152. data = {
  153. excludeOrgCode: '900000000',
  154. excludeOrgName: '各部门'
  155. }
  156. }
  157. return request({
  158. url: '/system/dept/deptTree/business',
  159. method: 'post',
  160. data
  161. })
  162. }
  163. //行社机构树
  164. export function handsheDeptTreeSelect() {
  165. return request({
  166. url: '/system/dept/deptTree/hangshe',
  167. method: 'get'
  168. })
  169. }
  170. export function wholeTreeSelect(para) {
  171. if(!para) {
  172. para={
  173. orgId:"",
  174. includeSub:true,
  175. excludeOrgName:"各部门"
  176. }
  177. }
  178. return request({
  179. url: '/system/dept/deptTree/whole',
  180. method: 'post',
  181. data: para,
  182. })
  183. }