ttl 提示
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
NODE_ENV = developement
|
NODE_ENV = developement
|
||||||
VUE_APP_BASE_NAME = developement
|
VUE_APP_BASE_NAME = developement
|
||||||
VUE_APP_BASE_URL = http://localhost:8080
|
VUE_APP_BASE_URL = http://localhost:8080
|
||||||
|
NOTE_MAX_WORDS = 10240
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
NODE_ENV = production
|
NODE_ENV = production
|
||||||
VUE_APP_BASE_NAME = production
|
VUE_APP_BASE_NAME = production
|
||||||
VUE_APP_BASE_URL = https://flagnote.com
|
VUE_APP_BASE_URL = https://flagnote.com
|
||||||
|
NOTE_MAX_WORDS = 10240
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import storage from "@/libs/storage";
|
|||||||
import { md5 } from "@/libs/secret";
|
import { md5 } from "@/libs/secret";
|
||||||
|
|
||||||
const servicePath = process.env.VUE_APP_BASE_URL;
|
const servicePath = process.env.VUE_APP_BASE_URL;
|
||||||
|
const noteMaxWords = parseInt(process.env.NOTE_MAX_WORDS);
|
||||||
|
|
||||||
|
export {
|
||||||
|
noteMaxWords
|
||||||
|
}
|
||||||
|
|
||||||
export function saveNote(noteForm, secret) {
|
export function saveNote(noteForm, secret) {
|
||||||
let storeKey = secret.storeKey;
|
let storeKey = secret.storeKey;
|
||||||
@@ -95,10 +100,10 @@ export function ajaxGet(url) {
|
|||||||
xmlhttp.onreadystatechange = () => {
|
xmlhttp.onreadystatechange = () => {
|
||||||
if (xmlhttp.readyState == 4) {
|
if (xmlhttp.readyState == 4) {
|
||||||
if (xmlhttp.status == 200 || xmlhttp.status == 304) {
|
if (xmlhttp.status == 200 || xmlhttp.status == 304) {
|
||||||
if(xmlhttp.responseText){
|
if (xmlhttp.responseText) {
|
||||||
data = JSON.parse(xmlhttp.responseText);
|
data = JSON.parse(xmlhttp.responseText);
|
||||||
}else{
|
} else {
|
||||||
data ={};
|
data = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const en = {
|
|||||||
content: {
|
content: {
|
||||||
blankTip: "I am Blank.",
|
blankTip: "I am Blank.",
|
||||||
noteTip: "Start writing something...",
|
noteTip: "Start writing something...",
|
||||||
|
deleteTip: "The note will be deleted automatically. ttl:"
|
||||||
},
|
},
|
||||||
button: {
|
button: {
|
||||||
ok: "OK",
|
ok: "OK",
|
||||||
@@ -24,7 +25,7 @@ const en = {
|
|||||||
"100005": "Not Published!",
|
"100005": "Not Published!",
|
||||||
"100006": "Server Unavailable!",
|
"100006": "Server Unavailable!",
|
||||||
"100011": "Empty Note!",
|
"100011": "Empty Note!",
|
||||||
"100012": "Too Large, Beyond 200K!",
|
"100012": "Too Large, Beyond 400K!",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export default en;
|
export default en;
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ const zh = {
|
|||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
blankTip: "空白的内容。",
|
blankTip: "空白的内容。",
|
||||||
noteTip: "开始写下一些东西吧。。。"
|
noteTip: "开始写下一些东西吧。。。",
|
||||||
|
deleteTip: "笔记将被自动删除。剩余时间:"
|
||||||
},
|
},
|
||||||
button: {
|
button: {
|
||||||
ok: "好的",
|
ok: "好的",
|
||||||
@@ -19,12 +20,12 @@ const zh = {
|
|||||||
error: {
|
error: {
|
||||||
"100001": "未知错误!",
|
"100001": "未知错误!",
|
||||||
"100002": "地址有误!",
|
"100002": "地址有误!",
|
||||||
"100003": "内容已删除!",
|
"100003": "笔记已删除!",
|
||||||
"100004": "内容已过期!",
|
"100004": "笔记已过期!",
|
||||||
"100005": "内容未分享!",
|
"100005": "笔记未分享!",
|
||||||
"100006": "服务器不可用!",
|
"100006": "服务器不可用!",
|
||||||
"100011": "内容为空!",
|
"100011": "笔记为空!",
|
||||||
"100012": "内容过大,超过200K!",
|
"100012": "笔记过大,超过400K!",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export default zh;
|
export default zh;
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
<Form :model="noteForm" :label-width="80">
|
<Form :model="noteForm" :label-width="80">
|
||||||
<div id="wrapper" style="border-left: 0px solid #FF3366;">
|
<div id="wrapper" style="border-left: 0px solid #FF3366;">
|
||||||
<Input element-id="noteText" type="textarea" :border="false" v-model="noteForm.text" autofocus
|
<Input element-id="noteText" type="textarea" :border="false" v-model="noteForm.text" autofocus
|
||||||
:autosize="{ minRows: 30, maxRows: 20480 }" :placeholder="$t('content.noteTip')" @input="recordText"
|
:autosize="{ minRows: 30, maxRows: 409600 }" :placeholder="$t('content.noteTip')" @input="recordText"
|
||||||
@on-keydown="recordEventKdown"/>
|
@on-keydown="recordEventKdown"/>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
@@ -341,7 +341,7 @@ export default {
|
|||||||
},
|
},
|
||||||
recordText() {
|
recordText() {
|
||||||
let text = this.noteForm.text;
|
let text = this.noteForm.text;
|
||||||
if (text.length > 204800) {
|
if (text.length > 409600) {
|
||||||
this.errorInfo = this.$t('error.100012');
|
this.errorInfo = this.$t('error.100012');
|
||||||
this.model.showError = true;
|
this.model.showError = true;
|
||||||
return;
|
return;
|
||||||
@@ -370,7 +370,7 @@ export default {
|
|||||||
let end = event.currentTarget.selectionEnd;
|
let end = event.currentTarget.selectionEnd;
|
||||||
let text = event.currentTarget.value;
|
let text = event.currentTarget.value;
|
||||||
|
|
||||||
if (text.length > 204800) {
|
if (text.length > 409600) {
|
||||||
this.errorInfo = this.$t('error.100012');
|
this.errorInfo = this.$t('error.100012');
|
||||||
this.model.showError = true;
|
this.model.showError = true;
|
||||||
return;
|
return;
|
||||||
@@ -416,7 +416,7 @@ export default {
|
|||||||
},
|
},
|
||||||
validateForm() {
|
validateForm() {
|
||||||
let text = this.noteForm.text;
|
let text = this.noteForm.text;
|
||||||
if (text.length > 204800) {
|
if (text.length > 409600) {
|
||||||
this.errorInfo = this.$t('error.100012');
|
this.errorInfo = this.$t('error.100012');
|
||||||
this.model.showError = true;
|
this.model.showError = true;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export default {
|
|||||||
} else if (this.$route.params.code) {
|
} else if (this.$route.params.code) {
|
||||||
this.errorInfo.code = this.$route.params.code;
|
this.errorInfo.code = this.$route.params.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$route.params.name) {
|
if (this.$route.params.name) {
|
||||||
this.noteForm.key = this.$route.params.name;
|
this.noteForm.key = this.$route.params.name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,9 +202,13 @@
|
|||||||
<div style="float:right;width:auto;">
|
<div style="float:right;width:auto;">
|
||||||
<Button-group size="large">
|
<Button-group size="large">
|
||||||
|
|
||||||
|
<Button aria-label="ttl" type="error"
|
||||||
|
style="margin-left:5px; border-radius: 0px;font-size: 21px; font-family: Arial, sans-serif"
|
||||||
|
@click="showTtlDeleteModel()" icon="md-alarm">{{ state.ttlDesc }}</Button>
|
||||||
|
|
||||||
<Button aria-label="share" type="error"
|
<Button aria-label="share" type="error"
|
||||||
style="margin-left:5px; border-radius: 0px;font-size: 21px; font-family: Arial, sans-serif"
|
style="margin-left:5px; border-radius: 0px;font-size: 21px; font-family: Arial, sans-serif"
|
||||||
@click="showShareModel()" icon="md-alarm">{{ state.ttlDesc }}</Button>
|
@click="showShareModel()" icon="md-share"></Button>
|
||||||
|
|
||||||
<Button aria-label="menu" type="error" style="margin-left:5px; border-radius: 0px;font-size: 24px;"
|
<Button aria-label="menu" type="error" style="margin-left:5px; border-radius: 0px;font-size: 24px;"
|
||||||
@click="switchMenu()" @blur.native="hideMenu()" icon="md-menu"></Button>
|
@click="switchMenu()" @blur.native="hideMenu()" icon="md-menu"></Button>
|
||||||
@@ -293,6 +297,17 @@
|
|||||||
</p>
|
</p>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
<Modal v-model="model.showTtlDelete" width="360" footer-hide class-name="qrmodal" :styles="{ borderRadius: 0 }">
|
||||||
|
<p style="text-align: center;margin-top:20px;">
|
||||||
|
{{$t("content.deleteTip")}}{{ state.ttlDesc }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="text-align: center;margin-top:10px;">
|
||||||
|
<Button type="error" style="border-radius: 0px;font-size:19px;" @click="closeTtlDeleteModel()">{{ $t("button.close")
|
||||||
|
}}</Button>
|
||||||
|
</p>
|
||||||
|
</Modal>
|
||||||
|
|
||||||
<Modal v-model="model.showDelete" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
<Modal v-model="model.showDelete" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
||||||
<p style="text-align: center;font-size:medium;margin-bottom: 20px;">
|
<p style="text-align: center;font-size:medium;margin-bottom: 20px;">
|
||||||
{{ $t("message.askTodelete") }}
|
{{ $t("message.askTodelete") }}
|
||||||
@@ -367,6 +382,7 @@ export default {
|
|||||||
showDownloadText: false,
|
showDownloadText: false,
|
||||||
copyTip: false,
|
copyTip: false,
|
||||||
showError: false,
|
showError: false,
|
||||||
|
showTtlDelete: false,
|
||||||
},
|
},
|
||||||
toTopState: false,
|
toTopState: false,
|
||||||
showMenuState: false,
|
showMenuState: false,
|
||||||
@@ -515,6 +531,12 @@ export default {
|
|||||||
this.errorInfo = '';
|
this.errorInfo = '';
|
||||||
this.model.showError = false;
|
this.model.showError = false;
|
||||||
},
|
},
|
||||||
|
showTtlDeleteModel(){
|
||||||
|
this.model.showTtlDelete = true;
|
||||||
|
},
|
||||||
|
closeTtlDeleteModel(){
|
||||||
|
this.model.showTtlDelete = false;
|
||||||
|
},
|
||||||
showShareModel() {
|
showShareModel() {
|
||||||
this.model.showShare = true;
|
this.model.showShare = true;
|
||||||
storage.session.setText(this.secret.storeKey + "_share", '1');
|
storage.session.setText(this.secret.storeKey + "_share", '1');
|
||||||
|
|||||||
Reference in New Issue
Block a user