config.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. uat: {
  60. server: "112.74.42.187",
  61. port: "27017",
  62. options:{
  63. user:'smartcost',
  64. pass:'SmartCost3850888',
  65. auth: {
  66. "authdb": "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. "authdb": "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/scConstruct?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:6050"
  88. },
  89. redis_local:{server:'127.0.0.1',port:'6379',pwd:'smartCost'},
  90. redis_qa:{server:'192.168.1.184',port:'6379',pwd:'smartCost'},
  91. setupDb:function (env="local") {
  92. let me = this;
  93. me.current.server = me[env].server;
  94. me.current.port = me[env].port;
  95. me.current.redis=me["redis_"+env];
  96. },
  97. getSessionURL:function (env="local") {
  98. let me = this;
  99. if(me[env].dbURL){
  100. return me[env].dbURL.replace('scConstruct','usersManages');
  101. }
  102. if(me[env].options){
  103. return 'mongodb://'+ me[env].options.user +':'+ me[env].options.pass+'@'+ me[env].server+ ':'+ me[env].port + '/usersManages?authSource=admin';
  104. }else {
  105. return 'mongodb://' + me[env].server + ':' + me[env].port + '/usersManages';
  106. }
  107. },
  108. getLicenseKey:function (env = "local") {
  109. let me = this;
  110. if (me[env].LicenseKey){
  111. return me[env].LicenseKey;
  112. }else {
  113. return me.defaultLicenseKey;
  114. }
  115. },
  116. getImportURL:function (env="local",origin) {
  117. let me = this;
  118. let importURL = me[env].importURL;
  119. if(origin.indexOf("localhost")!=-1 || origin.indexOf("127.0.0.1")!=-1){
  120. importURL = "127.0.0.1:6050";
  121. }
  122. return importURL
  123. }
  124. }