lrf402788946 há 3 anos atrás
pai
commit
1c6f6b5af4
2 ficheiros alterados com 12 adições e 2 exclusões
  1. 1 1
      app/service/system/tenant.js
  2. 11 1
      config/config.prod.js

+ 1 - 1
app/service/system/tenant.js

@@ -17,7 +17,7 @@ class TenantService extends CrudService {
    * @property _tenant 分站名
    */
   async getTenant({ _tenant }) {
-    const res = await this.model.find({ _tenant });
+    const res = await this.model.findOne({ _tenant });
     return res;
   }
 }

+ 11 - 1
config/config.prod.js

@@ -7,6 +7,16 @@ module.exports = () => {
     level: 'INFO',
     consoleLevel: 'INFO',
   };
-
+  config.dbName = 'shitang';
+  config.mongoose = {
+    url: `mongodb://localhost:27017/${config.dbName}`,
+    options: {
+      user: 'admin',
+      pass: 'admin',
+      authSource: 'admin',
+      useNewUrlParser: true,
+      useCreateIndex: true,
+    },
+  };
   return config;
 };