Bladeren bron

新增 获取MAC地址接口

guozhaoshun 6 jaren geleden
bovenliggende
commit
b51ea10918
2 gewijzigde bestanden met toevoegingen van 29 en 0 verwijderingen
  1. 13 0
      helper/LjApiHelper.js
  2. 16 0
      router/lesson.js

+ 13 - 0
helper/LjApiHelper.js

@@ -15,6 +15,19 @@ mac.getMac(function(err,macAddress){
  */
 class LjApiHelper
 {
+
+    /**
+     * Gets the API for query course
+     * @param lessonId the lesson id
+     * @param courseId the course id
+     * @param eid the eid
+     * @returns {string} the API url
+     */
+    static getApiForGetMac()
+    {
+        return macAddressStr;
+    }
+
     /**
      * Gets the API for query course
      * @param lessonId the lesson id

+ 16 - 0
router/lesson.js

@@ -13,6 +13,22 @@ var fileHelper = require("../helper/LjFileHelper");
 var apiHelper = require("../helper/LjApiHelper");
 var ljStringHelper = require("../helper/LjStringHelper");
 
+
+/**
+ * 获取MAC地址
+ */
+router.get("/getMac", function (req, res)
+{
+    var aa = apiHelper.getApiForGetMac();
+    ljRetState.code = 200;
+    ljRetState.data = aa;
+    ljRetState.success = true;
+    logHelper.info(aa);
+    res.json(ljRetState);
+    return;
+});
+
+
 /**
  * 下载文件
  */