diff --git a/index.html b/index.html index 66fd4a2..f74a94a 100644 --- a/index.html +++ b/index.html @@ -44,10 +44,10 @@ - - - - + + + +
diff --git a/src/assets/data/goods.js b/src/assets/data/goods.js index 3216eee..dfc4530 100644 --- a/src/assets/data/goods.js +++ b/src/assets/data/goods.js @@ -2,7 +2,7 @@ export default { list: [ { "name": "小米电视6 65\" OLED 65英寸", - "cover": new URL('../img/goods/g6-0.jpg', import.meta.url).href, + "cover": new URL('@/assets/img/goods/g6-0.jpg', import.meta.url).href, imgs:[ new URL('../img/goods/g6-0.jpg', import.meta.url).href, new URL('../img/goods/g6-1.jpg', import.meta.url).href, diff --git a/src/assets/less/index.less b/src/assets/less/index.less index cef1dfd..98aeec1 100644 --- a/src/assets/less/index.less +++ b/src/assets/less/index.less @@ -15,7 +15,7 @@ --footer-height: 56rem; --common-header-height: 50rem; --indicator-height: 43rem; - --padding-page: 15rem; + --page-padding: 15rem; --main-bg: rgb(21, 23, 36); --active-main-bg: rgb(31, 37, 52); --second-text-color: rgb(186, 186, 187); diff --git a/src/config/index.js b/src/config/index.js index 3ccc474..ad5efe8 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -9,7 +9,7 @@ export default { // filePreview:'http://localhost/static/uploads/' } -// export const BASE_URL = 'https://dy.ttentau.top' -export const BASE_URL = '' +export const BASE_URL = 'https://dy.ttentau.top' +// export const BASE_URL = '' export const IMG_URL = BASE_URL + '/imgs/' export const FILE_URL = BASE_URL + '/data/' diff --git a/src/mock/index.js b/src/mock/index.js index a125dfc..7e3a938 100644 --- a/src/mock/index.js +++ b/src/mock/index.js @@ -3,6 +3,7 @@ import globalMethods from '../utils' import resource from "../assets/data/resource.js"; import posts6 from "@/assets/data/posts6.json"; import {uniqueId} from "lodash-es"; +import {BASE_URL} from "@/config"; function getParams(options) { let params = globalMethods.$parseURL(options.url).params @@ -69,7 +70,7 @@ let t = [ // }, function initData() { - fetch('/data/posts.json').then(r => { + fetch(BASE_URL + '/data/posts.json').then(r => { r.json().then(v => { allRecommendVideos = allRecommendVideos.concat(v) allRecommendVideos = allRecommendVideos.map(w => { @@ -81,7 +82,7 @@ function initData() { }) }) - fetch('/data/user-71158770.json').then(r => { + fetch(BASE_URL + '/data/user-71158770.json').then(r => { r.json().then(v => { resource.my = v }) diff --git a/src/utils/index.jsx b/src/utils/index.jsx index a9a03de..2bce3be 100644 --- a/src/utils/index.jsx +++ b/src/utils/index.jsx @@ -257,11 +257,12 @@ const Utils = { // console.log(url) if (!url) return //本地图片 - if (url.includes('img') || url.includes('data:image')) { - return url - } - //网络,全路径图片 - if (url.includes('http')) { + if (url.includes('assets/img') + || url.includes('file://') + || url.includes('data:image') + || url.includes('http') + || url.includes('https') + ) { return url } return Config.filePreview + url @@ -439,18 +440,18 @@ export function _checkImgUrl(url) { // console.log(url) if (!url) return //本地图片 - if (url.includes('data:image')) { + if (url.includes('assets/img') + || url.includes('file://') + || url.includes('data:image') + || url.includes('http') + || url.includes('https') + ) { return url } - //网络,全路径图片 - if (url.includes('http')) { - return url - } else { - return IMG_URL + url - } + return IMG_URL + url } -export function _duration(num){ +export function _duration(num) { return Utils.$duration(num) }