config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * 配置通用
  3. */
  4. const node_dev = process.env.H_NODE_ENV;
  5. let baseUrl = '/api/serviceapi',
  6. wxAppid = 'wx6490eaa0d20d2be2', //
  7. staticUrl = 'https://minio.wdzzgs.com/greattransition/staticfile',
  8. redirectUri = encodeURIComponent('https://greath5.dev.gztjy.top/greatgroup/pages/login/login'),
  9. authUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wxAppid}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`,
  10. upFileUrl = 'https://serviceapi.wdzzgs.com/thirdapi/upload/single/minio';
  11. if (node_dev) {
  12. if(process.env.H_NODE_ENV=='production'){
  13. redirectUri = encodeURIComponent('https://h5.wdzzgs.com/greatgroup/pages/login/login')
  14. };
  15. (baseUrl = process.env.H_BASE_URL), (upFileUrl = process.env.H_UP_FILE_URL), (authUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wxAppid}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`);
  16. }
  17. const commonConfig = {
  18. wxAppid: wxAppid, // 测试wxAppid
  19. baseUrl: baseUrl, // 服务器地址
  20. uploadFileUrl: upFileUrl, // 上传文件路径
  21. staticUrl:staticUrl,
  22. authUrl:authUrl,
  23. paginationConfig:{
  24. pageNum: 1,
  25. pageSize: 10
  26. },//分页参数
  27. successCode:200,//接口返回状态
  28. }
  29. export {
  30. commonConfig
  31. }