This commit is contained in:
Jesse-Ma
2022-05-27 14:29:30 +08:00
parent af75777b4e
commit 0d10a1802a
32 changed files with 1909 additions and 1 deletions

40
src/api/lock.js Normal file
View File

@@ -0,0 +1,40 @@
// import Jquery from "jquery";
import {aesEncrypt, md5} from "@/libs/secret";
// export function getSecretKey(key, password) {
// console.log("getSecretKey");
// let secretKey = '';
// Jquery.ajax({
// method: 'POST',
// url: '/note/' + key + "/secretKey",
// async: false,
// contentType: 'application/json',
// dataTeyp: 'json',
// data: JSON.stringify({'password': password}),
// success: function (data) {
// secretKey = data;
// },
// error: function () {
// alert('服务器链接异常 ');
// },
// });
// return secretKey;
// }
export function getStoreKey(key) {
return md5(aesEncrypt(key, key));
}
export function getSecretKey(cipher, password) {
if(!password){
password = '';
}
return md5(cipher + password);
}