finish use net disk
This commit is contained in:
parent
247776e149
commit
22fa58a27d
@ -2,9 +2,9 @@ import axios from 'axios'
|
|||||||
|
|
||||||
export const api = axios.create({
|
export const api = axios.create({
|
||||||
// baseURL: 'https://ccb.canary.moe/api/',
|
// baseURL: 'https://ccb.canary.moe/api/',
|
||||||
// baseURL: window.location.origin + '/api/',
|
baseURL: window.location.origin + '/api/',
|
||||||
// baseURL: 'https://canary.lacus.site/api/',
|
// baseURL: 'https://canary.lacus.site/api/',
|
||||||
baseURL: 'http://canary.lacus.icu/api/',
|
// baseURL: 'http://canary.lacus.icu/api/',
|
||||||
// baseURL: 'http://beta.lacus.site/api/',
|
// baseURL: 'http://beta.lacus.site/api/',
|
||||||
// baseURL: 'http://152.136.99.231:8001' + '/api/',
|
// baseURL: 'http://152.136.99.231:8001' + '/api/',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -5,10 +5,10 @@ export function lang() {
|
|||||||
title: '密码本',
|
title: '密码本',
|
||||||
search: '搜索...',
|
search: '搜索...',
|
||||||
menu: ['按首字母', '按最常使用'],
|
menu: ['按首字母', '按最常使用'],
|
||||||
drawer: ['账户', '设置', '生成密码', '更新日志', '分享链接', '下载apk', '立即锁定'],
|
drawer: ['账户', '设置', '生成密码', '更新日志', '分享链接', '下载apk', '立即锁定', '加入用户群'],
|
||||||
empty_state: {
|
empty_state: {
|
||||||
label: '创建你的第一个密码',
|
label: '创建你的第一个密码',
|
||||||
description: '创建密码后,您就可以将信息上载到服务器并保存',
|
description: '创建密码后,您就可以将信息上载到学校网盘并保存',
|
||||||
button: '立即创建'
|
button: '立即创建'
|
||||||
},
|
},
|
||||||
unlock_msg: {
|
unlock_msg: {
|
||||||
@ -24,7 +24,7 @@ export function lang() {
|
|||||||
title: 'Codebook',
|
title: 'Codebook',
|
||||||
search: 'Search...',
|
search: 'Search...',
|
||||||
menu: ['Alphabetically', 'Recently Used'],
|
menu: ['Alphabetically', 'Recently Used'],
|
||||||
drawer: ['Account', 'Settings', 'Generate Password', 'Update Log', 'Share', 'Download apk', 'Lock Now'],
|
drawer: ['Account', 'Settings', 'Generate Password', 'Update Log', 'Share', 'Download apk', 'Lock Now', 'Join US'],
|
||||||
empty_state: {
|
empty_state: {
|
||||||
label: 'Create your first code',
|
label: 'Create your first code',
|
||||||
description: "Creating code, you'll be able to upload your information to the server and save it.",
|
description: "Creating code, you'll be able to upload your information to the server and save it.",
|
||||||
@ -222,29 +222,32 @@ export function lang() {
|
|||||||
enter: '提交',
|
enter: '提交',
|
||||||
dialog: {
|
dialog: {
|
||||||
title: '确认提交',
|
title: '确认提交',
|
||||||
content: '该密码提交之后不可被修改, 请不要将此密码告诉任何人',
|
content: '密码本加密依赖此密码, 请不要将此密码告诉任何人',
|
||||||
confirm: '同意',
|
confirm: '同意',
|
||||||
cancel: '不同意'
|
cancel: '不同意'
|
||||||
},
|
},
|
||||||
empty_pwd_error: '主密码不能为空',
|
empty_pwd_error: '主密码不能为空',
|
||||||
wrong_pwd_error: '主密码错误',
|
wrong_pwd_error: '主密码错误',
|
||||||
match_pwd_error: '两次输入密码不一致'
|
match_pwd_error: '两次输入密码不一致',
|
||||||
|
drivce_error: '设备名不能为空'
|
||||||
},
|
},
|
||||||
EN: {
|
EN: {
|
||||||
title: ['Create Password','Unlock'],
|
title: ['Create Password','Unlock'],
|
||||||
subheader: ['Create New Password', 'Unlock Canary Codebook'],
|
subheader: ['Create New Password', 'Unlock Canary Codebook'],
|
||||||
pwd_label: ['New Password','Unlock Password'],
|
pwd_label: ['New Password','Unlock Password'],
|
||||||
repeat_pwd: 'Repeat Password',
|
repeat_pwd: 'Repeat Password',
|
||||||
|
drivce_label: 'pleace enter drivce name',
|
||||||
enter: 'Enter',
|
enter: 'Enter',
|
||||||
dialog: {
|
dialog: {
|
||||||
title: 'Confirm you new password?',
|
title: 'Confirm you new password?',
|
||||||
content: 'The password will not be modified after submission, please make sure you don’t tell anyone this password.',
|
content: 'Codebook encryption depends on this password, please make sure you don’t tell anyone this password.',
|
||||||
confirm: 'Agree',
|
confirm: 'Agree',
|
||||||
cancel: 'Disagree'
|
cancel: 'Disagree'
|
||||||
},
|
},
|
||||||
empty_pwd_error: 'Password can not be none',
|
empty_pwd_error: 'Password can not be none',
|
||||||
wrong_pwd_error: 'Wrong password',
|
wrong_pwd_error: 'Wrong password',
|
||||||
match_pwd_error: 'The two passwords do not match'
|
match_pwd_error: 'The two passwords do not match',
|
||||||
|
drivce_error: 'Drivce name can not be none'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
generator: {
|
generator: {
|
||||||
@ -281,6 +284,14 @@ export function lang() {
|
|||||||
CHS:{
|
CHS:{
|
||||||
title: '更新日志',
|
title: '更新日志',
|
||||||
timeline: [
|
timeline: [
|
||||||
|
{
|
||||||
|
label: '长理专版密码本改造完成',
|
||||||
|
tag:'功能更新',
|
||||||
|
content: [
|
||||||
|
'获取了操作长理网盘的接口文档,为了用户信息安全性,将用户加密完的密码存放至网盘canary/codebook.txt',
|
||||||
|
'2020-09-01'
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '修复搜索后关闭搜索框密码本内容消失',
|
label: '修复搜索后关闭搜索框密码本内容消失',
|
||||||
tag:'bug修复',
|
tag:'bug修复',
|
||||||
@ -406,6 +417,14 @@ export function lang() {
|
|||||||
EN:{
|
EN:{
|
||||||
title: 'Update Log',
|
title: 'Update Log',
|
||||||
timeline: [
|
timeline: [
|
||||||
|
{
|
||||||
|
label: 'Changli special edition codebook transformation completed',
|
||||||
|
tag:'Feature update',
|
||||||
|
content: [
|
||||||
|
'Obtained the interface document for operating the Changli network disk, and stored the encrypted password of the user in the network disk for the security of user information canary/codebook.txt',
|
||||||
|
'2020-09-01'
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Fixed search box password content disappeared after searching',
|
label: 'Fixed search box password content disappeared after searching',
|
||||||
tag:'Bug fix',
|
tag:'Bug fix',
|
||||||
|
@ -177,7 +177,7 @@ export default {
|
|||||||
};
|
};
|
||||||
syncLocal(data)
|
syncLocal(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res.data)
|
// console.log(res.data)
|
||||||
this.manageLoginRes(res.data);
|
this.manageLoginRes(res.data);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@ -256,11 +256,12 @@ export default {
|
|||||||
drivce: content.drivce ? content.drivce : (this.settings.is_chinese ? '暂无' : 'unknown')
|
drivce: content.drivce ? content.drivce : (this.settings.is_chinese ? '暂无' : 'unknown')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!content.drivce) content.drivce = content.drivce ? content.drivce : (this.settings.is_chinese ? '暂无' : 'unknown')
|
if(content.drivce && content.drivce != '暂无' && content.drivce != 'unknown') content.drivce = decodeURIComponent(content.drivce)
|
||||||
|
else content.drivce = this.settings.is_chinese ? '暂无' : 'unknown'
|
||||||
this.setRowData([content.codebook, this]);
|
this.setRowData([content.codebook, this]);
|
||||||
console.log('数据获取成功,密码本覆写成功');
|
console.log('数据获取成功,密码本覆写成功');
|
||||||
let user_infos = this.user_infos;
|
let user_infos = this.user_infos;
|
||||||
user_infos.update_time = data.modified - 60 * 4;
|
user_infos.update_time = data.modified - 1000 * 60 * 4;
|
||||||
user_infos.user_name = data.username;
|
user_infos.user_name = data.username;
|
||||||
user_infos.cloud_drivce = content.drivce
|
user_infos.cloud_drivce = content.drivce
|
||||||
this.setUserInfo([user_infos, this]);
|
this.setUserInfo([user_infos, this]);
|
||||||
@ -302,21 +303,19 @@ export default {
|
|||||||
this.sync_cloud_loading = true;
|
this.sync_cloud_loading = true;
|
||||||
let content = {
|
let content = {
|
||||||
codebook: this.row_data,
|
codebook: this.row_data,
|
||||||
drivce: this.user_infos.drivce
|
drivce: encodeURIComponent(this.user_infos.drivce)
|
||||||
}
|
}
|
||||||
let data = {
|
let data = {
|
||||||
cid: this.user_infos.cid,
|
cid: this.user_infos.cid,
|
||||||
pwd: decryptMainCode(this.user_infos.row_login_pwd),
|
pwd: decryptMainCode(this.user_infos.row_login_pwd),
|
||||||
content: JSON.stringify(content)
|
content: JSON.stringify(content)
|
||||||
};
|
};
|
||||||
|
console.log(data)
|
||||||
syncCloud(data)
|
syncCloud(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
let user_infos = this.user_infos;
|
let user_infos = this.user_infos;
|
||||||
user_infos.update_time = new Date().getTime();
|
user_infos.update_time = new Date().getTime();
|
||||||
console.log(user_infos)
|
|
||||||
user_infos.cloud_drivce = user_infos.drivce ? user_infos.drivce : (this.settings.is_chinese ? '暂无' : 'unknown')
|
user_infos.cloud_drivce = user_infos.drivce ? user_infos.drivce : (this.settings.is_chinese ? '暂无' : 'unknown')
|
||||||
console.log(user_infos)
|
|
||||||
|
|
||||||
this.setUserInfo([user_infos, this]);
|
this.setUserInfo([user_infos, this]);
|
||||||
console.log('数据上传成功,用户信息覆写成功');
|
console.log('数据上传成功,用户信息覆写成功');
|
||||||
this.snakebar_msg = this.lang.snakebar_msg[7];
|
this.snakebar_msg = this.lang.snakebar_msg[7];
|
||||||
@ -351,7 +350,7 @@ export default {
|
|||||||
user_name: 'A Little Canary',
|
user_name: 'A Little Canary',
|
||||||
cid: 'Codebook',
|
cid: 'Codebook',
|
||||||
row_login_pwd: '',
|
row_login_pwd: '',
|
||||||
drivce: this.settings.is_chinese ? '暂无' : 'unknown',
|
drivce: this.user_infos.drivce,
|
||||||
cloud_drivce: this.settings.is_chinese ? '暂无' : 'unknown',
|
cloud_drivce: this.settings.is_chinese ? '暂无' : 'unknown',
|
||||||
update_time: new Date().getTime()
|
update_time: new Date().getTime()
|
||||||
};
|
};
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<span class="md-list-item-text">{{ lang.drawer[0] }}</span>
|
<span class="md-list-item-text">{{ lang.drawer[0] }}</span>
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
|
|
||||||
<!-- <md-list-item @click="turnToPage('/faq')">
|
<!-- <md-list-item @click="turnToPage('/faq')">
|
||||||
<md-icon>help</md-icon>
|
<md-icon>help</md-icon>
|
||||||
<span class="md-list-item-text">FAQ</span>
|
<span class="md-list-item-text">FAQ</span>
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
@ -62,6 +62,11 @@
|
|||||||
<span class="md-list-item-text">{{ lang.drawer[3] }}</span>
|
<span class="md-list-item-text">{{ lang.drawer[3] }}</span>
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
|
|
||||||
|
<md-list-item @click="openQQ()">
|
||||||
|
<md-icon>question_answer</md-icon>
|
||||||
|
<span class="md-list-item-text">{{ lang.drawer[7] }}</span>
|
||||||
|
</md-list-item>
|
||||||
|
|
||||||
<md-list-item v-clipboard:copy="web_addr" v-clipboard:success="onCopyUrl" v-clipboard:error="onErrorUrl">
|
<md-list-item v-clipboard:copy="web_addr" v-clipboard:success="onCopyUrl" v-clipboard:error="onErrorUrl">
|
||||||
<md-icon>reply</md-icon>
|
<md-icon>reply</md-icon>
|
||||||
<span class="md-list-item-text">{{ lang.drawer[4] }}</span>
|
<span class="md-list-item-text">{{ lang.drawer[4] }}</span>
|
||||||
@ -128,7 +133,7 @@ export default {
|
|||||||
unlock: false,
|
unlock: false,
|
||||||
show_snackbar: false,
|
show_snackbar: false,
|
||||||
snakebar_msg: '',
|
snakebar_msg: '',
|
||||||
web_addr: 'https://canary.lacus.site',
|
web_addr: 'https://canary.lacus.icu',
|
||||||
titles: [],
|
titles: [],
|
||||||
search_content: '',
|
search_content: '',
|
||||||
search_start: false,
|
search_start: false,
|
||||||
@ -383,7 +388,7 @@ export default {
|
|||||||
|
|
||||||
// 下载apk
|
// 下载apk
|
||||||
downloadApk() {
|
downloadApk() {
|
||||||
window.open('https://assets.lacus.site/canary/canary.apk');
|
window.open('https://assets.lacus.site/canary/netdisk_canary.apk');
|
||||||
},
|
},
|
||||||
|
|
||||||
// 一键回顶
|
// 一键回顶
|
||||||
@ -437,6 +442,10 @@ export default {
|
|||||||
// 记录滚动高度
|
// 记录滚动高度
|
||||||
scroll(e) {
|
scroll(e) {
|
||||||
this.scrollHeight = this.$refs.list_placeholder.parentNode.parentNode.scrollTop
|
this.scrollHeight = this.$refs.list_placeholder.parentNode.parentNode.scrollTop
|
||||||
|
},
|
||||||
|
|
||||||
|
openQQ() {
|
||||||
|
window.open('https://jq.qq.com/?_wv=1027&k=KIKWmqys')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -220,9 +220,10 @@ export default {
|
|||||||
// 初始化用户信息
|
// 初始化用户信息
|
||||||
let user_infos = {
|
let user_infos = {
|
||||||
user_name: 'A Little Canary',
|
user_name: 'A Little Canary',
|
||||||
cid: '',
|
cid: 'Codebook',
|
||||||
row_login_pwd: '',
|
row_login_pwd: '',
|
||||||
drivce: '',
|
drivce: this.user_infos.drivce,
|
||||||
|
cloud_drivce: this.settings.is_chinese ? '暂无' : 'unknown',
|
||||||
update_time: new Date().getTime()
|
update_time: new Date().getTime()
|
||||||
};
|
};
|
||||||
this.setUserInfo([user_infos, this]);
|
this.setUserInfo([user_infos, this]);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="unlock" :class="settings.is_dark_mode ? 'dark-theme-unlock' : ''">
|
<div class="unlock" :class="settings.is_dark_mode ? 'dark-theme-unlock' : ''">
|
||||||
<md-toolbar class="md-primary">
|
<!-- <md-toolbar class="md-primary">
|
||||||
<h3 class="md-title" style="flex: 1">{{ is_create ? lang.title[0] : lang.title[1] }}</h3>
|
<h3 class="md-title" style="flex: 1">{{ is_create ? lang.title[0] : lang.title[1] }}</h3>
|
||||||
</md-toolbar>
|
</md-toolbar> -->
|
||||||
|
|
||||||
<icon class="logo" name="canary"></icon>
|
<icon class="logo" name="canary"></icon>
|
||||||
|
|
||||||
@ -20,14 +20,16 @@
|
|||||||
<span class="md-error">{{ err_msg }}</span>
|
<span class="md-error">{{ err_msg }}</span>
|
||||||
</md-field>
|
</md-field>
|
||||||
|
|
||||||
<md-field class="input-box" :class="messageClass" v-if="is_create">
|
<md-field class="input-box" :class="drivceMessageClass" v-if="is_create">
|
||||||
<label>{{ lang.repeat_pwd }}</label>
|
<label>{{ lang.drivce_label }}</label>
|
||||||
<md-input v-model="repeat" type="password"></md-input>
|
<md-input v-model="drivce"></md-input>
|
||||||
<span class="md-error">{{ err_msg }}</span>
|
<span class="md-error">{{ drivce_err_msg }}</span>
|
||||||
</md-field>
|
</md-field>
|
||||||
|
|
||||||
<md-button class="md-raised md-primary center" @click="judgePwd()">{{ lang.enter }}</md-button>
|
<md-button class="md-raised md-primary center" @click="judgePwd()">{{ lang.enter }}</md-button>
|
||||||
|
|
||||||
|
<p class="center tips">此密码本为长理专版,未开启同步密码将加密后存放本地,开启同步密码将加密后存放在您的长理网盘中,请放心使用 <span class="qq-link" @click="openQQ()">点我加入用户群</span></p>
|
||||||
|
|
||||||
<md-dialog-confirm
|
<md-dialog-confirm
|
||||||
:md-active.sync="show_dialog"
|
:md-active.sync="show_dialog"
|
||||||
:md-title="lang.dialog.title"
|
:md-title="lang.dialog.title"
|
||||||
@ -56,8 +58,11 @@ export default {
|
|||||||
return {
|
return {
|
||||||
pwd: '',
|
pwd: '',
|
||||||
repeat: '',
|
repeat: '',
|
||||||
|
drivce: '',
|
||||||
is_err: false,
|
is_err: false,
|
||||||
|
is_drivce_err: false,
|
||||||
err_msg: '',
|
err_msg: '',
|
||||||
|
drivce_err_msg:'',
|
||||||
show_dialog: false,
|
show_dialog: false,
|
||||||
is_create: false,
|
is_create: false,
|
||||||
show_snackbar: false,
|
show_snackbar: false,
|
||||||
@ -66,15 +71,20 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['row_data', 'settings']),
|
...mapState(['row_data', 'settings', 'user_infos']),
|
||||||
messageClass() {
|
messageClass() {
|
||||||
return {
|
return {
|
||||||
'md-invalid': this.is_err
|
'md-invalid': this.is_err
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
drivceMessageClass() {
|
||||||
|
return {
|
||||||
|
'md-invalid': this.is_drivce_err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['setRowPwd']),
|
...mapActions(['setRowPwd', 'setUserInfo']),
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
init() {
|
init() {
|
||||||
@ -121,6 +131,12 @@ export default {
|
|||||||
// 正确,将密码加密放进locolstorage
|
// 正确,将密码加密放进locolstorage
|
||||||
this.submit();
|
this.submit();
|
||||||
} else {
|
} else {
|
||||||
|
if (this.drivce.trim().length == 0) {
|
||||||
|
this.is_drivce_err = true;
|
||||||
|
this.drivce_err_msg = this.lang.drivce_error;
|
||||||
|
console.log('设备名为空拦截');
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 空密码本,不论输入什么都是对的,但是需要比较两个输入的是不是一样的
|
// 空密码本,不论输入什么都是对的,但是需要比较两个输入的是不是一样的
|
||||||
if (this.pwd == this.repeat) {
|
if (this.pwd == this.repeat) {
|
||||||
// 两次一致,弹窗警告不可更改
|
// 两次一致,弹窗警告不可更改
|
||||||
@ -146,9 +162,17 @@ export default {
|
|||||||
main_code: main_code_aes,
|
main_code: main_code_aes,
|
||||||
create_time: new Date().getTime()
|
create_time: new Date().getTime()
|
||||||
};
|
};
|
||||||
|
let user_infos = this.user_infos
|
||||||
|
console.log(user_infos, this.drivce)
|
||||||
|
user_infos.drivce = this.drivce
|
||||||
|
this.setUserInfo([user_infos, this])
|
||||||
this.setRowPwd([row_pwd, this]);
|
this.setRowPwd([row_pwd, this]);
|
||||||
console.log('主密码设置完成,返回Home');
|
console.log('主密码设置完成,返回Home');
|
||||||
this.$router.replace('/');
|
this.$router.replace('/');
|
||||||
|
},
|
||||||
|
|
||||||
|
openQQ() {
|
||||||
|
window.open('https://jq.qq.com/?_wv=1027&k=KIKWmqys')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -174,6 +198,11 @@ export default {
|
|||||||
repeat: function() {
|
repeat: function() {
|
||||||
this.is_err = false;
|
this.is_err = false;
|
||||||
this.err_msg = '';
|
this.err_msg = '';
|
||||||
|
},
|
||||||
|
// 如果 `drivce` 发生改变,就会清空错误状态
|
||||||
|
drivce: function() {
|
||||||
|
this.is_drivce_err = false;
|
||||||
|
this.drivce_err_msg = ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {},
|
beforeDestroy() {},
|
||||||
@ -213,4 +242,13 @@ export default {
|
|||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.tips {
|
||||||
|
font-size: .3rem;
|
||||||
|
max-width: 70%;
|
||||||
|
padding: 1rem 0;
|
||||||
|
color: #989898;
|
||||||
|
}
|
||||||
|
.qq-link {
|
||||||
|
color: #448aff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user