Просмотр исходного кода

上传服务切换为PHP服务;Ad、article优化

kevin_zhangl 3 лет назад
Родитель
Сommit
1aca02cdab

+ 2 - 0
.gitignore

@@ -24,3 +24,5 @@ vendor
 frontendApi/web/pdfs/
 #composer.json
 composer.lock
+backendApi/web/uploads
+frontendApi/web/uploads

+ 2 - 0
backendApi/config/urlManagerRules.php

@@ -496,6 +496,8 @@ return [
             'GET index' => 'index',
             'GET,POST add' => 'add',
             'GET,POST edit/<id>' => 'edit',
+            'GET detail' => 'detail',
+            'GET detail/<id>' => 'detail',
             'GET,POST article-delete' => 'article-delete',
             'GET category' => 'category',
             'POST category-add' => 'category-add',

+ 8 - 2
backendApi/modules/v1/controllers/AdController.php

@@ -13,6 +13,7 @@ use common\helpers\Form;
 use common\helpers\Log;
 use common\models\Ad;
 use common\models\AdLocation;
+use common\models\Article;
 use common\models\forms\AdForm;
 use common\models\forms\UploadForm;
 use Yii;
@@ -65,6 +66,8 @@ class AdController extends BaseController
             'orderBy' => 'AD.SORT DESC,AD.CREATED_AT ASC',
         ]);
         $data['allLocation'] = AdLocation::getAllLocation();
+        $data['allArticle'] = Article::find()->select('ID,TITLE')->asArray()->all();
+
         return static::notice($data);
     }
 
@@ -82,7 +85,9 @@ class AdController extends BaseController
         }
         // 获取全部分类
         $allLocation = AdLocation::getAllLocation();
