一页一记 学院
  • 🏡从这里开始
  • 🤔猜你想问
    • 管理页访问不了怎么办?
    • 有些网页不可用,面板出不来
    • 手机如何使用
    • 离线可用是指什么?
    • 如何使用 SVG 图片
    • 登录 & 与 PAGENOTE 账号绑定
  • 💻功能介绍
    • 自定义扩展
    • 🔍高亮搜索引擎结果
    • 长按唤起
    • 🖌勾勾画画选重点
    • ☁️云盘使用手册
  • 📅最新动态
    • 0.16.0.beta 内测版发布
    • 0.15.11.beta 内测版发布
    • 0.15.9 功能异常说明
  • 我们
    • 助力发展
    • 内测 & 离线安装
  • 📪关于 PAGENOTE
    • 为了小而美
    • 功能规划
    • 隐私协议
    • About License
    • 赞助定制
  • 开发者
    • API
      • 📚解析数据
      • 服务端 API
      • 浏览器插件 API
由 GitBook 提供支持
在本页
  • 加密方式
  • 解密方式
  • 一记 数据结构 2.0 版本

这有帮助吗?

  1. 开发者
  2. API

📚解析数据

目前一记服务器不存储用户笔记数据,数据加密后存储于用户个人提供的网盘中。对于开发者,可以自行解析数据用于其他用途。

上一页API下一页服务端 API

最后更新于4年前

这有帮助吗?

加密方式

一记 采用 AES 算法对原始数据进行加密,密钥由用户自行设置。

import Aes from "crypto-js/aes"

const secretKey = '用户自行设置的密钥'
const pagenoteData = {} // pagenote 原始数据
const dataString = JSON.stringify(pagenoteData)
const encrypteString = Aes.encrypt(dataString,secretKey).toString();

经过加密后的字符串数据 encryptedString 将上传至用户个人云盘 pagenote/pages,目录下,如下图:

解密方式

自行获取文件内容后,使用设置的密钥进行解密,方法如下:

import Aes from "crypto-js/aes";
import Crypto from "crypto-js";

const fileContent = 'xxxxxx' // 文件内容字符串
const secretKey = '用户自行设置的密钥'

try{
   const originString = 
         Aes.decrypt(fileContent,secretKey)
            .toString(Crypto.enc.Utf8)
   const dataObject = JSON.parse(originString)
}catch(e){
   console.error(e,'解密失败')
}

一记 数据结构 2.0 版本

plainData 页面结构体

{
  version: { type: GraphQLInt },
  url: { type: GraphQLString },
  title: { type: GraphQLString },
  categories: {
    type: new GraphQLList(GraphQLString)
  },
  createAt: { type: GraphQLString},
  description: { type: GraphQLString},
  icon: { type: GraphQLString},
  images: { type: GraphQLList(GraphQLString)},
  snapshots: { type: GraphQLList(GraphQLString)},
  lastModified: { type: GraphQLString},
  steps: {
    type: GraphQLList(Step),
  }
}

step 标记结构体

{
    bg: { type: GraphQLString },
    id: { type: GraphQLString },
    isActive: { type: GraphQLString},
    offsetX: { type: GraphQLFloat},
    offsetY: { type: GraphQLFloat},
    parentW: { type: GraphQLFloat},
    x: { type: GraphQLFloat},
    y: { type: GraphQLFloat},
    time: { type: GraphQLString},
    pre: { type: GraphQLString},
    tip: { type: GraphQLString},
    suffix: { type: GraphQLString},
    text: { type: GraphQLString},
}