Skip to content

Commit

Permalink
build: fix default cover url on development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rocka committed Aug 3, 2023
1 parent b515af2 commit 92de983
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 0 additions & 5 deletions script/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ const compileCfg = require('./webpack.config.renderer');

/** @type {import('webpack-dev-server').Configuration} */
const wdsConf = {
static: {
// serve '/login/html'
directory: absPath('/src/renderer'),
publicPath: '/',
},
hot: true,
liveReload: false,
port: config.devPort,
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/util/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
*/
export function sizeImg(url, width, height = width) {
if (!url) return '';
if (process.env.NODE_ENV === 'development') {
if (url.startsWith('http://localhost:')) {
return url;
}
}
if (url.startsWith('http:')) url = 'https' + url.slice(4);
return `${url}?param=${width.toFixed(0)}y${height.toFixed(0)}`;
}
Expand Down

0 comments on commit 92de983

Please sign in to comment.