-        return static::notice(['allLocation'=>$allLocation]);
+        $allArticle = Article::findAllAsArray();
+
+        return static::notice(['allLocation'=>$allLocation, 'allArticle' => $allArticle]);
     }
 
     /**
@@ -101,7 +106,8 @@ class AdController extends BaseController
         $oneData = Ad::findOneAsArray(['ID'=>$id]);
         // 获取全部分类
         $allLocation = AdLocation::getAllLocation();
-        return static::notice(['oneData'=>$oneData, 'allLocation'=>$allLocation]);
+        $allArticle = Article::findAllAsArray();
+        return static::notice(['oneData'=>$oneData, 'allLocation'=>$allLocation, 'allArticle' => $allArticle]);
     }
 
     /**

+ 25 - 0
backendApi/modules/v1/controllers/ArticleController.php

@@ -138,4 +138,29 @@ class ArticleController extends BaseController
         return $result;
     }
 
+    /**
+     * 获取文章详细
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionDetail()
+    {
+        $id = \Yii::$app->request->get('id');
+        $data = null;
+        if($id){
+            $data = Article::findOneAsArray('ID=:ID AND STATUS=1', [':ID'=>$id], 'ID,TITLE,CID,CREATED_AT');
+        }
+        if($data){
+            // 暂时先从文件中取内容
+            $path = \Yii::getAlias('@common/runtime/articleContent/').$data['ID'];
+            if(!file_exists($path)){
+                $data['CONTENT'] = '';
+            } else {
+                $data['CONTENT'] = file_get_contents($path);
+            }
+            return static::notice($data);
+        } else {
+            return static::notice('Article not exists!', 400); // 文章不存在
+        }
+    }
 }

+ 1 - 1
backendEle/src/components/ExcelUploader.vue

@@ -113,7 +113,7 @@
       uploaderHandleSuccess(response, file) {
         if (response.success) {
           this.$message({
-            message: '上传成功',
+            message: 'Successful',
             type: 'success'
           })
           // 显示进度框

+ 3 - 3
backendEle/src/components/Uploader.vue

@@ -99,7 +99,7 @@ export default {
       else if (this.defaultImageUrl !== null) {
         //this.uploaderShow = false
         //this.uploaderDisabled = true
-        
+
         this.uploaderLoading = false
         return this.defaultImageUrl
       }
@@ -127,7 +127,7 @@ export default {
       // console.log(response)
       if (response.success) {
         this.$message({
-          message: '上传成功',
+          message: 'Successful',
           type: 'success'
         })
         this.successImageUrl = URL.createObjectURL(file.raw)
@@ -167,4 +167,4 @@ export default {
     color: #8c939d;
     text-align: center;
   }
-</style>
+</style>

+ 12 - 0
backendEle/src/router/index.js

@@ -1458,6 +1458,18 @@ export const constantRouterMap = [
           ],
         },
       },
+      {
+        path: '/article/detail/:id',
+        component: _import('article/detail'),
+        name: 'article_detail',
+        meta: {
+          title: 'Article Detail',
+          breadcrumb: [
+            {title: 'Dashboard', path: '/dashboard/index'},
+            {title: 'Article Management', path: '/article/list'},
+          ],
+        },
+      },
     ]
   },
   {

+ 8 - 1
backendEle/src/utils/tool.js

@@ -2,7 +2,7 @@ import errorCode from './errorCode'
 import baseInfo from './baseInfo'
 import userInfo from './userInfo'
 import router from '@/router'
-import {PRICE_IS_ROUND} from './config'
+import {PRICE_IS_ROUND,SERVER_API_DOMAIN} from './config'
 import ElementUI from 'element-ui'
 
 let tool = {
@@ -261,6 +261,13 @@ let tool = {
       let searchStr = new RegExp('(\\?|&)('+paramName+'=)([^&]*)(&|$)')
       window.location.href = window.location.href.replace(searchStr, '$1$2'+value+'$4')
     }
+  },
+
+  imageRenderSoup(cover) {
+    return cover.indexOf(SERVER_API_DOMAIN) > 0
+  },
+  imageRenderLang(cover) {
+    return SERVER_API_DOMAIN + '/uploads/' + cover
   }
 }
 

+ 45 - 6
backendEle/src/views/ad/edit.vue

@@ -17,10 +17,15 @@
             <el-option label="Article" value="2" :key="2"></el-option> <!-- 文章 -->
           </el-select>
         </el-form-item>
-        <el-form-item :label="form.type==='1' ? 'Url' : 'Article ID'"> <!-- '链接地址' '文章ID' -->
-          <el-input v-model="form.content" style="width: 400px;">></el-input>
+        <el-form-item v-if="form.type==='1'" label="Url"> <!-- '链接地址' '文章ID' -->
+          <el-input v-model="url" style="width: 400px;"></el-input>
           <span class="note"></span> <!-- 注:外链请明确输入 http://或https://,文章则不需要输入 -->
         </el-form-item>
+        <el-form-item v-else label="Article"> <!-- '文章ID' -->
+          <el-select v-model="article" placeholder="Select Article" style="width: 400px;">
+            <el-option v-for="item in allArticle" :label="item.TITLE" :value="item.ID" :key="item.ID"></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="Image"> <!-- 广告图片 -->
           <leo-uploader :requestRoute="'ad/upload'" :defaultImageUrl="defaultImageUrl" width="400px" height="160px"
                         @on-success="handleSuccess"></leo-uploader>
@@ -36,6 +41,7 @@
 <script>
 import network from '../../utils/network'
 import LeoUploader from '../../components/Uploader'
+import {SERVER_API_HTTP_TYPE,SERVER_API_DOMAIN} from '@/utils/config'
 
 export default {
   name: 'ad_edit',
@@ -46,16 +52,28 @@ export default {
         this.form.title = response.oneData.TITLE
         this.form.lid = response.oneData.LID
         this.form.type = response.oneData.TYPE
+
+        this.imageAd = response.oneData.IMAGE;
+        this.form.image = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + response.oneData.IMAGE;
+        this.defaultImageUrl = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + response.oneData.IMAGE;
+
         this.form.content = response.oneData.CONTENT
-        this.form.image = response.oneData.IMAGE
-        this.defaultImageUrl = response.oneData.IMAGE
+        if (response.oneData.TYPE === '1') {
+            this.url = response.oneData.CONTENT
+        } else {
+            this.article = response.oneData.CONTENT
+        }
+
         this.allLocation = response.allLocation
+        this.allArticle = response.allArticle
+
         this.loading = false
         this.isEdit = true
       })
     } else {
       network.getData('ad/add').then(response => {
         this.allLocation = response.allLocation
+        this.allArticle = response.allArticle
         this.loading = false
       })
     }
@@ -74,6 +92,10 @@ export default {
       loading: false,
       submitButtonStat: false,
       isEdit: false,
+      imageAd: '',
+      allArticle: [],
+      url: '',
+      article: '',
     }
   },
   methods: {
@@ -83,6 +105,9 @@ export default {
       if (this.$route.name === 'ad_edit') {
         path = 'ad/edit/' + this.$route.params.id
       }
+
+      this.form.image = this.imageAd
+      this.form.content = this.form.type === '1' ? this.url : this.article
       network.postData(path, this.form).then(response => {
         this.submitButtonStat = false
         this.$message({
@@ -90,13 +115,27 @@ export default {
           type: 'success'
         })
         this.$router.go(-1)
-      }).catch(response => {
+      }).catch(_ => {
         this.submitButtonStat = false
       })
     },
     handleSuccess (imageUrl) {
-      this.form.image = imageUrl
+      this.imageAd = imageUrl
+      this.form.image = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
+      this.defaultImageUrl = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
     },
+  },
+  watch: {
+      'form.type': {
+          deep: true,
+          handler: function handler(modern) {
+              if (modern === '1') {
+                  this.article = ''
+              } else {
+                  this.url = ''
+              }
+          }
+      }
   }
 }
 </script>

+ 30 - 2
backendEle/src/views/ad/list.vue

@@ -5,7 +5,12 @@
                 @selection-change="handleSelectionChange" @row-click="handleExpand">
         <el-table-column type="expand">
           <template slot-scope="scope">
-            <img :src="scope.row.IMAGE" :alt="scope.row.TITLE">
+            <a v-if="scope.row.TYPE === '1'" :href="getHref(scope.row.CONTENT)" target="_blank" class="islide">
+                <img :src="getImage(scope.row.IMAGE)" width="100px" height="100px" :alt="scope.row.TITLE">
+            </a>
+            <router-link v-else :to="`/article/detail/${scope.row.CONTENT}`" target="_blank" class="islide">
+                <img :src="getImage(scope.row.IMAGE)" width="100px" height="100px" :alt="scope.row.TITLE">
+            </router-link>
           </template>
         </el-table-column>
         <el-table-column type="selection" width="55"></el-table-column>
@@ -29,7 +34,16 @@
             </template>
           </template>
         </el-table-column>
-        <el-table-column label="ID" prop="CONTENT" width="120"></el-table-column> <!-- 链接或文章ID -->
+        <el-table-column label="Content" prop="CONTENT" width="120">
+          <template slot-scope="scope">
+            <div v-if="scope.row.TYPE === '1'">
+                <el-link type="primary" target="_blank" :href="getHref(scope.row.CONTENT)">{{ scope.row.CONTENT }}</el-link>
+            </div><!-- 链接 -->
+            <div v-else-if="scope.row.TYPE === '2'">
+                <router-link :to="`/article/detail/${scope.row.CONTENT}`" target="_blank" style="cursor: pointer;">{{ getContent(scope.row.CONTENT) }}</router-link>
+            </div><!-- 文章 -->
+          </template>
+        </el-table-column>
         <el-table-column label="Sort" width="100"> <!-- 排序 -->
           <template slot-scope="scope">
             <el-input v-model="scope.row.SORT" min="0" max="99" @change="handleChangeSort(scope.row, scope.row.SORT)"
@@ -93,6 +107,8 @@ import tool from '@/utils/tool'
 import store from '@/utils/vuexStore'
 import permission from '@/utils/permission'
 import Pagination from '@/components/Pagination'
+import {SERVER_API_HTTP_TYPE,SERVER_API_DOMAIN} from '@/utils/config'
+import article from "../article";
 
 export default {
   name: 'ad_list',
@@ -112,6 +128,7 @@ export default {
       pageSize: 20,
       tool: tool,
       permission: permission,
+      allArticle: [],
     }
   },
   methods: {
@@ -149,6 +166,7 @@ export default {
       let obj = this
       network.getPageData(this, `ad/list/${this.$route.params.lid}`, page, pageSize, null, function (response) {
         obj.allData = response
+        obj.allArticle = response.allArticle
       })
     },
     delData (id = null) {
@@ -180,6 +198,16 @@ export default {
 
       })
     },
+    getImage(imageUrl) {
+      return SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
+    },
+    getContent(aid) {
+      let titles = this.allArticle.filter(article => article.ID === aid).map(article => article.TITLE);
+      return titles.length > 0 ? titles[0] : aid;
+    },
+    getHref(link) {
+        return link.indexOf('http') > 0 ? link : 'http://' + link;
+    },
   }
 }
 

+ 57 - 0
backendEle/src/views/article/detail.vue

@@ -0,0 +1,57 @@
+<template>
+  <div v-loading="loading">
+    <div class="white-box">
+      <div class="white-box-title">
+        <h1>{{title}}</h1>
+        <span>{{tool.formatDate(createdAt)}}</span>
+      </div>
+      <div v-html="content" class="white-box-content">
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import Vue from 'vue'
+import network from '@/utils/network'
+import tool from '@/utils/tool'
+import store from '@/utils/vuexStore'
+
+export default {
+  name: 'article_detail',
+  mounted () {
+    this.getData()
+  },
+  data () {
+    return {
+      title: null,
+      content: null,
+      createdAt: '',
+      loading: true,
+      tool: tool,
+    }
+  },
+  methods: {
+    handleCurrentChange (page) {
+      this.getData(page, this.pageSize)
+    },
+    handleSizeChange (pageSize) {
+      this.getData(this.currentPage, pageSize)
+    },
+    getData () {
+      network.getData(`article/detail/${this.$route.params.id}`).then(response => {
+        this.title = response.TITLE
+        this.content = response.CONTENT
+        this.createdAt = response.CREATED_AT
+        this.loading = false
+      })
+    },
+  }
+}
+
+</script>
+
+<style scoped>
+  .white-box-title span{color: #999}
+  .white-box-content{font-size: 16px;padding: 15px 0;line-height: 2;}
+</style>

+ 17 - 9
backendEle/src/views/shop/index.vue

@@ -127,11 +127,11 @@
                                 v-model="form.content">
                         </el-input><!-- 请输入内容 -->
                     </el-form-item>
-                    <el-form-item label="order"> <!-- 排序 -->
+                    <el-form-item label="Order"> <!-- 排序 -->
                         <el-input v-model="form.sort"></el-input>
                     </el-form-item>
 
-                    <el-form-item label="upload images"> <!-- 上传图片 -->
+                    <el-form-item label="Upload Images"> <!-- 上传图片 -->
                        <div class='up_load'>
                            <!-- <img v-if="form.cover&&img_show" :src="form.cover" alt=""> -->
                             <leo-uploader
@@ -162,7 +162,7 @@
     import permission from '@/utils/permission'
     import Pagination from '@/components/Pagination'
     import filterHelper from '@/utils/filterHelper'
-    import {FRONTEND_SERVER} from '@/utils/config'
+    import {FRONTEND_SERVER,SERVER_API_HTTP_TYPE,SERVER_API_DOMAIN} from '@/utils/config'
     import store from './../../utils/vuexStore'
      import LeoUploader from '@/components/Uploader';
     export default {
@@ -251,7 +251,9 @@
                 this.$router.push({path: `/shop/goods-add`})
             },
             upLoadSuccess(file){
-                this.form.cover=file;
+                // this.form.cover=file;
+                this.form.cover = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + file;
+                this.form.coverOrigin = file
                 this.img_show=false;
             },
             handleEditShow(row) {
@@ -308,15 +310,21 @@
                     vueObj.form.content=response.goodsInfo.CONTENT
                     vueObj.form.sort=response.goodsInfo.SORT
                     vueObj.form.id=response.goodsInfo.ID
-                    vueObj.form.cover=response.goodsInfo.COVER
+                    // vueObj.form.cover=response.goodsInfo.COVER
                     vueObj.form.categoryType=parseInt(response.goodsInfo.CATEGORY_TYPE)
                     vueObj.form.taxRate=response.goodsInfo.TAX_RATE
                     // vueObj.form.sellType=vueObj.form.sellType.map((item,index)=>{
                     //   return response.goodsInfo.SELL_TYPE.some(val=>(index+1).toString()==val)
                     //   })
 
-                    this.$forceUpdate()
+                    vueObj.form.coverOrigin = response.goodsInfo.COVER
+                    if (response.goodsInfo.COVER.indexOf('/') === -1) {
+                        vueObj.form.cover = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + response.goodsInfo.COVER
+                    } else {
+                        vueObj.form.cover = response.goodsInfo.COVER
+                    }
 
+                    this.$forceUpdate()
                 })
             },
             handleEdit() {
@@ -343,6 +351,8 @@
                 })
                 this.form.giftType=sen_gift;
                 this.form.sellType = 1
+                this.form.cover = this.form.coverOrigin;
+                delete this.form.coverOrigin;
 
                 network.postData(path, {...this.form}).then(response => {
                     this.$message({
@@ -385,10 +395,8 @@
             getData (page, pageSize) {
                 let filterData = this.filterModel
                 /*this.allData = response*/
