config.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. "authdb": "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. "authdb": "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. "authdb": "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. "authdb": "admin"
  53. },
  54. connectTimeoutMS: 50000,
  55. useMongoClient: true
  56. },
  57. importURL:"172.18.111.231:6050"
  58. },
  59. pp_outer:{ server: "112.74.42.187",
  60. port: "27017",
  61. options:{
  62. user:'smartcost',
  63. pass:'SmartCost3850888',
  64. auth: {
  65. "authdb": "admin"
  66. },
  67. connectTimeoutMS: 50000,
  68. useMongoClient: true
  69. },
  70. importURL:"112.74.42.187:6050"
  71. },
  72. uat: {
  73. server: "112.74.42.187",
  74. port: "27017",
  75. options:{
  76. user:'smartcost',
  77. pass:'SmartCost3850888',
  78. auth: {
  79. "authdb": "admin"
  80. },
  81. connectTimeoutMS: 100000,
  82. useMongoClient: true
  83. },
  84. importURL:"192.168.1.184:6050"
  85. },
  86. prod_s:{ server: "112.74.42.187",
  87. port: "28066",
  88. options:{
  89. user:'smartcost',
  90. pass:'SmartCost3850888',
  91. auth: {
  92. "authdb": "admin"
  93. },
  94. connectTimeoutMS: 50000,
  95. useMongoClient: true
  96. }},
  97. prod:{
  98. dbURL:"mongodb://smartcost:SmartCost3850888@dds-wz9da4d5ca0fdd341.mongodb.rds.aliyuncs.com:3717,dds-wz9da4d5ca0fdd342.mongodb.rds.aliyuncs.com:3717/scConstruct?authSource=admin;replicaSet=mgset-7518601",
  99. LicenseKey:"civil.smartcost.com.cn|yun.smartcost.com.cn|cloud.smartcost.com.cn,834986144349993#A0BfNtmD0jnLiOiEmTDJCLiMTO9kDNzQDNxYDO9QzM8IiOiQWSiwSflNHbhZmOiI7ckJye0ICbuFkI1pjIEJCLi4TP7BzU6d7Z9RFbrRzNNNHNFJzStVFU7llaFdkeNdDV59UYkBjWxRjUOBlW7siYu5UeVp4ZyFUd4hDZ996S5JDNJV4cXF6dvJlNTFVNuZmdPdFSj3iV8tkI0IyUiwyN7AzNxYzN7MTM0IicfJye#4Xfd5nIzImNnJiOiMkIsISMx8idgMlSgQWYlJHcTJiOi8kI1tlOiQmcQJCLiADN5QTMwACMzcDM8EDMyIiOiQncDJCLi86Yu46bj9Cdz36Y4JXYtNnLkV7bsNGLuNmLt36YuQ7cvNGdyFWbz9ib5lHLuNmLt36YuQ7cvNGdyFWbz9CbpZXajJiOiMXbEJCLig1jlzahlDZmpnInmb1uk/avoDrlmvJilrKqRXMu",
  100. importURL:"172.18.121.50:6050"
  101. },
  102. redis_local:{server:'127.0.0.1',port:'6379',pwd:'smartCost'},
  103. redis_qa:{server:'192.168.1.184',port:'6379',pwd:'smartCost'},
  104. setupDb:function (env="local") {
  105. let me = this;
  106. me.current.server = me[env].server;
  107. me.current.port = me[env].port;
  108. me.current.redis=me["redis_"+env];
  109. },
  110. getSessionURL:function (env="local") {
  111. let me = this;
  112. if(me[env].dbURL){
  113. return me[env].dbURL.replace('scConstruct','usersManages');
  114. }
  115. if(me[env].options){
  116. return 'mongodb://'+ me[env].options.user +':'+ me[env].options.pass+'@'+ me[env].server+ ':'+ me[env].port + '/usersManages?authSource=admin';
  117. }else {
  118. return 'mongodb://' + me[env].server + ':' + me[env].port + '/usersManages';
  119. }
  120. },
  121. getLicenseKey:function (env = "local") {
  122. let me = this;
  123. if (me[env].LicenseKey){
  124. return me[env].LicenseKey;
  125. }else {
  126. return me.defaultLicenseKey;
  127. }
  128. },
  129. getImportURL:function (env="local",origin) {
  130. let me = this;
  131. let importURL = me[env].importURL;
  132. if(origin.indexOf("localhost")!=-1 || origin.indexOf("127.0.0.1")!=-1){
  133. importURL = "127.0.0.1:6050";
  134. }
  135. return importURL
  136. }
  137. }