master
toesbieya 6 years ago
parent f5cc749772
commit 5cf96cb347
  1. 3
      vue/src/components/TinymceEditor/index.vue
  2. 3
      vue/src/components/UploadFile/index.vue
  3. 3
      vue/src/plugin/canvasAnimation/particleBall/index.js
  4. 3
      vue/src/plugin/imageCompress/cjpeg.js
  5. 3
      vue/src/plugin/imageCompress/pngquant.js
  6. 6
      vue/src/utils/browser.js
  7. 4
      vue/src/views/example/cool/l2d.vue

@ -9,11 +9,10 @@
<script>
import {waitUntilSuccess} from "@/utils"
import {elError} from "@/utils/message"
import {getContextPath} from "@/utils/browser"
const DEFAULT_OPTIONS = {
language: 'zh_CN',
language_url: `${getContextPath()}static/tinymce/langs/zh_CN.js`,
language_url: `${process.env.BASE_URL}static/tinymce/langs/zh_CN.js`,
object_resizing: false,
end_container_on_empty_block: true,
default_link_target: '_blank',

@ -62,7 +62,6 @@
import {elError} from "@/utils/message"
import {isImage, isDoc, isPdf, isPpt, isRar, isXls, isTxt, isZip} from "@/utils/validate"
import {preview, deleteUpload, download, upload, autoCompleteUrl} from "@/utils/file"
import {getContextPath} from "@/utils/browser"
const typeMapper = [
{test: isImage}, {test: isDoc, type: 'doc'}, {test: isPdf, type: 'pdf'}, {test: isPpt, type: 'ppt'},
@ -85,7 +84,7 @@
function getCoverImage(url, fileType) {
const mapper = typeMapper.find(({test}) => test(fileType))
return mapper && mapper.type ? `${getContextPath()}static/img/fileType/${mapper.type}.png` : url
return mapper && mapper.type ? `${process.env.BASE_URL}static/img/fileType/${mapper.type}.png` : url
}
export default {

@ -1,5 +1,4 @@
import Particle from "./Particle"
import {getContextPath} from "@/utils/browser"
export default class ParticleBall {
constructor(canvas, {sphereRad = 130, fLen = 300, maxParticle = 400, turnSpeed = 0.005} = {}) {
@ -82,7 +81,7 @@ export default class ParticleBall {
this.dotImageList = []
for (let i = 1; i <= 4; i++) {
const dotImage = new Image()
dotImage.src = `${getContextPath()}static/img/dot${i}.png`
dotImage.src = `${process.env.BASE_URL}static/img/dot${i}.png`
this.dotImageList.push(dotImage)
}
}

@ -1,8 +1,7 @@
import {createWorker} from "@/utils/worker"
import {getContextPath} from "@/utils/browser"
export default function (uint8Array, quality = 75) {
const url = `${getContextPath()}static/js/cjpeg.min.js`
const url = `${process.env.BASE_URL}static/js/cjpeg.min.js`
return new Promise(resolve => {
let worker = createWorker(handler, {url, data: uint8Array, quality}, ({data}) => {
resolve(data)

@ -1,8 +1,7 @@
import {createWorker} from "@/utils/worker"
import {getContextPath} from "@/utils/browser"
export default function (uint8Array, quality = 75, speed = 4) {
const url = `${getContextPath()}static/js/pngquant.min.js`
const url = `${process.env.BASE_URL}static/js/pngquant.min.js`
return new Promise(resolve => {
let worker = createWorker(handler, {url, data: uint8Array, quality, speed}, ({data}) => {
resolve(data)

@ -37,12 +37,6 @@ export function getElementHeight(ele, style) {
return height
}
//获取项目部署的绝对路径
export function getContextPath() {
const {protocol, host} = document.location
return `${protocol}//${host}${process.env.BASE_URL}`
}
/**
* 加载js或css
*

@ -9,7 +9,7 @@
</template>
<script>
import {getContextPath, loadExternalResource} from "@/utils/browser"
import {loadExternalResource} from "@/utils/browser"
export default {
name: "l2d",
@ -17,7 +17,7 @@
data: () => ({l2d: null}),
mounted() {
const path = `${getContextPath()}static/live2d/`
const path = `${process.env.BASE_URL}static/live2d/`
Promise.all([
import('@/plugin/live2d'),

Loading…
Cancel
Save