diff --git a/package.json b/package.json index a4dd1ca..603e25c 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,13 @@ "material-design-icons": "^3.0.1", "register-service-worker": "^1.6.2", "roboto-fontface": "^0.6.0", + "vconsole": "^3.3.4", "vue": "^2.6.11", "vue-clipboard2": "^0.3.1", "vue-material": "^1.0.0-beta-11", "vue-router": "^3.1.5", "vue-svg-icon": "^1.2.9", + "vue-touch": "^1.1.0", "vuex": "^3.1.2" }, "devDependencies": { diff --git a/src/axios/api.js b/src/axios/api.js index 7b10af1..257a092 100644 --- a/src/axios/api.js +++ b/src/axios/api.js @@ -3,25 +3,7 @@ import { api } from "./fetch"; var CryptoJS = require("crypto-js"); -// 登录 传参 data => mail_addr, password, update_time -export function login(data) { - var sign = CryptoJS.MD5(JSON.stringify(data).replace(/\"/g,"'")).toString().toUpperCase(); - data.sign = sign - let params = new URLSearchParams(); - params.append('data', JSON.stringify(data)); - return api.post('/login', params) -} - -// 激活 传参 data => uuid mail_addr -export function activation(data) { - var sign = CryptoJS.MD5(JSON.stringify(data).replace(/\"/g,"'")).toString().toUpperCase(); - data.sign = sign - let params = new URLSearchParams(); - params.append('data', JSON.stringify(data)); - return api.post('/activation', params) -} - -// 更新本地 传参 data => mail_addr password +// 更新本地 传参 data => cid pwd export function syncLocal(data) { var sign = CryptoJS.MD5(JSON.stringify(data).replace(/\"/g,"'")).toString().toUpperCase(); data.sign = sign @@ -30,9 +12,11 @@ export function syncLocal(data) { return api.post('/download', params) } -// 更新云端 传参 data => mail_addr password codebook update_time +// 更新云端 传参 data => cid pwd content export function syncCloud(data) { - var sign = CryptoJS.MD5(JSON.stringify(data).replace(/\"/g,"'")).toString().toUpperCase(); + let data_cache = Object.assign({}, data) + delete data_cache.content + var sign = CryptoJS.MD5(JSON.stringify(data_cache).replace(/\"/g,"'")).toString().toUpperCase(); data.sign = sign let params = new URLSearchParams(); params.append('data', JSON.stringify(data)); diff --git a/src/axios/fetch.js b/src/axios/fetch.js index 5013319..5ed6c99 100644 --- a/src/axios/fetch.js +++ b/src/axios/fetch.js @@ -2,8 +2,9 @@ import axios from 'axios' export const api = axios.create({ // baseURL: 'https://ccb.canary.moe/api/', - baseURL: window.location.origin + '/api/', + // baseURL: window.location.origin + '/api/', // baseURL: 'https://canary.lacus.site/api/', + baseURL: 'http://canary.lacus.icu/api/', // baseURL: 'http://beta.lacus.site/api/', // baseURL: 'http://152.136.99.231:8001' + '/api/', headers: { diff --git a/src/utils/language.js b/src/utils/language.js index 842f3bd..2057b98 100644 --- a/src/utils/language.js +++ b/src/utils/language.js @@ -170,28 +170,21 @@ export function lang() { CHS: { title: '账户', login: { - input_placeholder: ['邮箱地址', '密码'], + input_placeholder: ['教务账号', '密码'], password_errmsg: '密码不能为空', - submit: '登录 / 注册' - }, - activation: { - title: '恭喜! 激活码已经下发到你的邮箱', - subheader: '激活码', - input_errmsg: '激活码不可为空', - submit: '立即激活' + submit: '登录' }, account: { - label: ['云端信息最后修改时间', '同步本地密码本至云端', '同步云端密码本至本地'], + label: ['云端信息最后修改时间','云端信息最后修改设备名', '同步本地密码本至云端', '同步云端密码本至本地'], logout: '退出登录' }, - mail_addr_errmsg: ['邮箱地址不能为空', '邮箱地址不合法'], + cid_errmsg: ['教务账号不能为空'], snakebar_msg: ['抱歉, 网络错误', - '恭喜! 登录成功!', - '恭喜! 请在您的邮箱里找到激活码!', - '抱歉, 密码错误, 请重新输入', + '抱歉,统一认证系统挂了', + '抱歉,账号或者密码错误', '抱歉, 网络错误. 错误码:', - '恭喜! 激活成功!', - '抱歉, 激活码错误, 请重新输入', + '恭喜! 登录成功!', + '抱歉,数据获取成功,内容有误', '恭喜! 本地数据更新成功!', '恭喜! 云端数据更新成功!' ] @@ -199,28 +192,21 @@ export function lang() { EN: { title: 'Account', login: { - input_placeholder: ['Mail addr', 'Password'], + input_placeholder: ['Educational Administration Account', 'Password'], password_errmsg: 'Password can not be none.', - submit: 'Login / Sign' - }, - activation: { - title: 'Congratulations! Activation code has been sent to your email', - subheader: 'Activation Code', - input_errmsg: 'Activation Code can not be none.', - submit: 'activation' + submit: 'Login' }, account: { - label: ['Cloud last modified time', 'Sync local codebook to cloud', 'Sync cloud codebook to local'], + label: ['Cloud last modified time','Cloud last modified drivce', 'Sync local codebook to cloud', 'Sync cloud codebook to local'], logout: 'Logout' }, - mail_addr_errmsg: ['Mail addr can not be none.', 'Mail addr is invalid.'], + cid_errmsg: ['Mail addr can not be none.'], snakebar_msg: ['Sorry, network error', - 'Congratulations! Login is successful!', - 'Congratulations! Please find the activation code in your email!', - 'Sorry, the password is wrong, please re-enter', + 'Sorry, Educational System error', + 'Sorry, account or password is wrong', 'Sorry, network error. errcode:', - 'Congratulations! Activation is successful!', - 'Sorry, the activation is wrong, please re-enter', + 'Congratulations! Login is successful!', + 'Sorry, content get successful but content is wrong', 'Congratulations! Local data update completed!', 'Congratulations! Cloud data update completed!' ] @@ -232,6 +218,7 @@ export function lang() { subheader: ['创建主密码', '解锁Canary Codebook'], pwd_label: ['主密码','解锁密码'], repeat_pwd: '再次输入主密码', + drivce_label: '请输入本设备名(多端同步用)', enter: '提交', dialog: { title: '确认提交', diff --git a/src/views/Account/Account.vue b/src/views/Account/Account.vue index 0cf1f34..6ff05c2 100644 --- a/src/views/Account/Account.vue +++ b/src/views/Account/Account.vue @@ -13,10 +13,10 @@
- -