|
@@ -1,36 +1,44 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div id="app" class="bgcolor">
|
|
<div id="app" class="bgcolor">
|
|
|
- <router-view/>
|
|
|
|
|
|
|
+ <router-view />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import watermark from 'watermark-dom'
|
|
|
|
|
|
|
+import watermark from "watermark-dom";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "App",
|
|
name: "App",
|
|
|
- mounted(){
|
|
|
|
|
- setTimeout(()=>{
|
|
|
|
|
|
|
+ created() {
|
|
|
|
|
+ // 是否为移动端
|
|
|
|
|
+ let isMobile = window.navigator.userAgent.match(
|
|
|
|
|
+ /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
|
|
|
+ );
|
|
|
|
|
+ localStorage.setItem("isMobile", !!isMobile);
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
let username = localStorage.getItem("nickName");
|
|
let username = localStorage.getItem("nickName");
|
|
|
- if(username){
|
|
|
|
|
|
|
+ if (username) {
|
|
|
let now = new Date();
|
|
let now = new Date();
|
|
|
let year = now.getFullYear();
|
|
let year = now.getFullYear();
|
|
|
- let month = now.getMonth()+1;
|
|
|
|
|
|
|
+ let month = now.getMonth() + 1;
|
|
|
let day = now.getDate();
|
|
let day = now.getDate();
|
|
|
- month = month<10?'0'+month:month;
|
|
|
|
|
- day = day<10?'0'+day:day;
|
|
|
|
|
- let date = year+'-'+month+'-'+day;
|
|
|
|
|
|
|
+ month = month < 10 ? "0" + month : month;
|
|
|
|
|
+ day = day < 10 ? "0" + day : day;
|
|
|
|
|
+ let date = year + "-" + month + "-" + day;
|
|
|
watermark.load({
|
|
watermark.load({
|
|
|
- watermark_txt: username+'@立邦'+date,watermark_fontsize:'13px',
|
|
|
|
|
- watermark_width:100,
|
|
|
|
|
- watermark_rows:0,
|
|
|
|
|
- watermark_cols:3,
|
|
|
|
|
- watermark_height:50,
|
|
|
|
|
- watermark_x_space:10,
|
|
|
|
|
- watermark_y_space:60,
|
|
|
|
|
- watermark_alpha:0.1,
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ watermark_txt: username + "@立邦" + date,
|
|
|
|
|
+ watermark_fontsize: "13px",
|
|
|
|
|
+ watermark_width: 100,
|
|
|
|
|
+ watermark_rows: 0,
|
|
|
|
|
+ watermark_cols: 3,
|
|
|
|
|
+ watermark_height: 50,
|
|
|
|
|
+ watermark_x_space: 10,
|
|
|
|
|
+ watermark_y_space: 60,
|
|
|
|
|
+ watermark_alpha: 0.1,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- },1000)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
-</script>
|
|
|
|
|
|
|
+</script>
|