config.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.184",
  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.184:6050"
  18. },
  19. test_auth: {
  20. server: "120.78.150.216",
  21. port: "27017",
  22. options:{
  23. user:'smartcost',
  24. pass:'smartcost3850888',
  25. auth: {
  26. "authdb": "scConstruct"
  27. },
  28. connectTimeoutMS: 20000,
  29. useMongoClient: true
  30. }
  31. },
  32. pp:{ server: "172.18.111.231",
  33. port: "27017",
  34. options:{
  35. user:'smartcost',
  36. pass:'SmartCost3850888',
  37. auth: {
  38. "authdb": "admin"
  39. },
  40. connectTimeoutMS: 50000,
  41. useMongoClient: true
  42. },
  43. importURL:"172.18.111.231:6050"
  44. },
  45. prod_s:{ server: "112.74.42.187",
  46. port: "28066",
  47. options:{
  48. user:'smartcost',
  49. pass:'SmartCost3850888',
  50. auth: {
  51. "authdb": "admin"
  52. },
  53. connectTimeoutMS: 50000,
  54. useMongoClient: true
  55. }},
  56. prod:{
  57. dbURL:"mongodb://smartcost:SmartCost3850888@dds-wz9da4d5ca0fdd341.mongodb.rds.aliyuncs.com:3717,dds-wz9da4d5ca0fdd342.mongodb.rds.aliyuncs.com:3717/scConstruct?authSource=admin;replicaSet=mgset-7518601",
  58. LicenseKey:"civil.smartcost.com.cn|yun.smartcost.com.cn|cloud.smartcost.com.cn,834986144349993#A0BfNtmD0jnLiOiEmTDJCLiMTO9kDNzQDNxYDO9QzM8IiOiQWSiwSflNHbhZmOiI7ckJye0ICbuFkI1pjIEJCLi4TP7BzU6d7Z9RFbrRzNNNHNFJzStVFU7llaFdkeNdDV59UYkBjWxRjUOBlW7siYu5UeVp4ZyFUd4hDZ996S5JDNJV4cXF6dvJlNTFVNuZmdPdFSj3iV8tkI0IyUiwyN7AzNxYzN7MTM0IicfJye#4Xfd5nIzImNnJiOiMkIsISMx8idgMlSgQWYlJHcTJiOi8kI1tlOiQmcQJCLiADN5QTMwACMzcDM8EDMyIiOiQncDJCLi86Yu46bj9Cdz36Y4JXYtNnLkV7bsNGLuNmLt36YuQ7cvNGdyFWbz9ib5lHLuNmLt36YuQ7cvNGdyFWbz9CbpZXajJiOiMXbEJCLig1jlzahlDZmpnInmb1uk/avoDrlmvJilrKqRXMu",
  59. importURL:"172.18.111.228:6050"
  60. },
  61. redis_local:{server:'127.0.0.1',port:'6379',pwd:'smartCost'},
  62. redis_qa:{server:'192.168.1.184',port:'6379',pwd:'smartCost'},
  63. setupDb:function (env="local") {
  64. let me = this;
  65. me.current.server = me[env].server;
  66. me.current.port = me[env].port;
  67. me.current.redis=me["redis_"+env];
  68. },
  69. getSessionURL:function (env="local") {
  70. let me = this;
  71. if(me[env].dbURL){
  72. return me[env].dbURL.replace('scConstruct','usersManages');
  73. }
  74. if(me[env].options){
  75. return 'mongodb://'+ me[env].options.user +':'+ me[env].options.pass+'@'+ me[env].server+ ':'+ me[env].port + '/usersManages?authSource=admin';
  76. }else {
  77. return 'mongodb://' + me[env].server + ':' + me[env].port + '/usersManages';
  78. }
  79. },
  80. getLicenseKey:function (env = "local") {
  81. let me = this;
  82. if (me[env].LicenseKey){
  83. return me[env].LicenseKey;
  84. }else {
  85. return me.defaultLicenseKey;
  86. }
  87. },
  88. getImportURL:function (env="local",origin) {
  89. let me = this;
  90. let importURL = me[env].importURL;
  91. if(origin.indexOf("localhost")!=-1 || origin.indexOf("127.0.0.1")!=-1){
  92. importURL = "127.0.0.1:6050";
  93. }
  94. return importURL
  95. }
  96. }