index.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import request from '../request';
  2. import handle from '../handle';
  3. import { REQUEST_CONFIG } from '../../config';
  4. /**
  5. * 跳转授权链接
  6. * @param {String} appid appid
  7. * @param {Url} redirect_uri 授权后重定向的回调链接地址, 请使用 urlEncode 对链接进行处理
  8. * @param {String} response_type 返回类型,请填写code
  9. * @param {String} scope snsapi_base (不弹出授权页面,直接跳转,只能获取用户openid),snsapi_userinfo (弹出授权页面,可通过openid拿到昵称、性别、所在地。并且, 即使在未关注的情况下,只要用户授权,也能获取其信息 )
  10. */
  11. export const WebOauth2Authorize = (queryData: any) => {
  12. return `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${queryData.appid}&redirect_uri=${queryData.redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`;
  13. };
  14. /** 获取系统状态 */
  15. export const GetAppStatus = async (queryData: any) => {
  16. const resp = handle.promistHandle(
  17. await request.doPost(
  18. `${REQUEST_CONFIG.BASE_URL}kstserver/status?appId=${queryData.appId}`,
  19. {},
  20. {
  21. construction: true,
  22. }
  23. )
  24. );
  25. return handle.catchPromise(resp, () => resp);
  26. };
  27. /** 页面参数查询列表 */
  28. export const SysAppPageList = async (queryData: any) => {
  29. const resp = handle.promistHandle(
  30. await request.doPost(
  31. `${REQUEST_CONFIG.BASE_URL}wsgw/sysAppPage/api/List/callApiJSON.do`,
  32. queryData,
  33. {
  34. showLoading: false,
  35. }
  36. )
  37. );
  38. return handle.catchPromise(resp, () => resp);
  39. };
  40. /** 查询就诊人信息 */
  41. export const QueryBaseMemberList_V3 = async (queryData: any) => {
  42. const resp = handle.promistHandleNew(
  43. await request.doPost(
  44. `${REQUEST_CONFIG.BASE_URL}wsgw/accountMember/api/QueryBaseMemberList_V3/callApiJSON.do`,
  45. queryData
  46. )
  47. );
  48. return handle.catchPromiseNew(resp, () => resp);
  49. };
  50. /** 获取表单配置信息 */
  51. export const BaseFormQuery = async (queryData: any) => {
  52. let resp = handle.promistHandle(
  53. await request.doPost(
  54. `${REQUEST_CONFIG.BASE_URL}wsgw/base/form/Query/callApiJSON.do`,
  55. queryData,
  56. {
  57. showLoading: false,
  58. }
  59. )
  60. );
  61. return handle.catchPromise(resp, () => resp);
  62. };
  63. /** 查询功能菜单列表 */
  64. export const SysclientappmenuList = async (queryData: any) => {
  65. let resp = handle.promistHandle(
  66. await request.doPost(
  67. `${REQUEST_CONFIG.BASE_URL}wsgw/sysclientappmenu/api/List/callApiJSON.do`,
  68. queryData,
  69. {
  70. showLoading: false,
  71. }
  72. )
  73. );
  74. return handle.catchPromise(resp, () => resp);
  75. };