-                network.getPageData(this, 'shop/index', page, pageSize, this.filterModel, response=>{
-                    console.log(response)
+                network.getPageData(this, 'shop/index', page, pageSize, this.filterModel, response => {
                     this.filterTypes = response.filterTypes
-
                 })
             },
             handleGoodUp(id){

+ 5 - 5
common/helpers/LoggerTool.php

@@ -12,7 +12,7 @@ class LoggerTool
     {
         $logger = new Logger('info');
         // 添加一些处理器
-        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/debug/trace.log", Logger::DEBUG));
+        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/logs/trace.log", Logger::DEBUG));
         $logger->pushHandler(new FirePHPHandler());
         $logger->info(json_encode($message));
     }
@@ -21,7 +21,7 @@ class LoggerTool
     {
         $logger = new Logger('error');
         // 添加一些处理器
-        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/debug/trace.log", Logger::DEBUG));
+        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/logs/error.log", Logger::DEBUG));
         $logger->pushHandler(new FirePHPHandler());
         $logger->error(json_encode($message));
     }
@@ -30,7 +30,7 @@ class LoggerTool
     {
         $logger = new Logger('warning');
         // 添加一些处理器
-        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/debug/trace.log", Logger::DEBUG));
+        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/logs/warning.log", Logger::DEBUG));
         $logger->pushHandler(new FirePHPHandler());
         $logger->warning(json_encode($message));
     }
@@ -39,7 +39,7 @@ class LoggerTool
     {
         $logger = new Logger('notice');
         // 添加一些处理器
-        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/debug/trace.log", Logger::DEBUG));
+        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/logs/notice.log", Logger::DEBUG));
         $logger->pushHandler(new FirePHPHandler());
         $logger->notice(json_encode($message));
     }
@@ -48,7 +48,7 @@ class LoggerTool
     {
         $logger = new Logger('debug');
         // 添加一些处理器
-        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/debug/trace.log", Logger::DEBUG));
+        $logger->pushHandler(new StreamHandler(__DIR__ . "/../runtime/logs/debug.log", Logger::DEBUG));
         $logger->pushHandler(new FirePHPHandler());
         $logger->debug(json_encode($message));
     }

+ 12 - 12
common/models/forms/AdForm.php

@@ -43,7 +43,7 @@ class AdForm extends Model
         return [
             [['id', 'title', 'image', 'type', 'lid', 'content', 'sort', 'status'], 'trim'],
             [['id', 'title', 'image', 'type', 'lid', 'content', 'sort', 'status'], 'required'],
-            [['image'], 'url'],
+//            [['image'], 'url'],
             [['id'], 'exist', 'targetClass'=>Ad::class, 'targetAttribute'=>'ID'],
             [['id'], 'initModel'],
             [['lid'], 'exist', 'targetClass'=>AdLocation::class, 'targetAttribute'=>'ID'],
@@ -56,13 +56,13 @@ class AdForm extends Model
     {
         return [
             'id' => 'ID',
-            'title' => '标题',
-            'image' => '图片',
-            'type' => '类型',
-            'lid' => '广告位',
-            'content' => '链接地址或文章ID',
-            'sort' => '排序',
-            'status' => '状态',
+            'title' => 'Title',// 标题
+            'image' => 'Image', // 图片
+            'type' => 'Type', // 类型
+            'lid' => 'Ad', // 广告位
+            'content' => 'External link or article ID', // 链接地址或文章ID
+            'sort' => 'Order', // 排序
+            'status' => 'State', // 状态
         ];
     }
 
@@ -96,7 +96,7 @@ class AdForm extends Model
      */
     public function isType($attribute){
         if(!in_array($this->type, [Ad::TYPE_LINK, Ad::TYPE_ARTICLE])){
-            $this->addError($attribute, '类型错误');
+            $this->addError($attribute, 'Type error'); // 类型错误
         }
     }
 
@@ -106,7 +106,7 @@ class AdForm extends Model
      */
     public function isContent($attribute){
         if($this->content == ""){
-            $this->addError($attribute, '内容错误');
+            $this->addError($attribute, 'Content error'); // 内容错误
         }
     }
 
@@ -178,7 +178,7 @@ class AdForm extends Model
             return null;
         }
         $this->adminOperateLogger->afterUpdate($model)->clean()->save([
-            'optType' => '广告排序',
+            'optType' => 'Ad Order', // 广告排序
         ]);
         return $model;
     }
@@ -215,7 +215,7 @@ class AdForm extends Model
      */
     public function delete($selected) {
         $this->adminOperateLogger->clean()->save([
-            'optType' => '删除广告',
+            'optType' => 'Delete Ad', // 删除广告
         ]);
     }
 }

