config.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. module.exports = {
  2. current: {server: "192.168.1.184", port: "60666",redis:{server:'192.168.1.184',port:'6379',pwd:'smartCost'}},
  3. defaultLicenseKey:'qa.smartcost.com.cn|uat.smartcost.com.cn|zbqa.smartcost.com.cn|zbuat.smartcost.com.cn|jlqa.smartcost.com.cn|jluat.smartcost.com.cn|zb.smartcost.com.cn|jl.smartcost.com.cn,834986144349993#A0quy7cvNGdyFWbz9SYxJiOiMXbEJCLig1jlzahlDZmpnInmb1uk/avoDrlmvJilrKqmXrunfbtmD0jnLiOiEmTDJCLiMTO9kDNzQDNxYDO9QzM8IiOiQWSiwSflNHbhZmOiI7ckJye0ICbuFkI1pjIEJCLi4TPRdWUxQWcvITWKFUNnlTbRhkQhl6drhkS6lTY9k4b5FUSUp7bahFRTZmZkBDWIVXa5JXO0NURQ3GRHplb0VTYYdUa8NXeTJWQCVDRxFEcZ9mVphnQBJnI0IyUiwSM5UzNwEzNxMTM0IicfJye&Qf35VfiMjY6cmI0IyQiwiIxEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNzETMwEDI5AjNwgTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56cuwmas86Yu46bj9Cdz36Y4JXYtNnLipHLuNmLt36YuQ7cvNGdyFWbz9CdhVHbqxibj9SbvNmL4N7bjRnch56cuEWcspGLuNmLt36YuQ7cvNGdyFWbz9CdhVnY0xibj9SbvNmL4N7bjRnch56cuEWcipHLuNmLt36YuQ7cvNGdyFWbz9CdhVHLuNm0tl2',
  4. local: {server: "localhost", port: "27017"},
  5. qa: {
  6. server: "192.168.1.90",
  7. port: "60666",
  8. options:{
  9. user:'smartcost',
  10. pass:'smartcost3850888',
  11. auth: {
  12. "authSource": "admin"
  13. },
  14. connectTimeoutMS: 100000,
  15. useMongoClient: true
  16. },
  17. importURL:"192.168.1.90:6050"
  18. },
  19. qa_outer: {
  20. server: "smartcost.in.8866.org",
  21. port: "26904",
  22. options:{
  23. user:'smartcost',
  24. pass:'smartcost3850888',
  25. auth: {
  26. "authSource": "admin"
  27. },
  28. connectTimeoutMS: 100000,
  29. useMongoClient: true
  30. },
  31. importURL:"192.168.1.184:6050"
  32. },
  33. test_auth: {
  34. server: "120.78.150.216",
  35. port: "27017",
  36. options:{
  37. user:'smartcost',
  38. pass:'smartcost3850888',
  39. auth: {
  40. "authSource": "scConstruct"
  41. },
  42. connectTimeoutMS: 20000,
  43. useMongoClient: true
  44. }
  45. },
  46. pp:{ server: "172.18.111.231",
  47. port: "27017",
  48. options:{
  49. user:'smartcost',
  50. pass:'SmartCost3850888',
  51. auth: {
  52. "authSource": "admin"
  53. },
  54. connectTimeoutMS: 50000,
  55. useMongoClient: true
  56. },
  57. importURL:"172.18.111.231:6050"
  58. },
  59. uat: {
  60. server: "112.74.42.187",
  61. port: "27017",
  62. options:{
  63. user:'smartcost',
  64. pass:'SmartCost3850888',
  65. auth: {
  66. "authSource": "admin"
  67. },
  68. connectTimeoutMS: 100000,
  69. useMongoClient: true
  70. },
  71. importURL:"192.168.1.184:6050"
  72. },
  73. prod_s:{ server: "112.74.42.187",
  74. port: "28066",
  75. options:{
  76. user:'smartcost',
  77. pass:'SmartCost3850888',
  78. auth: {
  79. "authSource": "admin"
  80. },
  81. connectTimeoutMS: 50000,
  82. useMongoClient: true
  83. }},
  84. prod:{
  85. dbURL:"mongodb://smartcost:SmartCost3850888@dds-wz9da4d5ca0fdd341.mongodb.rds.aliyuncs.com:3717,dds-wz9da4d5ca0fdd342.mongodb.rds.aliyuncs.com:3717/gaisuan?authSource=admin;replicaSet=mgset-7518601",
  86. LicenseKey:"civil.smartcost.com.cn|yun.smartcost.com.cn|cloud.smartcost.com.cn,834986144349993#A0BfNtmD0jnLiOiEmTDJCLiMTO9kDNzQDNxYDO9QzM8IiOiQWSiwSflNHbhZmOiI7ckJye0ICbuFkI1pjIEJCLi4TP7BzU6d7Z9RFbrRzNNNHNFJzStVFU7llaFdkeNdDV59UYkBjWxRjUOBlW7siYu5UeVp4ZyFUd4hDZ996S5JDNJV4cXF6dvJlNTFVNuZmdPdFSj3iV8tkI0IyUiwyN7AzNxYzN7MTM0IicfJye#4Xfd5nIzImNnJiOiMkIsISMx8idgMlSgQWYlJHcTJiOi8kI1tlOiQmcQJCLiADN5QTMwACMzcDM8EDMyIiOiQncDJCLi86Yu46bj9Cdz36Y4JXYtNnLkV7bsNGLuNmLt36YuQ7cvNGdyFWbz9ib5lHLuNmLt36YuQ7cvNGdyFWbz9CbpZXajJiOiMXbEJCLig1jlzahlDZmpnInmb1uk/avoDrlmvJilrKqRXMu",
  87. importURL:"172.18.111.228:7050",
  88. startPort:7060,
  89. importPort: 7050,
  90. socketPort:6600
  91. },
  92. redis_local:{server:'127.0.0.1',port:'6379',pwd:'smartCost'},
  93. redis_qa:{server:'192.168.1.184',port:'6379',pwd:'smartCost'},
  94. setupDb:function (env="local") {
  95. let me = this;
  96. me.current.server = me[env].server;
  97. me.current.port = me[env].port;
  98. me.current.redis=me["redis_"+env];
  99. },
  100. getSessionURL:function (env="local") {
  101. let me = this;
  102. if(me[env].dbURL){
  103. return me[env].dbURL.replace('gaisuan','gaisuanManagers');
  104. }
  105. if(me[env].options){
  106. return 'mongodb://'+ me[env].options.user +':'+ me[env].options.pass+'@'+ me[env].server+ ':'+ me[env].port + '/usersManages?authSource=admin';
  107. }else {
  108. return 'mongodb://' + me[env].server + ':' + me[env].port + '/usersManages';
  109. }
  110. },
  111. getLicenseKey:function (env = "local") {
  112. let me = this;
  113. if (me[env].LicenseKey){
  114. return me[env].LicenseKey;
  115. }else {
  116. return me.defaultLicenseKey;
  117. }
  118. },
  119. getImportURL:function (env="local",origin) {
  120. let me = this;
  121. let importURL = me[env].importURL;
  122. if(origin.indexOf("localhost")!=-1 || origin.indexOf("127.0.0.1")!=-1){
  123. importURL = "127.0.0.1:6050";
  124. }
  125. return importURL
  126. }
  127. }