config.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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: 50000,
  15. useMongoClient: true
  16. }
  17. },
  18. test_auth: {
  19. server: "120.78.150.216",
  20. port: "27017",
  21. options:{
  22. user:'smartcost',
  23. pass:'smartcost3850888',
  24. auth: {
  25. "authdb": "scConstruct"
  26. },
  27. connectTimeoutMS: 20000,
  28. useMongoClient: true
  29. }
  30. },
  31. pp:{server: "172.18.111.228", port: "27017"},
  32. prod:{
  33. dbURL:"mongodb://smartcost:SmartCost3850888@dds-wz9da4d5ca0fdd341.mongodb.rds.aliyuncs.com:3717,dds-wz9da4d5ca0fdd342.mongodb.rds.aliyuncs.com:3717/scConstruct?authSource=admin;replicaSet=mgset-7518601",
  34. LicenseKey:"civil.smartcost.com.cn,834986144349993#A0XNdYDO9QzM8IiOiQWSiwSflNHbhZmOiI7ckJye0ICbuFkI1pjIEJCLi4TPnNnMEVXS4RGejhFZkNVMZZHTvVTWBZlcsNTaiZFbKJHSklmM8cENUJTTnJUN9NGZTVTdrU4LmVHeudDcwtySsNWW5s4UPdVZVRDe7ETNnNHduZnWwsmI0IyUiwSO4MTNwYDO5gTM0IicfJye35XX3JyMiZzZiojIDJCLiETMuYHITpEIkFWZyB7UiojIOJyebpjIkJHUiwiIzUTNxkDMgQjM7ADOxAjMiojI4J7QiwiIuNmLt36YuQ7cvNGdyFWbz9CbpZXajJiOiMXbEJCLig1jlzahlDZmpnInmb1uk/avoDrlmvJilrKqmXrunfbtmD0jnLiOiEmTDJCLiMTO9kZNdQ"
  35. },
  36. redis_local:{server:'127.0.0.1',port:'6379',pwd:'smartCost'},
  37. redis_qa:{server:'192.168.1.184',port:'6379',pwd:'smartCost'},
  38. setupDb:function (env="local") {
  39. let me = this;
  40. me.current.server = me[env].server;
  41. me.current.port = me[env].port;
  42. me.current.redis=me["redis_"+env];
  43. },
  44. getSessionURL:function (env="local") {
  45. let me = this;
  46. if(me[env].dbURL){
  47. return me[env].dbURL.replace('scConstruct','usersManages');
  48. }
  49. if(me[env].options){
  50. return 'mongodb://'+ me[env].options.user +':'+ me[env].options.pass+'@'+ me[env].server+ ':'+ me[env].port + '/usersManages?authSource=admin';
  51. }else {
  52. return 'mongodb://' + me[env].server + ':' + me[env].port + '/usersManages';
  53. }
  54. },
  55. getLicenseKey:function (env = "local") {
  56. let me = this;
  57. if (me[env].LicenseKey){
  58. return me[env].LicenseKey;
  59. }else {
  60. return me.defaultLicenseKey;
  61. }
  62. }
  63. }