提交 92c3237d 编写于 作者: yma16's avatar yma16

fix:打包路径修改myblog_static

上级 17ecc436
...@@ -57,10 +57,10 @@ const devWebpackConfig = merge(baseWebpackConfig, { ...@@ -57,10 +57,10 @@ const devWebpackConfig = merge(baseWebpackConfig, {
template: 'index.html', template: 'index.html',
inject: true inject: true
}), }),
// copy custom static assets // copy custom myblog_static assets
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ {
from: path.resolve(__dirname, '../static'), from: path.resolve(__dirname, '../myblog_static'),
to: config.dev.assetsSubDirectory, to: config.dev.assetsSubDirectory,
ignore: ['.*'] ignore: ['.*']
} }
......
...@@ -48,7 +48,7 @@ const webpackConfig = merge(baseWebpackConfig, { ...@@ -48,7 +48,7 @@ const webpackConfig = merge(baseWebpackConfig, {
filename: utils.assetsPath('css/[name].[contenthash].css'), filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks. // Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true, allChunks: true,
}), }),
...@@ -112,10 +112,10 @@ const webpackConfig = merge(baseWebpackConfig, { ...@@ -112,10 +112,10 @@ const webpackConfig = merge(baseWebpackConfig, {
minChunks: 3 minChunks: 3
}), }),
// copy custom static assets // copy custom myblog_static assets
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ {
from: path.resolve(__dirname, '../static'), from: path.resolve(__dirname, '../myblog_static'),
to: config.build.assetsSubDirectory, to: config.build.assetsSubDirectory,
ignore: ['.*'] ignore: ['.*']
} }
......
...@@ -7,7 +7,7 @@ const path = require("path"); ...@@ -7,7 +7,7 @@ const path = require("path");
module.exports = { module.exports = {
dev: { dev: {
// Paths // Paths
assetsSubDirectory: "static", assetsSubDirectory: "myblog_static",
assetsPublicPath: "/", assetsPublicPath: "/",
proxyTable: { proxyTable: {
"/api/": { "/api/": {
...@@ -78,8 +78,8 @@ module.exports = { ...@@ -78,8 +78,8 @@ module.exports = {
// https://webpack.js.org/configuration/devtool/#production // https://webpack.js.org/configuration/devtool/#production
devtool: "#source-map", devtool: "#source-map",
// Gzip off by default as many popular static hosts such as // Gzip off by default as many popular myblog_static hosts such as
// Surge or Netlify already gzip all static assets for you. // Surge or Netlify already gzip all myblog_static assets for you.
// Before setting to `true`, make sure to: // Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin // npm install --save-dev compression-webpack-plugin
productionGzip: false, productionGzip: false,
......
...@@ -6,16 +6,16 @@ ...@@ -6,16 +6,16 @@
<title>yma16前端日记</title> <title>yma16前端日记</title>
<link <link
rel="shortcut icon" rel="shortcut icon"
href="./static/utils/fx_background/image/logo.ico" href="myblog_static/utils/fx_background/image/logo.ico"
/> />
<!-- up --> <!-- up -->
<script src="./static/utils/fx_background/js/jquery-2.1.4.min.js"></script> <script src="myblog_static/utils/fx_background/js/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="./static/utils/fx_background/css/core.css" /> <link rel="stylesheet" href="myblog_static/utils/fx_background/css/core.css" />
<!-- 我的阿里图标库 --> <!-- 我的阿里图标库 -->
<script src="http://at.alicdn.com/t/font_1957918_9kt1mmflyr8.js"></script> <script src="http://at.alicdn.com/t/font_1957918_9kt1mmflyr8.js"></script>
<style> <style>
body { body {
background: url(./static/utils/fx_background/image/background.png); background: url(myblog_static/utils/fx_background/image/background.png);
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
overflow: hidden; overflow: hidden;
......
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
q.setAttribute("className", "t"), q.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>", d = q.getElementsByTagName("*"), e = q.getElementsByTagName("a")[0]; if (!d || !d.length || !e) return {}; q.setAttribute("className", "t"), q.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>", d = q.getElementsByTagName("*"), e = q.getElementsByTagName("a")[0]; if (!d || !d.length || !e) return {};
g = c.createElement("select"), h = g.appendChild(c.createElement("option")), i = q.getElementsByTagName("input")[0], b = { leadingWhitespace: q.firstChild.nodeType === 3, tbody: !q.getElementsByTagName("tbody").length, htmlSerialize: !!q.getElementsByTagName("link").length, style: /top/.test(e.getAttribute("style")), hrefNormalized: e.getAttribute("href") === "/a", opacity: /^0.55/.test(e.style.opacity), cssFloat: !!e.style.cssFloat, checkOn: i.value === "on", optSelected: h.selected, getSetAttribute: q.className !== "t", enctype: !!c.createElement("form").enctype, html5Clone: c.createElement("nav").cloneNode(!0).outerHTML !== "<:nav></:nav>", submitBubbles: !0, changeBubbles: !0, focusinBubbles: !1, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0 }, i.checked = !0, b.noCloneChecked = i.cloneNode(!0).checked, g.disabled = !0, b.optDisabled = !h.disabled; try { delete q.test } catch (s) { b.deleteExpando = !1 }!q.addEventListener && q.attachEvent && q.fireEvent && (q.attachEvent("onclick", function() { b.noCloneEvent = !1 }), q.cloneNode(!0).fireEvent("onclick")), i = c.createElement("input"), i.value = "t", i.setAttribute("type", "radio"), b.radioValue = i.value === "t", i.setAttribute("checked", "checked"), q.appendChild(i), k = c.createDocumentFragment(), k.appendChild(q.lastChild), b.checkClone = k.cloneNode(!0).cloneNode(!0).lastChild.checked, b.appendChecked = i.checked, k.removeChild(i), k.appendChild(q), q.innerHTML = "", a.getComputedStyle && (j = c.createElement("div"), j.style.width = "0", j.style.marginRight = "0", q.style.width = "2px", q.appendChild(j), b.reliableMarginRight = (parseInt((a.getComputedStyle(j, null) || { marginRight: 0 }).marginRight, 10) || 0) === 0); if (q.attachEvent) g = c.createElement("select"), h = g.appendChild(c.createElement("option")), i = q.getElementsByTagName("input")[0], b = { leadingWhitespace: q.firstChild.nodeType === 3, tbody: !q.getElementsByTagName("tbody").length, htmlSerialize: !!q.getElementsByTagName("link").length, style: /top/.test(e.getAttribute("style")), hrefNormalized: e.getAttribute("href") === "/a", opacity: /^0.55/.test(e.style.opacity), cssFloat: !!e.style.cssFloat, checkOn: i.value === "on", optSelected: h.selected, getSetAttribute: q.className !== "t", enctype: !!c.createElement("form").enctype, html5Clone: c.createElement("nav").cloneNode(!0).outerHTML !== "<:nav></:nav>", submitBubbles: !0, changeBubbles: !0, focusinBubbles: !1, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0 }, i.checked = !0, b.noCloneChecked = i.cloneNode(!0).checked, g.disabled = !0, b.optDisabled = !h.disabled; try { delete q.test } catch (s) { b.deleteExpando = !1 }!q.addEventListener && q.attachEvent && q.fireEvent && (q.attachEvent("onclick", function() { b.noCloneEvent = !1 }), q.cloneNode(!0).fireEvent("onclick")), i = c.createElement("input"), i.value = "t", i.setAttribute("type", "radio"), b.radioValue = i.value === "t", i.setAttribute("checked", "checked"), q.appendChild(i), k = c.createDocumentFragment(), k.appendChild(q.lastChild), b.checkClone = k.cloneNode(!0).cloneNode(!0).lastChild.checked, b.appendChecked = i.checked, k.removeChild(i), k.appendChild(q), q.innerHTML = "", a.getComputedStyle && (j = c.createElement("div"), j.style.width = "0", j.style.marginRight = "0", q.style.width = "2px", q.appendChild(j), b.reliableMarginRight = (parseInt((a.getComputedStyle(j, null) || { marginRight: 0 }).marginRight, 10) || 0) === 0); if (q.attachEvent)
for (o in { submit: 1, change: 1, focusin: 1 }) n = "on" + o, p = n in q, p || (q.setAttribute(n, "return;"), p = typeof q[n] == "function"), b[o + "Bubbles"] = p; for (o in { submit: 1, change: 1, focusin: 1 }) n = "on" + o, p = n in q, p || (q.setAttribute(n, "return;"), p = typeof q[n] == "function"), b[o + "Bubbles"] = p;
k.removeChild(q), k = g = h = j = q = i = null, f(function() { var a, d, e, g, h, i, j, k, m, n, o, r = c.getElementsByTagName("body")[0];!r || (j = 1, k = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;", m = "visibility:hidden;border:0;", n = "style='" + k + "border:5px solid #000;padding:0;'", o = "<div " + n + "><div></div></div>" + "<table " + n + " cellpadding='0' cellspacing='0'>" + "<tr><td></td></tr></table>", a = c.createElement("div"), a.style.cssText = m + "width:0;height:0;position:static;top:0;margin-top:" + j + "px", r.insertBefore(a, r.firstChild), q = c.createElement("div"), a.appendChild(q), q.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>", l = q.getElementsByTagName("td"), p = l[0].offsetHeight === 0, l[0].style.display = "", l[1].style.display = "none", b.reliableHiddenOffsets = p && l[0].offsetHeight === 0, q.innerHTML = "", q.style.width = q.style.paddingLeft = "1px", f.boxModel = b.boxModel = q.offsetWidth === 2, typeof q.style.zoom != "undefined" && (q.style.display = "inline", q.style.zoom = 1, b.inlineBlockNeedsLayout = q.offsetWidth === 2, q.style.display = "", q.innerHTML = "<div style='width:4px;'></div>", b.shrinkWrapBlocks = q.offsetWidth !== 2), q.style.cssText = k + m, q.innerHTML = o, d = q.firstChild, e = d.firstChild, h = d.nextSibling.firstChild.firstChild, i = { doesNotAddBorder: e.offsetTop !== 5, doesAddBorderForTableAndCells: h.offsetTop === 5 }, e.style.position = "fixed", e.style.top = "20px", i.fixedPosition = e.offsetTop === 20 || e.offsetTop === 15, e.style.position = e.style.top = "", d.style.overflow = "hidden", d.style.position = "relative", i.subtractsBorderForOverflowNotVisible = e.offsetTop === -5, i.doesNotIncludeMarginInBodyOffset = r.offsetTop !== j, r.removeChild(a), q = a = null, f.extend(b, i)) }); return b }(); k.removeChild(q), k = g = h = j = q = i = null, f(function() { var a, d, e, g, h, i, j, k, m, n, o, r = c.getElementsByTagName("body")[0];!r || (j = 1, k = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;", m = "visibility:hidden;border:0;", n = "style='" + k + "border:5px solid #000;padding:0;'", o = "<div " + n + "><div></div></div>" + "<table " + n + " cellpadding='0' cellspacing='0'>" + "<tr><td></td></tr></table>", a = c.createElement("div"), a.style.cssText = m + "width:0;height:0;position:myblog_static;top:0;margin-top:" + j + "px", r.insertBefore(a, r.firstChild), q = c.createElement("div"), a.appendChild(q), q.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>", l = q.getElementsByTagName("td"), p = l[0].offsetHeight === 0, l[0].style.display = "", l[1].style.display = "none", b.reliableHiddenOffsets = p && l[0].offsetHeight === 0, q.innerHTML = "", q.style.width = q.style.paddingLeft = "1px", f.boxModel = b.boxModel = q.offsetWidth === 2, typeof q.style.zoom != "undefined" && (q.style.display = "inline", q.style.zoom = 1, b.inlineBlockNeedsLayout = q.offsetWidth === 2, q.style.display = "", q.innerHTML = "<div style='width:4px;'></div>", b.shrinkWrapBlocks = q.offsetWidth !== 2), q.style.cssText = k + m, q.innerHTML = o, d = q.firstChild, e = d.firstChild, h = d.nextSibling.firstChild.firstChild, i = { doesNotAddBorder: e.offsetTop !== 5, doesAddBorderForTableAndCells: h.offsetTop === 5 }, e.style.position = "fixed", e.style.top = "20px", i.fixedPosition = e.offsetTop === 20 || e.offsetTop === 15, e.style.position = e.style.top = "", d.style.overflow = "hidden", d.style.position = "relative", i.subtractsBorderForOverflowNotVisible = e.offsetTop === -5, i.doesNotIncludeMarginInBodyOffset = r.offsetTop !== j, r.removeChild(a), q = a = null, f.extend(b, i)) }); return b }();
var j = /^(?:\{.*\}|\[.*\])$/, var j = /^(?:\{.*\}|\[.*\])$/,
k = /([A-Z])/g; k = /([A-Z])/g;
f.extend({ cache: {}, uuid: 0, expando: "jQuery" + (f.fn.jquery + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function(a) { a = a.nodeType ? f.cache[a[f.expando]] : a[f.expando]; return !!a && !m(a) }, data: function(a, c, d, e) { if (!!f.acceptData(a)) { var g, h, i, j = f.expando, f.extend({ cache: {}, uuid: 0, expando: "jQuery" + (f.fn.jquery + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function(a) { a = a.nodeType ? f.cache[a[f.expando]] : a[f.expando]; return !!a && !m(a) }, data: function(a, c, d, e) { if (!!f.acceptData(a)) { var g, h, i, j = f.expando,
...@@ -835,4 +835,4 @@ ...@@ -835,4 +835,4 @@
c[d](a.call(this, b, c[d]())) }); if (f.isWindow(e)) { var g = e.document.documentElement["client" + c], c[d](a.call(this, b, c[d]())) }); if (f.isWindow(e)) { var g = e.document.documentElement["client" + c],
h = e.document.body; return e.document.compatMode === "CSS1Compat" && g || h && h["client" + c] || g } if (e.nodeType === 9) return Math.max(e.documentElement["client" + c], e.body["scroll" + c], e.documentElement["scroll" + c], e.body["offset" + c], e.documentElement["offset" + c]); if (a === b) { var i = f.css(e, d), h = e.document.body; return e.document.compatMode === "CSS1Compat" && g || h && h["client" + c] || g } if (e.nodeType === 9) return Math.max(e.documentElement["client" + c], e.body["scroll" + c], e.documentElement["scroll" + c], e.body["offset" + c], e.documentElement["offset" + c]); if (a === b) { var i = f.css(e, d),
j = parseFloat(i); return f.isNumeric(j) ? j : i } return this.css(d, typeof a == "string" ? a : a + "px") } }), a.jQuery = a.$ = f, typeof define == "function" && define.amd && define.amd.jQuery && define("jquery", [], function() { return f }) j = parseFloat(i); return f.isNumeric(j) ? j : i } return this.css(d, typeof a == "string" ? a : a + "px") } }), a.jQuery = a.$ = f, typeof define == "function" && define.amd && define.amd.jQuery && define("jquery", [], function() { return f })
})(window); })(window);
\ No newline at end of file
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
<el-submenu index="1-1"> <el-submenu index="1-1">
<template slot="title">yma16</template> <template slot="title">yma16</template>
<el-menu-item index="1-1-1">stay hungry</el-menu-item> <el-menu-item index="1-1-1">stay hungry</el-menu-item>
<a @click="toecharts"> <a @click="jumpToEcharts">
<el-menu-item index="1-1-2">echarts</el-menu-item> <el-menu-item index="1-1-2">echarts</el-menu-item>
</a> </a>
<a @click="toadmin"> <a @click="jumpToAdmin">
<el-menu-item index="1-1-3">superuser</el-menu-item> <el-menu-item index="1-1-3">superuser</el-menu-item>
</a> </a>
</el-submenu> </el-submenu>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<el-submenu index="3"> <el-submenu index="3">
<template slot="title"> <template slot="title">
<i class="el-icon-chat-line-round" :click="onlinewebsocket"></i <i class="el-icon-chat-line-round" :click="onlineWebsocket"></i
>线上聊天</template >线上聊天</template
> >
</el-submenu> </el-submenu>
...@@ -125,163 +125,157 @@ ...@@ -125,163 +125,157 @@
</el-footer> </el-footer>
</el-container> </el-container>
</el-container> </el-container>
<!-- <img src="./assets/logo.png"> -->
</div> </div>
</template> </template>
<script> <script>
import axios from "axios";
export default { export default {
name: "App", name: 'App',
data() { data () {
return { return {
authSlogan: "yma16", authSlogan: 'yma16',
chat_flag: false, chat_flag: false,
msg: "yma16", msg: 'yma16',
navigate_flag: true, navigate_flag: true,
value: new Date(), value: new Date(),
baseurl: "/api/", baseUrl: '/api/',
// baseurl: 'http://yongma16.xyz/', src: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
src: "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg", url: '/image/logo/logo.jpg',
url: "/image/logo/logo.jpg",
srcList: [ srcList: [
"https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg", 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
"https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg", 'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
], ],
headerData: ["从现在开始,种一棵树", "从现在开始,种一棵树"], headerData: ['从现在开始,种一棵树', '从现在开始,种一棵树'],
readCount: 0, readCount: 0
}; }
}, },
mounted() { mounted () {
this.addReadCountFun(); this.addReadCountFun()
this.readCountFun(); this.readCountFun()
}, },
methods: { methods: {
jumpIpDns: function () { jumpIpDns: function () {
try { try {
window.open("https://beian.miit.gov.cn"); window.open('https://beian.miit.gov.cn')
} catch (r) { } catch (r) {
window.location.href = "https://beian.miit.gov.cn"; window.location.href = 'https://beian.miit.gov.cn'
throw Error(r); throw Error(r)
} }
}, },
addReadCountFun: function () { addReadCountFun: function () {
console.log("addfun"); const that = this
let clientip = "未知"; let clientIp = '未知'
try { try {
console.log("ip待定"); console.log('ip待定')
} catch (e) { } catch (e) {
console.log(e); console.log(e)
} }
console.log("最终ip", clientip); that.$axios
axios .post(this.baseUrl + 'count/add/', {
.post(this.baseurl + "count/add/", { ip: clientIp
ip: clientip,
}) })
.then((res) => { .then((res) => {
console.log(res); console.log(res)
}) })
.catch((e) => { .catch((e) => {
console.log(e); throw Error(e)
}); })
}, },
readCountFun: function () { readCountFun: function () {
let that = this; let that = this
axios that.$axios
.get(that.baseurl + "count/get/") .get(that.baseUrl + 'count/get/')
.then((res) => { .then((res) => {
console.log(res, "count"); this.readCount = res.data.num
this.readCount = res.data.num;
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error)
}); })
}, },
changeNavigate: function () { changeNavigate: function () {
this.navigate_flag = !this.navigate_flag; // 取反 this.navigate_flag = !this.navigate_flag // 取反
}, },
handleOpen(key, keyPath) { handleOpen (key, keyPath) {
console.log(key, keyPath); console.log(key, keyPath)
if (key === "3") { if (key === '3') {
console.log("打开3号"); console.log('打开3号')
this.chat_flag = true; this.chat_flag = true
this.onlinewebsocket(); // 调用跳转 this.onlineWebsocket() // 调用跳转
} }
if (key === "2-1") { if (key === '2-1') {
this.chat_flag = false; this.chat_flag = false
this.loginAction(); // 调用跳转 this.loginAction() // 调用跳转
} }
if (key === "2-2") { if (key === '2-2') {
this.chat_flag = false; this.chat_flag = false
this.registerAction(); // 调用跳转 this.registerAction() // 调用跳转
} }
}, },
handleClose(key, keyPath) { handleClose (key, keyPath) {
console.log(key, keyPath); console.info(key, keyPath)
console.log("关闭"); if (key === '3') {
if (key === "3") { this.chat_flag = false
this.chat_flag = false;
} }
}, },
jumpRouter: function (params) { jumpRouter: function (params) {
this.$router this.$router
.push({ .push({
name: `${params}`, name: `${params}`
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error)
}); })
}, },
onlinewebsocket: function () { onlineWebsocket: function () {
// console.log(this.$router); // console.log(this.$router);
this.$router this.$router
.push({ .push({
path: "/onlinewebsocket", path: '/onlinewebsocket'
}) })
.catch((error) => { .catch((error) => {
console.log(error); throw Error(error)
}); })
}, },
toecharts: function () { jumpToEcharts: function () {
// console.log(this.$router); // console.log(this.$router);
this.$router this.$router
.push({ .push({
path: "/bilicom", path: '/bilicom'
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error)
}); })
}, },
toadmin: function () { jumpToAdmin: function () {
this.$router this.$router
.push({ .push({
path: "/mavoneditor", path: '/mavoneditor'
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error)
}); })
}, },
loginAction: function () { loginAction: function () {
this.$router this.$router
.push({ .push({
path: "/login", path: '/login'
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error)
}); })
}, },
registerAction: function () { registerAction: function () {
this.$router this.$router
.push({ .push({
path: "/register", path: '/register'
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error)
}); })
}, }
}, }
}; }
</script> </script>
<style> <style>
...@@ -293,7 +287,7 @@ body, ...@@ -293,7 +287,7 @@ body,
padding: 0%; padding: 0%;
border: 0px; border: 0px;
height: 100%; height: 100%;
/* background: url(../static/utils/fx_background/image/gg.jpg) center top no-repeat; */ /* background: url(../myblog_static/utils/fx_background/image/gg.jpg) center top no-repeat; */
/* background: url(/image/snow/gg.jpg) center top no-repeat; */ /* background: url(/image/snow/gg.jpg) center top no-repeat; */
} }
...@@ -352,7 +346,7 @@ body { ...@@ -352,7 +346,7 @@ body {
/* background-color: #e9eef3; */ /* background-color: #e9eef3; */
text-align: left; text-align: left;
opacity: 1; opacity: 1;
/* background: url(../static/utils/fx_background/image/gg.jpg) center top no-repeat; */ /* background: url(../myblog_static/utils/fx_background/image/gg.jpg) center top no-repeat; */
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<!-- <el-card class="weather_class2" <!-- <el-card class="weather_class2"
cellpadding="1px" cellpadding="1px"
shadow="always" shadow="always"
style="position: static; margin-top: 2%" style="position: myblog_static; margin-top: 2%"
> >
</el-card> --> </el-card> -->
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
// scene.add(cube); // scene.add(cube);
const gltfLoader = new GLTFLoader() const gltfLoader = new GLTFLoader()
gltfLoader.load( gltfLoader.load(
'/static/utils/fx_background/model/glb/snow.glb', '/myblog_static/utils/fx_background/model/glb/snow.glb',
function (gltf) { function (gltf) {
console.log(gltf) console.log(gltf)
scene.add(gltf.scene) scene.add(gltf.scene)
......
...@@ -705,7 +705,7 @@ export default { ...@@ -705,7 +705,7 @@ export default {
} }
.input_chat1 { .input_chat1 {
/* position: static; */ /* position: myblog_static; */
margin-top: 5%; margin-top: 5%;
text-align: letf; text-align: letf;
line-height: 50px; line-height: 50px;
...@@ -713,7 +713,7 @@ export default { ...@@ -713,7 +713,7 @@ export default {
} }
.input_chat2 { .input_chat2 {
/* position: static; */ /* position: myblog_static; */
margin-top: 5%; margin-top: 5%;
text-align: letf; text-align: letf;
line-height: 50px; line-height: 50px;
...@@ -859,7 +859,7 @@ export default { ...@@ -859,7 +859,7 @@ export default {
} }
.input_chat2 { .input_chat2 {
/* position: static; */ /* position: myblog_static; */
margin-top: 5%; margin-top: 5%;
width: 100%; width: 100%;
text-align: letf; text-align: letf;
......
"use strict"; 'use strict'
import Vue from 'vue'; import Vue from 'vue'
import axios from "axios"; import axios from 'axios'
// Full config: https://github.com/axios/axios#request-config // Full config: https://github.com/axios/axios#request-config
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || ''; // axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
...@@ -12,50 +12,50 @@ let config = { ...@@ -12,50 +12,50 @@ let config = {
// baseURL: process.env.baseURL || process.env.apiUrl || "" // baseURL: process.env.baseURL || process.env.apiUrl || ""
// timeout: 60 * 1000, // Timeout // timeout: 60 * 1000, // Timeout
// withCredentials: true, // Check cross-site Access-Control // withCredentials: true, // Check cross-site Access-Control
}; }
const _axios = axios.create(config); const _axios = axios.create(config)
_axios.interceptors.request.use( _axios.interceptors.request.use(
function(config) { function (config) {
// Do something before request is sent // Do something before request is sent
return config; return config
}, },
function(error) { function (error) {
// Do something with request error // Do something with request error
return Promise.reject(error); return Promise.reject(error)
} }
); )
// Add a response interceptor // Add a response interceptor
_axios.interceptors.response.use( _axios.interceptors.response.use(
function(response) { function (response) {
// Do something with response data // Do something with response data
return response; return response
}, },
function(error) { function (error) {
// Do something with response error // Do something with response error
return Promise.reject(error); return Promise.reject(error)
} }
); )
Plugin.install = function(Vue, options) { Plugin.install = function (Vue, options) {
Vue.axios = _axios; Vue.axios = _axios
window.axios = _axios; window.axios = _axios
Object.defineProperties(Vue.prototype, { Object.defineProperties(Vue.prototype, {
axios: { axios: {
get() { get () {
return _axios; return _axios
} }
}, },
$axios: { $axios: {
get() { get () {
return _axios; return _axios
} }
}, }
}); })
}; }
Vue.use(Plugin) Vue.use(Plugin)
export default Plugin; export default Plugin
...@@ -4,7 +4,7 @@ import Nprogress from 'nprogress' ...@@ -4,7 +4,7 @@ import Nprogress from 'nprogress'
import 'nprogress/nprogress.css' import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import { isEmpty } from '@/utils' import { isEmpty } from '@/utils'
import VueRouter from "vue-router" import VueRouter from 'vue-router'
// import Router from 'vue-router' // import Router from 'vue-router'
import store from '@/store' import store from '@/store'
// store // store
...@@ -20,148 +20,147 @@ import Loading from '@/components/Loading' ...@@ -20,148 +20,147 @@ import Loading from '@/components/Loading'
import GrilShow from '@/components/GrilShow' import GrilShow from '@/components/GrilShow'
import Csslearn from '@/components/Csslearn' import Csslearn from '@/components/Csslearn'
Vue.use(VueRouter) Vue.use(VueRouter)
const defaultRoutes = [{ const defaultRoutes = [
{
path: '/', path: '/',
name: 'Article', name: 'Article',
component: Article component: Article
}, },
{ {
path: '/login', path: '/login',
name: 'Login', name: 'Login',
component: Login component: Login
}, },
{ {
path: '/register', path: '/register',
name: 'Register', name: 'Register',
component: Register component: Register
}, },
{ {
path: '/home', path: '/home',
name: 'Home', name: 'Home',
component: Home component: Home
}, },
{ {
path: '/onlinewebsocket', path: '/onlinewebsocket',
name: 'Onlinewebsocket', name: 'Onlinewebsocket',
component: Onlinewebsocket component: Onlinewebsocket
}, },
{ {
path: '/bilicom', path: '/bilicom',
name: 'Bilicom', name: 'Bilicom',
component: Bilicom component: Bilicom
}, },
{ {
path: '/mavoneditor', path: '/mavoneditor',
name: 'Mavoneditor', name: 'Mavoneditor',
component: Mavoneditor component: Mavoneditor
}, },
{ {
path: '/loading', path: '/loading',
name: 'loading', name: 'loading',
component: Loading component: Loading
}, },
{ {
path: '/gril', path: '/gril',
name: 'grilshow', name: 'grilshow',
component: GrilShow component: GrilShow
}, },
{ {
path: '/css', path: '/css',
name: 'css', name: 'css',
component: Csslearn component: Csslearn
} }
// { // {
// path: '/register', // path: '/register',
// name: 'Register', // name: 'Register',
// component: () => // component: () =>
// import ('../components/Register.vue') // import ('../components/Register.vue')
// }, // },
// { // {
// path: '/home', // path: '/home',
// name: 'Home', // name: 'Home',
// component: () => // component: () =>
// import ('../components/Home.vue') // import ('../components/Home.vue')
// }, // },
// { // {
// path: '/onlinewebsocket', // path: '/onlinewebsocket',
// name: 'Onlinewebsocket', // name: 'Onlinewebsocket',
// component: () => // component: () =>
// import ('../components/Onlinewebsocket.vue') // import ('../components/Onlinewebsocket.vue')
// }, // },
// { // {
// path: '/mavoneditor', // path: '/mavoneditor',
// name: 'Mavoneditor', // name: 'Mavoneditor',
// component: () => // component: () =>
// import ('../components/Mavoneditor.vue') // import ('../components/Mavoneditor.vue')
// }, // },
// { // {
// path: '/bilicom', // path: '/bilicom',
// name: 'Bilicom', // name: 'Bilicom',
// component: () => // component: () =>
// import ('../components/Bilicom.vue') // import ('../components/Bilicom.vue')
// } // }
] ]
let routes = [...defaultRoutes, let routes = [
// ...modulesRoutes, ...defaultRoutes
// ...errorRoutes, // ...modulesRoutes,
// ...dashboardRouters // ...errorRoutes,
]; // ...dashboardRouters
const originalPush = VueRouter.prototype.push; ]
VueRouter.prototype.push = function push(location) { const originalPush = VueRouter.prototype.push
return originalPush.call(this, location).catch((err) => err); VueRouter.prototype.push = function push (location) {
}; return originalPush.call(this, location).catch((err) => err)
}
const router = new VueRouter({ const router = new VueRouter({
routes routes
}); })
const whiteList = ["/login"]; const whiteList = ['/login']
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
// Nprogress.start() // Nprogress.start()
// next() // next()
// let hasToken = getToken() // let hasToken = getToken()
next() next()
console.log('localStorage', localStorage) console.log('localStorage', localStorage)
let name = localStorage.getItem("yma16siteUserInfoName") let name = localStorage.getItem('yma16siteUserInfoName')
let pwd = localStorage.getItem("yma16siteUserInfoPwd") let pwd = localStorage.getItem('yma16siteUserInfoPwd')
let hasToken = { let hasToken = {
name: name, name: name,
password: pwd password: pwd
}
console.log('hasToken', hasToken)
console.log('store.state 初始化', store.state)
if (hasToken.name && hasToken.password) {
console.log('store.state.user 存在', store.state.user)
if (isEmpty(store.state.user.userInfo)) {
// 空的 modules下的user
console.log('路由的登录认证')
// 用户自主登录
await store.dispatch('user/loginUserInfo', hasToken)
// await store.dispatch('user/loginUserInfo', hasToken)
next()
} else {
next()
} }
console.log('hasToken', hasToken) } else {
console.log('store.state 初始化', store.state) if (whiteList.indexOf(to.path) !== -1) {
if (hasToken.name&&hasToken.password) { console.log('store.state', store.state)
console.log('store.state.user 存在', store.state.user) next()
if (isEmpty(store.state.user.userInfo)) {
// 空的 modules下的user
console.log('路由的登录认证')
// 用户自主登录
await store.dispatch('user/loginUserInfo', hasToken)
// await store.dispatch('user/loginUserInfo', hasToken)
next()
} else {
next()
}
} else { } else {
if (whiteList.indexOf(to.path) !== -1) { console.log('store.state 通过', store.state)
console.log('store.state', store.state) next()
next() // next({ path: '/login' }) // 否则全部重定向到登录页
} else { // Nprogress.done();
console.log('store.state 通过', store.state)
next()
// next({ path: '/login' }) // 否则全部重定向到登录页
// Nprogress.done();
}
} }
}
}); })
router.afterEach((to, from) => { router.afterEach((to, from) => {
Nprogress.done() Nprogress.done()
}) })
export default router; export default router
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册