소스 검색

fixed ossUploader bug

jinxyang 5 년 전
부모
커밋
4ac6d5ef5c
4개의 변경된 파일1개의 추가작업 그리고 156개의 파일을 삭제
  1. 0 16
      scripts1/config.js
  2. 0 27
      scripts1/server.js
  3. 0 113
      scripts1/webpack/dev.js
  4. 1 0
      src/components/common/ossUploader/uploader.vue

+ 0 - 16
scripts1/config.js

@@ -1,16 +0,0 @@
-
-const path = require('path')
-
-module.exports = {
-  port: 9527,
-  template: path.resolve(__dirname, '../src/index.html'),
-  dev: {
-    publicPath: '/',
-    env: {
-      NODE_ENV: '"dev"',
-      API_URL: {
-        default: '"http://192.168.23.111:9900"',
-      },
-    },
-  },
-}

+ 0 - 27
scripts1/server.js

@@ -1,27 +0,0 @@
-
-const chalk = require('chalk')
-const express = require('express')
-const webpack = require('webpack')
-const history = require('connect-history-api-fallback')
-const webpackDevMiddleware = require('webpack-dev-middleware')
-const webpackHotMiddleware = require('webpack-hot-middleware')
-const config = require('./config')
-const webpackConfig = require('./webpack/dev')
-
-const app = express()
-const compiler = webpack(webpackConfig)
-
-app.use(history())
-app.use(webpackDevMiddleware(compiler, {
-  logLevel: 'silent',
-  publicPath: webpackConfig.output.publicPath,
-}))
-
-app.use(webpackHotMiddleware(compiler, {
-  log: false,
-  path: '/__what',
-  heartbeat: 5000,
-}))
-
-console.log(chalk.cyan('Starting the development server...\n'))
-app.listen(config.port)

+ 0 - 113
scripts1/webpack/dev.js

@@ -1,113 +0,0 @@
-
-const path = require('path')
-const ip = require('ip')
-const webpack = require('webpack')
-const HtmlWebpackPlugin = require('html-webpack-plugin')
-const CopyWebpackPlugin = require('copy-webpack-plugin')
-const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin')
-const config = require('../config')
-const clientOptions = '?path=/__what&timeout=5000&reload=true&quiet=true'
-const VueLoaderPlugin = require('vue-loader/lib/plugin')
-
-module.exports = {
-  mode: 'development',
-  entry: [
-    `webpack-hot-middleware/client${clientOptions}`,
-    path.resolve(__dirname, '../../src/index.js'),
-  ],
-  output: {
-    filename: 'bundle.js',
-    publicPath: config.dev.publicPath,
-  },
-  module: {
-    rules: [
-      {
-        test: /\.css$/i,
-        use: [
-          'style-loader',
-          {
-            loader: 'css-loader',
-            options: {
-              importLoaders: 1,
-            },
-          },
-          'postcss-loader',
-        ],
-      },
-      {
-        test: /\.s[ac]ss$/i,
-        use: [
-          'style-loader',
-          {
-            loader: 'css-loader',
-            options: {
-              importLoaders: 2,
-            },
-          },
-          'postcss-loader',
-          'sass-loader',
-        ],
-      },
-      {
-        test: /\.(png|jpe?g|gif|svg)$/i,
-        loader: 'file-loader',
-      },
-      {
-        test: /\.(ttf|otf|woff2?|eot)$/i,
-        loader: 'file-loader',
-      },
-      {
-        test: /\.js$/,
-        enforce: 'pre',
-        exclude: /node_modules/,
-        loader: 'eslint-loader',
-      },
-      {
-        test: /\.js$/,
-        exclude: /node_modules/,
-        loader: 'babel-loader',
-      },
-      {
-        test: /\.vue$/,
-        loader: 'vue-loader',
-      },
-    ],
-  },
-  externals: {
-    vue: 'Vue',
-  },
-  resolve: {
-    extensions: [
-      '.js',
-      '.vue',
-    ],
-    alias: {
-      '@': path.resolve(__dirname, '../../src'),
-    },
-  },
-  devtool: 'inline-source-map',
-  plugins: [
-    new HtmlWebpackPlugin({
-      template: config.template,
-    }),
-    new VueLoaderPlugin(),
-    new webpack.DefinePlugin({
-      'process.env': config.dev.env,
-    }),
-    new webpack.HotModuleReplacementPlugin(),
-    new FriendlyErrorsWebpackPlugin({
-      compilationSuccessInfo: {
-        messages: [
-          `http://localhost:${config.port} or http://${ip.address()}:${config.port}`,
-        ],
-      },
-    }),
-    new CopyWebpackPlugin([
-      {
-        from: path.resolve(__dirname, '../../static'),
-        to: 'static',
-        ignore: ['.*'],
-      },
-    ]),
-  ],
-}

+ 1 - 0
src/components/common/ossUploader/uploader.vue

@@ -123,6 +123,7 @@ export default {
       const images = typeof this.value === 'string' ? [this.value] : this.value
       const files = {}
       images.forEach((url, i) => {
+        if (!url) return
         const split = url.split('.')
         files[i + 1] = {
           id: i + 1,