guhongwei vor 4 Jahren
Ursprung
Commit
476e596bee
2 geänderte Dateien mit 17 neuen und 7 gelöschten Zeilen
  1. 2 0
      app/service/login.js
  2. 15 7
      config/config.default.js

+ 2 - 0
app/service/login.js

@@ -16,6 +16,8 @@ class LoginService extends CrudService {
   // 用户登录
   async login(data) {
     const { mobile, password } = data;
+    console.log(mobile);
+    console.log(password);
     // 根据用户输入的手机号查询其他用户表中是否存在相应数据
     let user = await this.model.findOne({ mobile });
     const flag = true;

+ 15 - 7
config/config.default.js

@@ -6,11 +6,11 @@ const { jwt } = require('./config.secret');
  * @param {Egg.EggAppInfo} appInfo app info
  */
 module.exports = appInfo => {
-/**
- * built-in config
- * @type {Egg.EggAppConfig}
- **/
-  const config = exports = {};
+  /**
+   * built-in config
+   * @type {Egg.EggAppConfig}
+   **/
+  const config = (exports = {});
 
   // use for cookie sign key, should change to your own and keep security
   config.keys = appInfo.name + '_1579225760252_7743';
@@ -20,7 +20,7 @@ module.exports = appInfo => {
 
   // add your user config here
   const userConfig = {
-  // myAppName: 'egg',
+    // myAppName: 'egg',
   };
 
   // add your config here
@@ -45,7 +45,15 @@ module.exports = appInfo => {
     expiresIn: '1d',
     issuer: 'servicezhwl',
   };
-
+  // redis config
+  config.redis = {
+    client: {
+      port: 6379, // Redis port
+      host: '127.0.0.1', // Redis host
+      password: 123456,
+      db: 0,
+    },
+  };
   // config.amqp = {
   //   client: {
   //     hostname: '127.0.0.1',