lrf402788946 4 years ago
parent
commit
2320e5e0e6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/service/school.js

+ 3 - 1
app/service/school.js

@@ -92,7 +92,9 @@ class SchoolService extends CrudService {
     let school_name;
     const sch = await this.ctx.model.School.findOne({ code: schid });
     if (sch) school_name = sch.name;
-    const fullUrl = 'http://jytz.jilinjobs.cn' + filepath; // this.ctx.app.config.baseUrl http://127.0.0.1 http://jytz.jilinjobs.cn
+    let domain = 'http://127.0.0.1';
+    if (process.env.NODE_ENV === 'development') domain = 'http://jytz.jilinjobs.cn';
+    const fullUrl = domain + filepath; // this.ctx.app.config.baseUrl http://127.0.0.1 http://jytz.jilinjobs.cn
     let studentList = await this.getDataFromExcel(fullUrl);
     const checkRes = await this.checkData(studentList);
     const { errorcode } = checkRes;