فهرست منبع

增加上传根路径

liuyu 5 سال پیش
والد
کامیت
e0c9131227
2فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 2 1
      app/service/school.js
  2. 3 0
      config/config.default.js

+ 2 - 1
app/service/school.js

@@ -20,7 +20,8 @@ class SchoolService extends CrudService {
     assert(termid, 'termid不能为空');
     assert(schid, 'schid不能为空');
     // 取得excle中数据
-    const studatas = await this.getImportXLSXData(filepath, termid, schid);
+    const _filepath = this.ctx.app.config.baseUrl + filepath;
+    const studatas = await this.getImportXLSXData(_filepath, termid, schid);
     // 将得到的数据校验
     const datacheck = await this.datacheck(studatas);
     if (datacheck.errorcode === '1') {

+ 3 - 0
config/config.default.js

@@ -37,6 +37,9 @@ module.exports = appInfo => {
     },
   };
 
+  // 服务器发布路径
+  config.baseUrl = 'http://free.liaoningdoupo.com';
+
   // config.amqp = {
   //   client: {
   //     hostname: '127.0.0.1',