+ 5 - 10
common/models/forms/UploadForm.php

@@ -32,7 +32,7 @@ class UploadForm extends Model {
 
     private $_ocrResult;
     private $_remoteScenario = [
-        'idCardFront', 'idCardBack', 'ad', 'invoiceFront','proveFront','goodsImg'
+//        'idCardFront', 'idCardBack', 'ad', 'invoiceFront','proveFront','goodsImg'
     ];
 
     /**
@@ -143,6 +143,8 @@ class UploadForm extends Model {
                     $uploadCategory = Uploads::CATEGORY_ID_CARD;
                     $uploadRemark = $oneUser['REAL_NAME'] . '身份证背面';
                     break;
+                case 'proveFront':
+                case 'goodsImg':
                 case 'ad':
                     $uploadCategory = Uploads::CATEGORY_IMAGE;
                     $uploadRemark = $this->file->baseName;
@@ -151,14 +153,6 @@ class UploadForm extends Model {
                     $uploadCategory = Uploads::CATEGORY_EXCEL;
                     $uploadRemark = $this->file->baseName;
                     break;
-                case 'proveFront':
-                    $uploadCategory = Uploads::CATEGORY_IMAGE;
-                    $uploadRemark = $this->file->baseName;
-                    break;
-                case 'goodsImg':
-                    $uploadCategory = Uploads::CATEGORY_IMAGE;
-                    $uploadRemark = $this->file->baseName;
-                    break;
                 default :
                     $uploadCategory = Uploads::CATEGORY_UN_KNOW;
                     $uploadRemark = $this->file->baseName;
@@ -189,7 +183,8 @@ class UploadForm extends Model {
                 $uploadInfo = [
                     'fileName' => $this->file->baseName . '.' . $this->file->extension,
                     'category' => $uploadCategory,
-                    'url' => $localPath,
+//                    'url' => $localPath,
+                    'url' => $this->file->baseName . '.' . $this->file->extension,
                     'fileSize' => null,
                     'md5' => null,
                 ];

+ 1 - 1
frontendApi/modules/v1/controllers/BonusController.php

@@ -845,7 +845,7 @@ class BonusController extends BaseController {
             //$formModel->token = \Yii::$app->request->post('uploadToken');
             $formModel->token = \Yii::$app->request->request('uploadToken');
             if ($formModel->file && $formModel->upload()) {
-                return static::notice('上传成功');
+                return static::notice('Successful');
             } else {
                 return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
             }

+ 2 - 2
frontendApi/modules/v1/controllers/FinanceController.php

@@ -281,7 +281,7 @@ class FinanceController extends BaseController {
             //$formModel->token = \Yii::$app->request->post('uploadToken');
             $formModel->token = \Yii::$app->request->request('uploadToken');
             if ($formModel->file && $formModel->upload()) {
-                return static::notice('上传成功');
+                return static::notice('Successful');
             } else {
                 return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
             }
@@ -547,7 +547,7 @@ class FinanceController extends BaseController {
             $formModel->token = \Yii::$app->request->request('uploadToken');
             $formModel->rechargeId = $id;
             if ($formModel->file && $formModel->upload()) {
-                return static::notice('上传成功');
+                return static::notice('Successful');
             } else {
                 return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
             }

+ 1 - 1
frontendApi/modules/v1/controllers/UserController.php

@@ -137,7 +137,7 @@ class UserController extends BaseController {
             //$formModel->token = \Yii::$app->request->post('uploadToken');
             $formModel->token = \Yii::$app->request->request('uploadToken');
             if ($formModel->file && $formModel->upload()) {
-                return static::notice('上传成功');
+                return static::notice('Successful');
             } else {
                 return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
             }

+ 1 - 1
frontendEle/src/components/Uploader.vue

@@ -112,7 +112,7 @@
         this.$message.closeAll()
         if (response.success) {
           this.$message({
-            message: '上传成功',
+            message: 'Successful',
             type: 'success'
           })
           this.successImageUrl = URL.createObjectURL(file.raw)

+ 6 - 2
frontendEle/src/views/dashboard/index.vue

@@ -38,7 +38,7 @@
           </a>
         </template>
         <template v-else>
-          <router-link :to="`/article/detail/${item.CONTENT}`" target="_blank" class="islide"><img ref="bannerHeight" :src="item.IMAGE" alt="" @load="imgLoad"></router-link>
+          <router-link :to="`/article/detail/${item.CONTENT}`" target="_blank" class="islide"><img ref="bannerHeight" :src="imageArticle(item.IMAGE)" alt="" @load="imgLoad"></router-link>
         </template>
       </el-carousel-item>
     </el-carousel>
@@ -69,6 +69,7 @@
   import baseInfo from '@/utils/baseInfo'
   import userInfo from '@/utils/userInfo'
   import countUp from 'vue-countup-v2'
+  import {SERVER_API_HTTP_TYPE,SERVER_API_DOMAIN} from '@/utils/config'
 
   export default {
     name: 'dashboard_index',
@@ -151,7 +152,10 @@
             _this.bannerHeight = _this.$refs.bannerHeight[0].height
           })
         }
-      }
+      },
+      imageArticle(imageUrl) {
+        return SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
+      },
     }
   }
 </script>

+ 9 - 6
frontendEle/src/views/shop/index.vue

@@ -81,12 +81,12 @@
 </template>
 
 <script>
-    import network from '@/utils/network'
-    import baseInfo from '@/utils/baseInfo'
-    import store from '@/utils/vuexStore'
-    import tool from '@/utils/tool'
-    import Pagination from '@/components/Pagination'
-    export default {
+import network from '@/utils/network'
+import tool from '@/utils/tool'
+import {SERVER_API_DOMAIN, SERVER_API_HTTP_TYPE} from '@/utils/config'
+import Pagination from '@/components/Pagination'
+
+export default {
         name: "index",
         components: {Pagination},
         mounted() {
@@ -277,6 +277,9 @@
                                     break;
                                 }
                             }
+                            if (obj.tableData[i].COVER.indexOf('/') === -1) {
+                              obj.tableData[i].COVER = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + obj.tableData[i].COVER
+                            }
                         }
                         obj.selectLock = false;
                     })

+ 2 - 2
frontendEle/src/views/user/id-card.vue_bak

@@ -61,7 +61,7 @@
             handleSuccess(response, file){
                 if(response.success){
                     this.$message({
-                        message: '上传成功',
+                        message: 'Successful',
                         type: 'success'
                     });
                     this.imageUrl = URL.createObjectURL(file.raw);
@@ -119,4 +119,4 @@
         height: 320px;
         display: block;
     }
-</style>
+</style>