diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..14ea590
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+# Windows
+[Dd]esktop.ini
+Thumbs.db
+$RECYCLE.BIN/
+
+# macOS
+.DS_Store
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+
+# Node.js
+node_modules/
diff --git a/cloudfunctionTemplate/passwd.json b/cloudfunctionTemplate/passwd.json
new file mode 100644
index 0000000..5b57965
--- /dev/null
+++ b/cloudfunctionTemplate/passwd.json
@@ -0,0 +1,22 @@
+[
+ {
+ "name": "decoder",
+ "value": {
+ "method": "decoder",
+ "argv": {
+ "handle": "b0bf0e91d3ae59711d9569998d4d334b3d551121ede824233d3c8888dd89c3d5",
+ "openid": "oLYkK4-QKvlCBxZFw8qF4suJplv0"
+ }
+ }
+ },
+ {
+ "name": "deleter",
+ "value": {
+ "method": "deleter",
+ "argv": {
+ "openid": "oLYkK4y0t2DjbMijYDURhyqPCQSU",
+ "handle": "19ee001b09e1a39a3c37f72f01528dab2ede602880572b460229e8db85b167c5"
+ }
+ }
+ }
+]
\ No newline at end of file
diff --git a/cloudfunctions/changePwd/index.js b/cloudfunctions/changePwd/index.js
new file mode 100644
index 0000000..54034d2
--- /dev/null
+++ b/cloudfunctions/changePwd/index.js
@@ -0,0 +1,37 @@
+// 云函数入口文件
+const cloud = require('wx-server-sdk')
+var crypto = require('crypto')
+
+cloud.init({
+ traceUser: true,
+ env: "ipasswd-7h7iu"
+})
+
+const db = cloud.database()
+
+// 云函数入口函数
+exports.main = async (event, context) => {
+ const wxContext = cloud.getWXContext()
+ let passwd_key = crypto.createHash('sha256').update(event.passwd).digest('hex')
+ return new Promise((resolve, reject) => {
+ db.collection('users').where({
+ openid : wxContext.OPENID
+ }).update({
+ data:{
+ passwd : passwd_key
+ },
+ success:function(){
+ resolve({
+ status : "ok",
+ openid : wxContext.OPENID
+ })
+ },
+ fail: function () {
+ resolve({
+ status: "fail",
+ openid: wxContext.OPENID
+ })
+ }
+ })
+ })
+}
\ No newline at end of file
diff --git a/cloudfunctions/changePwd/package.json b/cloudfunctions/changePwd/package.json
new file mode 100644
index 0000000..9a2b1ad
--- /dev/null
+++ b/cloudfunctions/changePwd/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "changePwd",
+ "version": "1.0.0",
+ "description": "修改用户六位独立密码",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "wx-server-sdk": "latest",
+ "crypto": "latest"
+ }
+}
\ No newline at end of file
diff --git a/cloudfunctions/check/index.js b/cloudfunctions/check/index.js
new file mode 100644
index 0000000..e90811a
--- /dev/null
+++ b/cloudfunctions/check/index.js
@@ -0,0 +1,45 @@
+// 云函数入口文件
+const cloud = require('wx-server-sdk')
+var crypto = require('crypto')
+
+cloud.init({
+ traceUser: true,
+ env: "ipasswd-7h7iu"
+})
+
+const db = cloud.database()
+
+
+// 云函数入口函数
+exports.main = async (event, context) => {
+ const wxContext = cloud.getWXContext()
+ return new Promise((resolve, reject) => {
+ db.collection('users').where({
+ openid: wxContext.OPENID
+ }).get().then(res=>{
+ if(res.data.length > 0){
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ userInfo : {
+ avatarUrl:res.data[0].avatarUrl,
+ city: res.data[0].city,
+ date : res.data[0].date,
+ nickName : res.data[0].nickName,
+ language : res.data[0].language,
+ gender : res.data[0].gender,
+ },
+ status: "UserFound"
+ })
+ }
+ else{
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ userInfo: {},
+ status:"UserNotFound"
+ })
+ }
+ })
+ })
+}
\ No newline at end of file
diff --git a/cloudfunctions/check/package.json b/cloudfunctions/check/package.json
new file mode 100644
index 0000000..f124555
--- /dev/null
+++ b/cloudfunctions/check/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "check",
+ "version": "1.0.0",
+ "description": "检查用户是否存在",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "Saturneric",
+ "license": "ISC",
+ "dependencies": {
+ "wx-server-sdk": "latest",
+ "crypto": "latest"
+ }
+}
\ No newline at end of file
diff --git a/cloudfunctions/checkPwd/index.js b/cloudfunctions/checkPwd/index.js
new file mode 100644
index 0000000..91a9199
--- /dev/null
+++ b/cloudfunctions/checkPwd/index.js
@@ -0,0 +1,45 @@
+// 云函数入口文件
+const cloud = require('wx-server-sdk')
+var crypto = require('crypto')
+
+cloud.init({
+ traceUser: true,
+ env: "ipasswd-7h7iu"
+})
+
+const db = cloud.database()
+
+// 云函数入口函数
+exports.main = async (event, context) => {
+ const wxContext = cloud.getWXContext()
+ return new Promise((resolve, reject) => {
+ db.collection('users').where({
+ openid: wxContext.OPENID
+ }).get().then(res => {
+ if (res.data.length > 0) {
+ var passwd_key = crypto.createHash('sha256').update(event.passwd).digest('hex')
+ if(passwd_key == res.data[0].passwd)
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ status: "success"
+ })
+ else
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ status: "failed"
+ })
+ }
+ else {
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ status: "failed"
+ })
+ }
+ })
+
+ })
+
+}
\ No newline at end of file
diff --git a/cloudfunctions/checkPwd/package.json b/cloudfunctions/checkPwd/package.json
new file mode 100644
index 0000000..c7f652a
--- /dev/null
+++ b/cloudfunctions/checkPwd/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "checkPwd",
+ "version": "1.0.0",
+ "description": "检查六位密码是否与数据库中的一致",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "Saturneric",
+ "license": "ISC",
+ "dependencies": {
+ "wx-server-sdk": "latest",
+ "crypto": "latest"
+ }
+}
\ No newline at end of file
diff --git a/cloudfunctions/createUser/index.js b/cloudfunctions/createUser/index.js
new file mode 100644
index 0000000..19685a6
--- /dev/null
+++ b/cloudfunctions/createUser/index.js
@@ -0,0 +1,37 @@
+// 云函数入口文件
+const cloud = require('wx-server-sdk')
+var crypto = require('crypto')
+
+cloud.init({
+ traceUser: true,
+ env: "ipasswd-7h7iu"
+})
+
+const db = cloud.database()
+
+// 云函数入口函数
+exports.main = async (event, context) => {
+ const wxContext = cloud.getWXContext()
+ var passwd_key = crypto.createHash('sha256').update(event.passwd).digest('hex')
+
+ return new Promise((resolve, reject) => {
+ db.collection("users").add({
+ data : {
+ avatarUrl: event.avatarUrl,
+ city: event.city,
+ gender: event.gender,
+ language: event.language,
+ nickName: event.nickName,
+ openid: wxContext.OPENID,
+ passwd: passwd_key,
+ date: event.date
+ }
+ }).then(res=>{
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ status: "ok"
+ })
+ })
+ })
+}
\ No newline at end of file
diff --git a/cloudfunctions/createUser/package.json b/cloudfunctions/createUser/package.json
new file mode 100644
index 0000000..4f4dc20
--- /dev/null
+++ b/cloudfunctions/createUser/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "createUser",
+ "version": "1.0.0",
+ "description": "创建新用户",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "wx-server-sdk": "latest"
+ }
+}
\ No newline at end of file
diff --git a/cloudfunctions/getHash/index.js b/cloudfunctions/getHash/index.js
new file mode 100644
index 0000000..6b77bb4
--- /dev/null
+++ b/cloudfunctions/getHash/index.js
@@ -0,0 +1,22 @@
+// 云函数入口文件
+const cloud = require('wx-server-sdk')
+var crypto = require('crypto')
+
+cloud.init({
+ traceUser: true,
+ env: "ipasswd-7h7iu"
+})
+
+const db = cloud.database()
+// 云函数入口函数
+exports.main = async (event, context) => {
+ const wxContext = cloud.getWXContext()
+ var hash_value = crypto.createHash('sha256').update(event.text).digest('hex')
+ return {
+ event,
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ unionid: wxContext.UNIONID,
+ hash : hash_value
+ }
+}
\ No newline at end of file
diff --git a/cloudfunctions/getHash/package.json b/cloudfunctions/getHash/package.json
new file mode 100644
index 0000000..280f7a8
--- /dev/null
+++ b/cloudfunctions/getHash/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "getHash",
+ "version": "1.0.0",
+ "description": "得到字符串的哈希值",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "Saturneric",
+ "license": "ISC",
+ "dependencies": {
+ "wx-server-sdk": "latest",
+ "crypto": "latest"
+ }
+}
\ No newline at end of file
diff --git a/cloudfunctions/login/config.json b/cloudfunctions/login/config.json
new file mode 100644
index 0000000..16348ce
--- /dev/null
+++ b/cloudfunctions/login/config.json
@@ -0,0 +1,5 @@
+{
+ "permissions": {
+ "openapi": []
+ }
+}
diff --git a/cloudfunctions/login/index.js b/cloudfunctions/login/index.js
new file mode 100644
index 0000000..35ea7c7
--- /dev/null
+++ b/cloudfunctions/login/index.js
@@ -0,0 +1,31 @@
+// 云函数模板
+// 部署:在 cloud-functions/login 文件夹右击选择 “上传并部署”
+
+const cloud = require('wx-server-sdk')
+
+// 初始化 cloud
+cloud.init()
+
+/**
+ * 这个示例将经自动鉴权过的小程序用户 openid 返回给小程序端
+ *
+ * event 参数包含小程序端调用传入的 data
+ *
+ */
+exports.main = (event, context) => {
+ console.log(event)
+ console.log(context)
+
+ // 可执行其他自定义逻辑
+ // console.log 的内容可以在云开发云函数调用日志查看
+
+ // 获取 WX Context (微信调用上下文),包括 OPENID、APPID、及 UNIONID(需满足 UNIONID 获取条件)
+ const wxContext = cloud.getWXContext()
+
+ return {
+ event,
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ unionid: wxContext.UNIONID,
+ }
+}
diff --git a/cloudfunctions/login/package.json b/cloudfunctions/login/package.json
new file mode 100644
index 0000000..1bf791e
--- /dev/null
+++ b/cloudfunctions/login/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "login",
+ "version": "1.0.0",
+ "description": "得到用户的openid",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "wx-server-sdk": "latest"
+ }
+}
diff --git a/cloudfunctions/passwd/index.js b/cloudfunctions/passwd/index.js
new file mode 100644
index 0000000..99f4dca
--- /dev/null
+++ b/cloudfunctions/passwd/index.js
@@ -0,0 +1,499 @@
+// 云函数入口文件
+const cloud = require('wx-server-sdk')
+var crypto = require('crypto');
+var CryptoJS = require('crypto-js')
+
+cloud.init({
+ traceUser: true,
+ env: "ipasswd-7h7iu"
+})
+
+const db = cloud.database()
+
+function encoder(argv) {
+ var keys = new Array(4);
+ for (let i = 0; i < 4; i++) {
+ keys[i] = new Array(10);
+ }
+ keys[0] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "#"]
+ keys[1] = ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "#"]
+ keys[2] = ["a", "s", "d", "f", "g", "h", "j", "k", "l", "#", "#"]
+ keys[3] = ["z", "x", "c", "v", "b", "n", "m", "#", "#", "#", "#"]
+
+ var rtn = {
+ data: "",
+ arrgs: []
+ }
+
+ var pos = new Array(randomer(rtn.arrgs,3), randomer(rtn.arrgs,10))
+ var vec = new Array(0, 0), nvec = new Array(0, 0)
+ var getUpper = false, isUpperPoss = 0.2, allGetUpper = false
+ var getSpecial = false, isSpecialPoss = 0.1, allGetSpecial = false
+ for (let i = 0; i < argv.length; i++) {
+ nvec[0] = randomer(rtn.arrgs,50)
+ nvec[1] = randomer(rtn.arrgs,50)
+ vec[0] = nvec[0] * 0.08
+ vec[1] = nvec[1] * 0.24
+ if (possibility(rtn.arrgs, 0.5)) {
+ vec[0] *= -1
+ }
+ if (possibility(rtn.arrgs, 0.5)) {
+ vec[1] *= -1
+ }
+ pos = new Array(pos[0] + vec[0], pos[1] + vec[1])
+ if (pos[0] > 3.4 || pos[0] < 0) {
+ pos[0] = randomer(rtn.arrgs,3)
+ }
+ if (pos[1] > 10.4 || pos[1] < 0) {
+ pos[1] = randomer(rtn.arrgs,10)
+ }
+ var tstr = keys[Math.round(pos[0])][Math.round(pos[1])]
+ if(tstr == "#"){
+ i -= 1;
+ continue;
+ }
+ if (argv.hasUpper == true){
+ if (possibility(rtn.arrgs, isUpperPoss)){
+ tstr = tstr.toUpperCase()
+ getUpper = true
+ allGetUpper = true
+ }
+
+ if ((i+2) == argv.length && allGetUpper == false) {
+ tstr = 'Z';
+ }
+
+ if(getUpper == false){
+ isUpperPoss *= 1.5
+ }
+ else{
+ getUpper = false
+ isUpperPoss *= 0.2
+ if(isUpperPoss < 0.1) isUpperPoss = 0.2
+ }
+ }
+
+ if (argv.hasSpecial == true) {
+
+ if (possibility(rtn.arrgs, isSpecialPoss)) {
+ var selectedSpecial = argv.specialChar;
+ var srand = randomer(rtn.arrgs, selectedSpecial.length)
+ tstr = selectedSpecial[srand]
+ getSpecial = true
+ allGetSpecial = true
+ }
+
+ if ((i+1) == argv.length && allGetSpecial == false) {
+ var selectedSpecial = argv.specialChar;
+ var srand = randomer(rtn.arrgs, selectedSpecial.length)
+ tstr = selectedSpecial[srand]
+ }
+
+ if (getSpecial == false) {
+ isSpecialPoss *= 1.5
+ }
+ else {
+ getSpecial = false
+ isSpecialPoss *= 0.1
+ if (isSpecialPoss < 0.05) isSpecialPoss = 0.1
+ }
+ }
+
+ rtn.data += tstr
+
+ }
+ return rtn
+}
+
+
+function decoder(argv, rands) {
+ var ridx = 0
+ var keys = new Array(4);
+ for (let i = 0; i < 4; i++) {
+ keys[i] = new Array(10);
+ }
+ keys[0] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "#"]
+ keys[1] = ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "#"]
+ keys[2] = ["a", "s", "d", "f", "g", "h", "j", "k", "l", "#", "#"]
+ keys[3] = ["z", "x", "c", "v", "b", "n", "m", "#", "#", "#", "#"]
+
+ var rtn = {
+ data: "",
+ arrgs: []
+ }
+
+ var pos = new Array(derandomer(rands[ridx++], 3), derandomer(rands[ridx++], 10))
+ var vec = new Array(0, 0), nvec = new Array(0, 0)
+ var getUpper = false, isUpperPoss = 0.2, allGetUpper = false
+ var getSpecial = false, isSpecialPoss = 0.1, allGetSpecial = false
+ for (let i = 0; i < argv.length; i++) {
+ nvec[0] = derandomer(rands[ridx++], 50)
+ nvec[1] = derandomer(rands[ridx++], 50)
+ vec[0] = nvec[0] * 0.08
+ vec[1] = nvec[1] * 0.24
+ if (depossibility(rands[ridx++], 0.5)) {
+ vec[0] *= -1
+ }
+ if (depossibility(rands[ridx++], 0.5)) {
+ vec[1] *= -1
+ }
+ pos = new Array(pos[0] + vec[0], pos[1] + vec[1])
+ if (pos[0] > 3.4 || pos[0] < 0) {
+ pos[0] = derandomer(rands[ridx++], 3)
+ }
+ if (pos[1] > 10.4 || pos[1] < 0) {
+ pos[1] = derandomer(rands[ridx++], 10)
+ }
+ var tstr = keys[Math.round(pos[0])][Math.round(pos[1])]
+ if (tstr == "#") {
+ i -= 1;
+ continue;
+ }
+ if (argv.hasUpper == true) {
+ if (depossibility(rands[ridx++], isUpperPoss)) {
+ tstr = tstr.toUpperCase()
+ getUpper = true
+ allGetUpper = true
+ }
+
+ if ((i+2) == argv.length && allGetUpper == false) {
+ tstr = 'Z';
+ }
+
+ if (getUpper == false) {
+ isUpperPoss *= 1.5
+ }
+ else {
+ getUpper = false
+ isUpperPoss *= 0.2
+ if (isUpperPoss < 0.1) isUpperPoss = 0.2
+ }
+ }
+
+ if (argv.hasSpecial == true) {
+
+ if (depossibility(rands[ridx++], isSpecialPoss)) {
+ var selectedSpecial = argv.specialChar;
+ var srand = derandomer(rands[ridx++], selectedSpecial.length)
+ tstr = selectedSpecial[srand]
+ getSpecial = true
+ allGetSpecial = true
+ }
+
+ if ((i+1) == argv.length && allGetSpecial == false) {
+ var selectedSpecial = argv.specialChar;
+ var srand = derandomer(rands[ridx++], selectedSpecial.length)
+ tstr = selectedSpecial[srand]
+ }
+
+ if (getSpecial == false) {
+ isSpecialPoss *= 1.5
+ }
+ else {
+ getSpecial = false
+ isSpecialPoss *= 0.1
+ if (isSpecialPoss < 0.05) isSpecialPoss = 0.1
+ }
+ }
+
+ rtn.data += tstr
+
+ }
+ return rtn
+}
+
+
+function possibility(args, possb){
+ var tmp = Math.random()
+ args.push(tmp)
+ if (possb > tmp){
+ return true;
+ }
+ else return false;
+}
+
+function depossibility(arg, possb) {
+ var tmp = arg
+ if (possb > tmp) {
+ return true;
+ }
+ else return false;
+}
+
+function randomer(args, range) {
+ var tmp = Math.random()
+ args.push(tmp)
+ return Math.floor(tmp * range);
+}
+
+function derandomer(arg, range) {
+ var tmp = arg
+ return Math.floor(tmp * range);
+}
+
+function aes_encrypt(data, openid, iv){
+ var blocks = parseInt(data.length / 16)
+ if (data.length % 16 != 0) blocks += 1;
+ buffdata = new Buffer(16 * blocks)
+ console.log("Blocks",blocks)
+ buffdata.write(data)
+ data = buffdata
+ console.log("Buffdata",buffdata)
+
+ var algorithm = 'aes-256-ecb'
+ var key = crypto.createHash('sha256').update(openid).digest('hex')
+ key = key.substr(0, 32)
+ key = key.toString('hex')
+ console.log("Data", data, "Key", key)
+ var clearEncoding = 'ascii'
+ var cipherEncoding = 'base64'
+ iv = iv || ""
+ var cipher = crypto.createCipher(algorithm, key, iv)
+ cipher.setAutoPadding(true);
+ var cipherChunks = []
+ cipherChunks.push(cipher.update(data, clearEncoding, cipherEncoding));
+ cipherChunks.push(cipher.final(cipherEncoding));
+ return cipherChunks.join('')
+}
+
+function aes_decode(ciphertext, openid, iv){
+ var algorithm = 'aes-256-ecb'
+ var key = crypto.createHash('sha256').update(openid).digest('hex')
+ key = key.substr(0, 32)
+ key = key.toString('hex')
+ console.log("Key", key)
+ var clearEncoding = 'ascii'
+ var cipherEncoding = 'base64'
+ iv = iv || "";
+ var decipher = crypto.createDecipheriv(algorithm, key, iv)
+ decipher.setAutoPadding(false);
+ console.log("crypted:" + ciphertext)
+ var cipherChunks = [];
+ cipherChunks.push(decipher.update(ciphertext, cipherEncoding, clearEncoding));
+ cipherChunks.push(decipher.final(clearEncoding));
+ var decrypted = cipherChunks.join('')
+ return decrypted;
+}
+
+// 云函数入口函数
+exports.main = async (event, context) => {
+ const wxContext = cloud.getWXContext()
+ console.log("[云函数] 调用 " + event.method)
+ if (event.method == "encoder") {
+ var rtn = encoder(event.argv)
+
+ var code = String(wxContext.openid)
+ for (var i = 0; i < rtn.arrgs.length; i++) {
+ code += String(rtn.arrgs[i])
+ }
+ var handle_hash = crypto.createHash('sha256').update(code).digest('hex');
+ return new Promise((resolve, reject) => {
+ db.collection('passwd').add({
+ data: {
+ openid: wxContext.OPENID,
+ args: rtn.arrgs,
+ handle_hash: handle_hash,
+ argv: event.argv
+ }
+ }).then(res => {
+ if (res.errMsg == "collection.add:ok") {
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ passwd: rtn.data,
+ handle: handle_hash,
+ status: "ok"
+ })
+ }
+ else {
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ status: "fail"
+ })
+ }
+ })
+ })
+ }
+ else if (event.method == "saver") {
+ var handle = event.argv.handle
+ var openid = event.argv.openid
+ var tag = event.argv.tag
+ return new Promise((resolve, reject) => {
+ db.collection("passwd").where({
+ handle_hash: handle,
+ openid: openid
+ }).limit(1).get().then(res => {
+ console.log(res)
+ if (res.data.length > 0) {
+ var tag_hash = crypto.createHash('sha256').update(tag).digest('hex')
+ db.collection('passwd_saved').add({
+ data: {
+ openid: wxContext.OPENID,
+ args: res.data[0].args,
+ handle_hash: handle,
+ tag_hash: tag_hash,
+ argv : res.data[0].argv,
+ custom: false
+ }
+ }).then(res => {
+ if (res.errMsg == "collection.add:ok") {
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ handle: handle_hash,
+ status: "ok"
+ })
+ }
+ else {
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ status: "fail"
+ })
+ }
+ })
+ }
+ })
+ })
+ }
+ else if (event.method == "customer") {
+ var handle_hash = event.argv.handle
+ var openid = event.argv.openid
+ var tag = event.argv.tag
+ var passwd = event.argv.passwd
+ return new Promise((resolve, reject) => {
+ db.collection("passwd").where({
+ handle_hash: handle_hash,
+ openid: openid
+ }).limit(1).get().then(res => {
+ if (res.data.length > 0) {
+
+ var tag_hash = crypto.createHash('sha256').update(tag).digest('hex')
+
+ var key = crypto.createHash('sha256').update(openid).digest('hex')
+ key = key.substr(0, 32)
+ key = key.toString('hex')
+
+ var encrypt = CryptoJS.AES.encrypt(passwd, CryptoJS.enc.Utf8.parse(key), {
+ mode: CryptoJS.mode.ECB,
+ padding: CryptoJS.pad.Pkcs7
+ });
+
+ db.collection("passwd_saved").add({
+ data: {
+ openid: wxContext.OPENID,
+ ciphertext: encrypt.toString(),
+ handle_hash: handle_hash,
+ tag_hash: tag_hash,
+ custom: true
+ }
+ }).then(res => {
+ if (res.errMsg == "collection.add:ok") {
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ handle: handle_hash,
+ status: "ok"
+ })
+ }
+ else {
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ status: "fail"
+ })
+ }
+ })
+ }
+ })
+ })
+ }
+ else if (event.method == "decoder") {
+ var handle_hash = event.argv.handle
+ var openid = event.argv.openid
+ return new Promise((resolve, reject) => {
+ db.collection("passwd_saved").where({
+ handle_hash: handle_hash,
+ openid: openid
+ }).limit(1).get().then(res => {
+ console.log(res)
+ if (res.data.length > 0) {
+ if(res.data[0].custom){
+ var key = crypto.createHash('sha256').update(openid).digest('hex')
+ key = key.substr(0, 32)
+ key = key.toString('hex')
+
+ var decrypt = CryptoJS.AES.decrypt(res.data[0].ciphertext, CryptoJS.enc.Utf8.parse(key), {
+ mode: CryptoJS.mode.ECB,
+ padding: CryptoJS.pad.Pkcs7
+ });
+ resolve({
+ event,
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ passwd: decrypt.toString(CryptoJS.enc.Utf8),
+ status : "ok",
+ handle : handle_hash
+ })
+ }
+ else{
+ var args = res.data[0].args
+ var argv = res.data[0].argv
+ var rtn = decoder(argv,args)
+ resolve({
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ passwd: rtn.data,
+ status: "ok",
+ handle: handle_hash
+ })
+ }
+ }
+ })
+ })
+ }
+ else if (event.method == "deleter"){
+ var handle_hash = event.argv.handle
+ var openid = event.argv.openid
+ return new Promise((resolve, reject) => {
+ if (wxContext.OPENID != openid){
+ resolve({
+ status: "failed",
+ openid : openid
+ })
+ }
+ var handle = handle_hash
+ var openid = openid
+ db.collection("passwd-saved").where({
+ handle: handle,
+ openid: wxContext.OPENID
+ }).get().then(res=>{
+ console.log(res)
+ if(res.data.length > 0){
+ db.collection("passwd-saved").doc(res.data[0]._id).remove().then(res => {
+ })
+ resolve({
+ status: "ok",
+ openid: openid
+ })
+ }
+ else{
+ resolve({
+ status: "failed",
+ openid: openid
+ })
+ }
+ })
+
+
+ })
+ }
+}
+
diff --git a/cloudfunctions/passwd/package-lock.json b/cloudfunctions/passwd/package-lock.json
new file mode 100644
index 0000000..881d337
--- /dev/null
+++ b/cloudfunctions/passwd/package-lock.json
@@ -0,0 +1,502 @@
+{
+ "name": "passwd",
+ "version": "1.0.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "@cloudbase/database": {
+ "version": "0.0.9",
+ "resolved": "http://mirrors.tencentyun.com/npm/@cloudbase%2fdatabase/-/database-0.0.9.tgz",
+ "integrity": "sha512-OTlP0HtSxb8xIeaUN5GKq9gHJLHMEwIfqmOD53vFHMsO4IfOjPOVpNfULmCjtS4j2bhMIzFNnzBNjXjzPJLYDA=="
+ },
+ "@protobufjs/aspromise": {
+ "version": "1.1.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2faspromise/-/aspromise-1.1.2.tgz",
+ "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78="
+ },
+ "@protobufjs/base64": {
+ "version": "1.1.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2fbase64/-/base64-1.1.2.tgz",
+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
+ },
+ "@protobufjs/codegen": {
+ "version": "2.0.4",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2fcodegen/-/codegen-2.0.4.tgz",
+ "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
+ },
+ "@protobufjs/eventemitter": {
+ "version": "1.1.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2feventemitter/-/eventemitter-1.1.0.tgz",
+ "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A="
+ },
+ "@protobufjs/fetch": {
+ "version": "1.1.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2ffetch/-/fetch-1.1.0.tgz",
+ "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=",
+ "requires": {
+ "@protobufjs/aspromise": "^1.1.1",
+ "@protobufjs/inquire": "^1.1.0"
+ }
+ },
+ "@protobufjs/float": {
+ "version": "1.0.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2ffloat/-/float-1.0.2.tgz",
+ "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E="
+ },
+ "@protobufjs/inquire": {
+ "version": "1.1.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2finquire/-/inquire-1.1.0.tgz",
+ "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik="
+ },
+ "@protobufjs/path": {
+ "version": "1.1.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2fpath/-/path-1.1.2.tgz",
+ "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0="
+ },
+ "@protobufjs/pool": {
+ "version": "1.1.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2fpool/-/pool-1.1.0.tgz",
+ "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q="
+ },
+ "@protobufjs/utf8": {
+ "version": "1.1.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/@protobufjs%2futf8/-/utf8-1.1.0.tgz",
+ "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
+ },
+ "@types/long": {
+ "version": "4.0.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/@types%2flong/-/long-4.0.0.tgz",
+ "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q=="
+ },
+ "@types/node": {
+ "version": "10.14.7",
+ "resolved": "http://mirrors.tencentyun.com/npm/@types%2fnode/-/node-10.14.7.tgz",
+ "integrity": "sha512-on4MmIDgHXiuJDELPk1NFaKVUxxCFr37tm8E9yN6rAiF5Pzp/9bBfBHkoexqRiY+hk/Z04EJU9kKEb59YqJ82A=="
+ },
+ "ajv": {
+ "version": "6.10.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/ajv/-/ajv-6.10.0.tgz",
+ "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==",
+ "requires": {
+ "fast-deep-equal": "^2.0.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "asn1": {
+ "version": "0.2.4",
+ "resolved": "http://mirrors.tencentyun.com/npm/asn1/-/asn1-0.2.4.tgz",
+ "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
+ "requires": {
+ "safer-buffer": "~2.1.0"
+ }
+ },
+ "assert-plus": {
+ "version": "1.0.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/assert-plus/-/assert-plus-1.0.0.tgz",
+ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
+ },
+ "asynckit": {
+ "version": "0.4.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
+ },
+ "aws-sign2": {
+ "version": "0.7.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/aws-sign2/-/aws-sign2-0.7.0.tgz",
+ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
+ },
+ "aws4": {
+ "version": "1.8.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/aws4/-/aws4-1.8.0.tgz",
+ "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
+ },
+ "bcrypt-pbkdf": {
+ "version": "1.0.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
+ "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
+ "requires": {
+ "tweetnacl": "^0.14.3"
+ }
+ },
+ "caseless": {
+ "version": "0.12.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/caseless/-/caseless-0.12.0.tgz",
+ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
+ },
+ "combined-stream": {
+ "version": "1.0.8",
+ "resolved": "http://mirrors.tencentyun.com/npm/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "requires": {
+ "delayed-stream": "~1.0.0"
+ }
+ },
+ "core-util-is": {
+ "version": "1.0.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/core-util-is/-/core-util-is-1.0.2.tgz",
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+ },
+ "crypto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz",
+ "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig=="
+ },
+ "crypto-js": {
+ "version": "3.1.9-1",
+ "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz",
+ "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg="
+ },
+ "dashdash": {
+ "version": "1.14.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/dashdash/-/dashdash-1.14.1.tgz",
+ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+ "requires": {
+ "assert-plus": "^1.0.0"
+ }
+ },
+ "delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
+ },
+ "ecc-jsbn": {
+ "version": "0.1.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
+ "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
+ "requires": {
+ "jsbn": "~0.1.0",
+ "safer-buffer": "^2.1.0"
+ }
+ },
+ "extend": {
+ "version": "3.0.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/extend/-/extend-3.0.2.tgz",
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
+ },
+ "extsprintf": {
+ "version": "1.3.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/extsprintf/-/extsprintf-1.3.0.tgz",
+ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
+ },
+ "fast-deep-equal": {
+ "version": "2.0.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
+ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.0.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
+ "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
+ },
+ "forever-agent": {
+ "version": "0.6.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/forever-agent/-/forever-agent-0.6.1.tgz",
+ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
+ },
+ "form-data": {
+ "version": "2.3.3",
+ "resolved": "http://mirrors.tencentyun.com/npm/form-data/-/form-data-2.3.3.tgz",
+ "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
+ "requires": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.6",
+ "mime-types": "^2.1.12"
+ }
+ },
+ "function-bind": {
+ "version": "1.1.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ },
+ "getpass": {
+ "version": "0.1.7",
+ "resolved": "http://mirrors.tencentyun.com/npm/getpass/-/getpass-0.1.7.tgz",
+ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+ "requires": {
+ "assert-plus": "^1.0.0"
+ }
+ },
+ "har-schema": {
+ "version": "2.0.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/har-schema/-/har-schema-2.0.0.tgz",
+ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
+ },
+ "har-validator": {
+ "version": "5.1.3",
+ "resolved": "http://mirrors.tencentyun.com/npm/har-validator/-/har-validator-5.1.3.tgz",
+ "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
+ "requires": {
+ "ajv": "^6.5.5",
+ "har-schema": "^2.0.0"
+ }
+ },
+ "has": {
+ "version": "1.0.3",
+ "resolved": "http://mirrors.tencentyun.com/npm/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "requires": {
+ "function-bind": "^1.1.1"
+ }
+ },
+ "http-signature": {
+ "version": "1.2.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/http-signature/-/http-signature-1.2.0.tgz",
+ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+ "requires": {
+ "assert-plus": "^1.0.0",
+ "jsprim": "^1.2.2",
+ "sshpk": "^1.7.0"
+ }
+ },
+ "is-regex": {
+ "version": "1.0.4",
+ "resolved": "http://mirrors.tencentyun.com/npm/is-regex/-/is-regex-1.0.4.tgz",
+ "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
+ "requires": {
+ "has": "^1.0.1"
+ }
+ },
+ "is-typedarray": {
+ "version": "1.0.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/is-typedarray/-/is-typedarray-1.0.0.tgz",
+ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
+ },
+ "isstream": {
+ "version": "0.1.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/isstream/-/isstream-0.1.2.tgz",
+ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
+ },
+ "jsbn": {
+ "version": "0.1.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/jsbn/-/jsbn-0.1.1.tgz",
+ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
+ },
+ "json-schema": {
+ "version": "0.2.3",
+ "resolved": "http://mirrors.tencentyun.com/npm/json-schema/-/json-schema-0.2.3.tgz",
+ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
+ },
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
+ },
+ "jsprim": {
+ "version": "1.4.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/jsprim/-/jsprim-1.4.1.tgz",
+ "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
+ "requires": {
+ "assert-plus": "1.0.0",
+ "extsprintf": "1.3.0",
+ "json-schema": "0.2.3",
+ "verror": "1.10.0"
+ }
+ },
+ "lodash.merge": {
+ "version": "4.6.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/lodash.merge/-/lodash.merge-4.6.1.tgz",
+ "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ=="
+ },
+ "long": {
+ "version": "4.0.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/long/-/long-4.0.0.tgz",
+ "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
+ },
+ "mime-db": {
+ "version": "1.40.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/mime-db/-/mime-db-1.40.0.tgz",
+ "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
+ },
+ "mime-types": {
+ "version": "2.1.24",
+ "resolved": "http://mirrors.tencentyun.com/npm/mime-types/-/mime-types-2.1.24.tgz",
+ "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
+ "requires": {
+ "mime-db": "1.40.0"
+ }
+ },
+ "oauth-sign": {
+ "version": "0.9.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/oauth-sign/-/oauth-sign-0.9.0.tgz",
+ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
+ },
+ "performance-now": {
+ "version": "2.1.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/performance-now/-/performance-now-2.1.0.tgz",
+ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+ },
+ "protobufjs": {
+ "version": "6.8.8",
+ "resolved": "http://mirrors.tencentyun.com/npm/protobufjs/-/protobufjs-6.8.8.tgz",
+ "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==",
+ "requires": {
+ "@protobufjs/aspromise": "^1.1.2",
+ "@protobufjs/base64": "^1.1.2",
+ "@protobufjs/codegen": "^2.0.4",
+ "@protobufjs/eventemitter": "^1.1.0",
+ "@protobufjs/fetch": "^1.1.0",
+ "@protobufjs/float": "^1.0.2",
+ "@protobufjs/inquire": "^1.1.0",
+ "@protobufjs/path": "^1.1.2",
+ "@protobufjs/pool": "^1.1.0",
+ "@protobufjs/utf8": "^1.1.0",
+ "@types/long": "^4.0.0",
+ "@types/node": "^10.1.0",
+ "long": "^4.0.0"
+ }
+ },
+ "psl": {
+ "version": "1.1.31",
+ "resolved": "http://mirrors.tencentyun.com/npm/psl/-/psl-1.1.31.tgz",
+ "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw=="
+ },
+ "punycode": {
+ "version": "2.1.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/punycode/-/punycode-2.1.1.tgz",
+ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
+ },
+ "qs": {
+ "version": "6.5.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/qs/-/qs-6.5.2.tgz",
+ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
+ },
+ "request": {
+ "version": "2.88.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/request/-/request-2.88.0.tgz",
+ "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
+ "requires": {
+ "aws-sign2": "~0.7.0",
+ "aws4": "^1.8.0",
+ "caseless": "~0.12.0",
+ "combined-stream": "~1.0.6",
+ "extend": "~3.0.2",
+ "forever-agent": "~0.6.1",
+ "form-data": "~2.3.2",
+ "har-validator": "~5.1.0",
+ "http-signature": "~1.2.0",
+ "is-typedarray": "~1.0.0",
+ "isstream": "~0.1.2",
+ "json-stringify-safe": "~5.0.1",
+ "mime-types": "~2.1.19",
+ "oauth-sign": "~0.9.0",
+ "performance-now": "^2.1.0",
+ "qs": "~6.5.2",
+ "safe-buffer": "^5.1.2",
+ "tough-cookie": "~2.4.3",
+ "tunnel-agent": "^0.6.0",
+ "uuid": "^3.3.2"
+ }
+ },
+ "safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ },
+ "safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ },
+ "sshpk": {
+ "version": "1.16.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/sshpk/-/sshpk-1.16.1.tgz",
+ "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
+ "requires": {
+ "asn1": "~0.2.3",
+ "assert-plus": "^1.0.0",
+ "bcrypt-pbkdf": "^1.0.0",
+ "dashdash": "^1.12.0",
+ "ecc-jsbn": "~0.1.1",
+ "getpass": "^0.1.1",
+ "jsbn": "~0.1.0",
+ "safer-buffer": "^2.0.2",
+ "tweetnacl": "~0.14.0"
+ }
+ },
+ "tcb-admin-node": {
+ "version": "1.6.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/tcb-admin-node/-/tcb-admin-node-1.6.0.tgz",
+ "integrity": "sha512-GvM5uIB02BeOX9B8XVic3xojOQp0VMa4l7LIonRmsHhjzsiRAb573t37k1a6hl92r5kv4x+NkQEEpP8znXpNPw==",
+ "requires": {
+ "@cloudbase/database": "^0.0.9",
+ "is-regex": "^1.0.4",
+ "lodash.merge": "^4.6.1",
+ "request": "^2.87.0"
+ }
+ },
+ "tough-cookie": {
+ "version": "2.4.3",
+ "resolved": "http://mirrors.tencentyun.com/npm/tough-cookie/-/tough-cookie-2.4.3.tgz",
+ "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
+ "requires": {
+ "psl": "^1.1.24",
+ "punycode": "^1.4.1"
+ },
+ "dependencies": {
+ "punycode": {
+ "version": "1.4.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/punycode/-/punycode-1.4.1.tgz",
+ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4="
+ }
+ }
+ },
+ "tslib": {
+ "version": "1.9.3",
+ "resolved": "http://mirrors.tencentyun.com/npm/tslib/-/tslib-1.9.3.tgz",
+ "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
+ },
+ "tunnel-agent": {
+ "version": "0.6.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
+ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
+ "requires": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "tweetnacl": {
+ "version": "0.14.5",
+ "resolved": "http://mirrors.tencentyun.com/npm/tweetnacl/-/tweetnacl-0.14.5.tgz",
+ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
+ },
+ "uri-js": {
+ "version": "4.2.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/uri-js/-/uri-js-4.2.2.tgz",
+ "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "uuid": {
+ "version": "3.3.2",
+ "resolved": "http://mirrors.tencentyun.com/npm/uuid/-/uuid-3.3.2.tgz",
+ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
+ },
+ "verror": {
+ "version": "1.10.0",
+ "resolved": "http://mirrors.tencentyun.com/npm/verror/-/verror-1.10.0.tgz",
+ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+ "requires": {
+ "assert-plus": "^1.0.0",
+ "core-util-is": "1.0.2",
+ "extsprintf": "^1.2.0"
+ }
+ },
+ "wx-server-sdk": {
+ "version": "0.5.1",
+ "resolved": "http://mirrors.tencentyun.com/npm/wx-server-sdk/-/wx-server-sdk-0.5.1.tgz",
+ "integrity": "sha512-W4rL1mh0pM6dQiZ7OP0YT7t1eoF9Yhs3wKLOZChv5TgOz+esSyR95WeEzsGu0NHpw8C/jVlwfz4YqO9oh87DQQ==",
+ "requires": {
+ "protobufjs": "6.8.8",
+ "tcb-admin-node": "1.6.0",
+ "tslib": "^1.9.3"
+ }
+ }
+ }
+}
diff --git a/cloudfunctions/passwd/package.json b/cloudfunctions/passwd/package.json
new file mode 100644
index 0000000..2b3faed
--- /dev/null
+++ b/cloudfunctions/passwd/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "passwd",
+ "version": "1.0.0",
+ "description": "为用户计算并储存密码,维护密码数据库",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "Saturneric",
+ "license": "ISC",
+ "dependencies": {
+ "wx-server-sdk": "latest",
+ "crypto": "latest",
+ "crypto-js": "latest"
+ }
+}
diff --git a/miniprogram/app.js b/miniprogram/app.js
new file mode 100644
index 0000000..b936d95
--- /dev/null
+++ b/miniprogram/app.js
@@ -0,0 +1,22 @@
+//app.js
+App({
+ onLaunch: function () {
+
+ if (!wx.cloud) {
+ console.error('请使用 2.2.3 或以上的基础库以使用云能力')
+ } else {
+ wx.cloud.init({
+ traceUser: true,
+ env: "ipasswd-7h7iu"
+ })
+ }
+
+ this.globalData = {
+ hasCheckPwd : false,
+ hasRegister : null,
+ openid : null,
+ refresh : false,
+ refreshCheck: false
+ }
+ }
+})
diff --git a/miniprogram/app.json b/miniprogram/app.json
new file mode 100644
index 0000000..7342e9a
--- /dev/null
+++ b/miniprogram/app.json
@@ -0,0 +1,50 @@
+{
+ "pages": [
+ "pages/index/index",
+ "pages/chooseLib/chooseLib",
+ "pages/openapi/openapi",
+ "pages/openapi/serverapi/serverapi",
+ "pages/openapi/callback/callback",
+ "pages/openapi/cloudid/cloudid",
+ "pages/logs/logs",
+ "pages/create/create",
+ "pages/checkPwd/checkPwd",
+ "pages/show/show",
+ "pages/showPwd/showPwd",
+ "pages/showEdit/showEdit"
+ ],
+ "window": {
+ "backgroundColor": "#F6F6F6",
+ "backgroundTextStyle": "light",
+ "navigationBarBackgroundColor": "#3f72af",
+ "navigationBarTitleText": "密码便签",
+ "navigationBarTextStyle": "white"
+ },
+ "tabBar": {
+ "color": "#fff",
+ "selectedColor": "#45deff",
+ "borderStyle": "white",
+ "backgroundColor": "#3f72af",
+ "list": [
+ {
+ "pagePath": "pages/index/index",
+ "text": "资料卡",
+ "iconPath": "images/1-1.png",
+ "selectedIconPath": "images/1-2.png"
+ },
+ {
+ "pagePath": "pages/create/create",
+ "text": "密码便签",
+ "iconPath": "images/2-1.png",
+ "selectedIconPath": "images/2-2.png"
+ },
+ {
+ "pagePath": "pages/logs/logs",
+ "text": "便签集",
+ "iconPath": "images/3-1.png",
+ "selectedIconPath": "images/3-2.png"
+ }
+ ]
+ },
+ "sitemapLocation": "sitemap.json"
+}
\ No newline at end of file
diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss
new file mode 100644
index 0000000..df8911a
--- /dev/null
+++ b/miniprogram/app.wxss
@@ -0,0 +1,178 @@
+/**app.wxss**/
+@import './css/animate.wxss';
+
+@font-face {
+ font-family: 'iconfont'; /* project id 518032 */
+ src: url('//at.alicdn.com/t/font_518032_t2q88z3jok8iwwmi.eot');
+ src: url('//at.alicdn.com/t/font_518032_t2q88z3jok8iwwmi.eot?#iefix') format('embedded-opentype'),
+ url('//at.alicdn.com/t/font_518032_t2q88z3jok8iwwmi.woff') format('woff'),
+ url('//at.alicdn.com/t/font_518032_t2q88z3jok8iwwmi.ttf') format('truetype'),
+ url('//at.alicdn.com/t/font_518032_t2q88z3jok8iwwmi.svg#iconfont') format('svg');
+}
+
+.iconfont {
+ font-family:"iconfont" !important;
+ font-size:60rpx;
+ font-style:normal;
+ -webkit-font-smoothing: antialiase;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-shanchu:before{content: '\e629';}
+.icon-sousuo:before{content: '\e62f';}
+
+.container {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ box-sizing: border-box;
+}
+
+button {
+ background: initial;
+}
+
+button:focus{
+ outline: 0;
+}
+
+button::after{
+ border: none;
+}
+
+
+page {
+ background: #f6f6f6;
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-start;
+}
+
+.userinfo, .uploader, .tunnel {
+ margin-top: 40rpx;
+ height: 140rpx;
+ width: 100%;
+ background: #fff;
+ border: 1px solid rgba(0, 0, 0, 0.1);
+ border-left: none;
+ border-right: none;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ transition: all 300ms ease;
+}
+
+.userinfo-avatar {
+ width: 100rpx;
+ height: 100rpx;
+ margin: 20rpx;
+ border-radius: 50%;
+ background-size: cover;
+ background-color: white;
+}
+
+.userinfo-avatar:after {
+ border: none;
+}
+
+.userinfo-nickname {
+ font-size: 32rpx;
+ color: #007aff;
+ background-color: white;
+ background-size: cover;
+}
+
+.userinfo-nickname::after {
+ border: none;
+}
+
+.uploader, .tunnel {
+ height: auto;
+ padding: 0 0 0 40rpx;
+ flex-direction: column;
+ align-items: flex-start;
+ box-sizing: border-box;
+}
+
+.uploader-text, .tunnel-text {
+ width: 100%;
+ line-height: 52px;
+ font-size: 34rpx;
+ color: #007aff;
+}
+
+.uploader-container {
+ width: 100%;
+ height: 400rpx;
+ padding: 20rpx 20rpx 20rpx 0;
+ display: flex;
+ align-content: center;
+ justify-content: center;
+ box-sizing: border-box;
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
+}
+
+.uploader-image {
+ width: 100%;
+ height: 360rpx;
+}
+
+.tunnel {
+ padding: 0 0 0 40rpx;
+}
+
+.tunnel-text {
+ position: relative;
+ color: #222;
+ display: flex;
+ flex-direction: row;
+ align-content: center;
+ justify-content: space-between;
+ box-sizing: border-box;
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
+}
+
+.tunnel-text:first-child {
+ border-top: none;
+}
+
+.tunnel-switch {
+ position: absolute;
+ right: 20rpx;
+ top: -2rpx;
+}
+
+.disable {
+ color: #888;
+}
+
+.service {
+ position: fixed;
+ right: 40rpx;
+ bottom: 40rpx;
+ width: 140rpx;
+ height: 140rpx;
+ border-radius: 50%;
+ background: linear-gradient(#007aff, #0063ce);
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
+ display: flex;
+ align-content: center;
+ justify-content: center;
+ transition: all 300ms ease;
+}
+
+.service-button {
+ position: absolute;
+ top: 40rpx;
+}
+
+.service:active {
+ box-shadow: none;
+}
+
+.request-text {
+ padding: 20rpx 0;
+ font-size: 24rpx;
+ line-height: 36rpx;
+ word-break: break-all;
+}
diff --git a/miniprogram/css/animate.wxss b/miniprogram/css/animate.wxss
new file mode 100644
index 0000000..41cc528
--- /dev/null
+++ b/miniprogram/css/animate.wxss
@@ -0,0 +1,1823 @@
+@charset "UTF-8";
+
+/*!
+ * animate.css -http://daneden.me/animate
+ * Version - 3.7.0
+ * Licensed under the MIT license - http://opensource.org/licenses/MIT
+ *
+ * Copyright (c) 2018 Daniel Eden
+ */
+
+
+
+@keyframes bounce {
+ from,
+ 20%,
+ 53%,
+ 80%,
+ to {
+ animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ transform: translate3d(0, 0, 0);
+ }
+
+ 40%,
+ 43% {
+ animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+ transform: translate3d(0, -30px, 0);
+ }
+
+ 70% {
+ animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+ transform: translate3d(0, -15px, 0);
+ }
+
+ 90% {
+ transform: translate3d(0, -4px, 0);
+ }
+}
+
+.bounce {
+ animation-name: bounce;
+ transform-origin: center bottom;
+}
+
+@keyframes flash {
+ from,
+ 50%,
+ to {
+ opacity: 1;
+ }
+
+ 25%,
+ 75% {
+ opacity: 0;
+ }
+}
+
+.flash {
+ animation-name: flash;
+}
+
+
+@keyframes pulse {
+ from {
+ transform: scale3d(1, 1, 1);
+ }
+
+ 50% {
+ transform: scale3d(1.05, 1.05, 1.05);
+ }
+
+ to {
+ transform: scale3d(1, 1, 1);
+ }
+}
+
+.pulse {
+ animation-name: pulse;
+}
+
+
+@keyframes rubberBand {
+ from {
+ transform: scale3d(1, 1, 1);
+ }
+
+ 30% {
+ transform: scale3d(1.25, 0.75, 1);
+ }
+
+ 40% {
+ transform: scale3d(0.75, 1.25, 1);
+ }
+
+ 50% {
+ transform: scale3d(1.15, 0.85, 1);
+ }
+
+ 65% {
+ transform: scale3d(0.95, 1.05, 1);
+ }
+
+ 75% {
+ transform: scale3d(1.05, 0.95, 1);
+ }
+
+ to {
+ transform: scale3d(1, 1, 1);
+ }
+}
+
+.rubberBand {
+ animation-name: rubberBand;
+}
+
+
+@keyframes shake {
+ from,
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+
+ 10%,
+ 30%,
+ 50%,
+ 70%,
+ 90% {
+ transform: translate3d(-10px, 0, 0);
+ }
+
+ 20%,
+ 40%,
+ 60%,
+ 80% {
+ transform: translate3d(10px, 0, 0);
+ }
+}
+
+.shake {
+ animation-name: shake;
+}
+
+
+@keyframes headShake {
+ 0% {
+ transform: translateX(0);
+ }
+
+ 6.5% {
+ transform: translateX(-6px) rotateY(-9deg);
+ }
+
+ 18.5% {
+ transform: translateX(5px) rotateY(7deg);
+ }
+
+ 31.5% {
+ transform: translateX(-3px) rotateY(-5deg);
+ }
+
+ 43.5% {
+ transform: translateX(2px) rotateY(3deg);
+ }
+
+ 50% {
+ transform: translateX(0);
+ }
+}
+
+.headShake {
+ animation-timing-function: ease-in-out;
+ animation-name: headShake;
+}
+
+
+@keyframes swing {
+ 20% {
+ transform: rotate3d(0, 0, 1, 15deg);
+ }
+
+ 40% {
+ transform: rotate3d(0, 0, 1, -10deg);
+ }
+
+ 60% {
+ transform: rotate3d(0, 0, 1, 5deg);
+ }
+
+ 80% {
+ transform: rotate3d(0, 0, 1, -5deg);
+ }
+
+ to {
+ transform: rotate3d(0, 0, 1, 0deg);
+ }
+}
+
+.swing {
+ transform-origin: top center;
+ animation-name: swing;
+}
+
+
+@keyframes tada {
+ from {
+ transform: scale3d(1, 1, 1);
+ }
+
+ 10%,
+ 20% {
+ transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
+ }
+
+ 30%,
+ 50%,
+ 70%,
+ 90% {
+ transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
+ }
+
+ 40%,
+ 60%,
+ 80% {
+ transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
+ }
+
+ to {
+ transform: scale3d(1, 1, 1);
+ }
+}
+
+.tada {
+ animation-name: tada;
+}
+
+
+
+@keyframes wobble {
+ from {
+ transform: translate3d(0, 0, 0);
+ }
+
+ 15% {
+ transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
+ }
+
+ 30% {
+ transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
+ }
+
+ 45% {
+ transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
+ }
+
+ 60% {
+ transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
+ }
+
+ 75% {
+ transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.wobble {
+ animation-name: wobble;
+}
+
+@keyframes jello {
+ from,
+ 11.1%,
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+
+ 22.2% {
+ transform: skewX(-12.5deg) skewY(-12.5deg);
+ }
+
+ 33.3% {
+ transform: skewX(6.25deg) skewY(6.25deg);
+ }
+
+ 44.4% {
+ transform: skewX(-3.125deg) skewY(-3.125deg);
+ }
+
+ 55.5% {
+ transform: skewX(1.5625deg) skewY(1.5625deg);
+ }
+
+ 66.6% {
+ transform: skewX(-0.78125deg) skewY(-0.78125deg);
+ }
+
+ 77.7% {
+ transform: skewX(0.390625deg) skewY(0.390625deg);
+ }
+
+ 88.8% {
+ transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
+ }
+}
+
+.jello {
+ animation-name: jello;
+ transform-origin: center;
+}
+
+@keyframes heartBeat {
+ 0% {
+ transform: scale(1);
+ }
+
+ 14% {
+ transform: scale(1.3);
+ }
+
+ 28% {
+ transform: scale(1);
+ }
+
+ 42% {
+ transform: scale(1.3);
+ }
+
+ 70% {
+ transform: scale(1);
+ }
+}
+
+.heartBeat {
+ animation-name: heartBeat;
+ animation-duration: 1.3s;
+ animation-timing-function: ease-in-out;
+}
+
+
+
+@keyframes bounceIn {
+ from,
+ 20%,
+ 40%,
+ 60%,
+ 80%,
+ to {
+ animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ }
+
+ 0% {
+ opacity: 0;
+ transform: scale3d(0.3, 0.3, 0.3);
+ }
+
+ 20% {
+ transform: scale3d(1.1, 1.1, 1.1);
+ }
+
+ 40% {
+ transform: scale3d(0.9, 0.9, 0.9);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: scale3d(1.03, 1.03, 1.03);
+ }
+
+ 80% {
+ transform: scale3d(0.97, 0.97, 0.97);
+ }
+
+ to {
+ opacity: 1;
+ transform: scale3d(1, 1, 1);
+ }
+}
+
+.bounceIn {
+ animation-duration: 0.75s;
+ animation-name: bounceIn;
+}
+
+
+
+@keyframes bounceInDown {
+ from,
+ 60%,
+ 75%,
+ 90%,
+ to {
+ animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ }
+
+ 0% {
+ opacity: 0;
+ transform: translate3d(0, -3000px, 0);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: translate3d(0, 25px, 0);
+ }
+
+ 75% {
+ transform: translate3d(0, -10px, 0);
+ }
+
+ 90% {
+ transform: translate3d(0, 5px, 0);
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.bounceInDown {
+ animation-name: bounceInDown;
+}
+
+
+@keyframes bounceInLeft {
+ from,
+ 60%,
+ 75%,
+ 90%,
+ to {
+ animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ }
+
+ 0% {
+ opacity: 0;
+ transform: translate3d(-3000px, 0, 0);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: translate3d(25px, 0, 0);
+ }
+
+ 75% {
+ transform: translate3d(-10px, 0, 0);
+ }
+
+ 90% {
+ transform: translate3d(5px, 0, 0);
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.bounceInLeft {
+ animation-name: bounceInLeft;
+}
+
+
+
+@keyframes bounceInRight {
+ from,
+ 60%,
+ 75%,
+ 90%,
+ to {
+ animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ }
+
+ from {
+ opacity: 0;
+ transform: translate3d(3000px, 0, 0);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: translate3d(-25px, 0, 0);
+ }
+
+ 75% {
+ transform: translate3d(10px, 0, 0);
+ }
+
+ 90% {
+ transform: translate3d(-5px, 0, 0);
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.bounceInRight {
+ animation-name: bounceInRight;
+}
+
+
+
+@keyframes bounceInUp {
+ from,
+ 60%,
+ 75%,
+ 90%,
+ to {
+ animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+ }
+
+ from {
+ opacity: 0;
+ transform: translate3d(0, 3000px, 0);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: translate3d(0, -20px, 0);
+ }
+
+ 75% {
+ transform: translate3d(0, 10px, 0);
+ }
+
+ 90% {
+ transform: translate3d(0, -5px, 0);
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.bounceInUp {
+ animation-name: bounceInUp;
+}
+
+
+
+@keyframes bounceOut {
+ 20% {
+ transform: scale3d(0.9, 0.9, 0.9);
+ }
+
+ 50%,
+ 55% {
+ opacity: 1;
+ transform: scale3d(1.1, 1.1, 1.1);
+ }
+
+ to {
+ opacity: 0;
+ transform: scale3d(0.3, 0.3, 0.3);
+ }
+}
+
+.bounceOut {
+ animation-duration: 0.75s;
+ animation-name: bounceOut;
+}
+
+
+
+@keyframes bounceOutDown {
+ 20% {
+ transform: translate3d(0, 10px, 0);
+ }
+
+ 40%,
+ 45% {
+ opacity: 1;
+ transform: translate3d(0, -20px, 0);
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(0, 2000px, 0);
+ }
+}
+
+.bounceOutDown {
+ animation-name: bounceOutDown;
+}
+
+
+@keyframes bounceOutLeft {
+ 20% {
+ opacity: 1;
+ transform: translate3d(20px, 0, 0);
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(-2000px, 0, 0);
+ }
+}
+
+.bounceOutLeft {
+ animation-name: bounceOutLeft;
+}
+
+
+
+@keyframes bounceOutRight {
+ 20% {
+ opacity: 1;
+ transform: translate3d(-20px, 0, 0);
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(2000px, 0, 0);
+ }
+}
+
+.bounceOutRight {
+ animation-name: bounceOutRight;
+}
+
+
+
+@keyframes bounceOutUp {
+ 20% {
+ transform: translate3d(0, -10px, 0);
+ }
+
+ 40%,
+ 45% {
+ opacity: 1;
+ transform: translate3d(0, 20px, 0);
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(0, -2000px, 0);
+ }
+}
+
+.bounceOutUp {
+ animation-name: bounceOutUp;
+}
+
+
+
+@keyframes fadeIn {
+ from {
+ opacity: 0;
+ }
+
+ to {
+ opacity: 1;
+ }
+}
+
+.fadeIn {
+ animation-name: fadeIn;
+}
+
+
+
+@keyframes fadeInDown {
+ from {
+ opacity: 0;
+ transform: translate3d(0, -100%, 0);
+ }
+
+ to {
+ opacity: 1;
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.fadeInDown {
+ animation-name: fadeInDown;
+}
+
+
+
+@keyframes fadeInDownBig {
+ from {
+ opacity: 0;
+ transform: translate3d(0, -2000px, 0);
+ }
+
+ to {
+ opacity: 1;
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.fadeInDownBig {
+ animation-name: fadeInDownBig;
+}
+
+
+
+@keyframes fadeInLeft {
+ from {
+ opacity: 0;
+ transform: translate3d(-100%, 0, 0);
+ }
+
+ to {
+ opacity: 1;
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.fadeInLeft {
+ animation-name: fadeInLeft;
+}
+
+
+
+@keyframes fadeInLeftBig {
+ from {
+ opacity: 0;
+ transform: translate3d(-2000px, 0, 0);
+ }
+
+ to {
+ opacity: 1;
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.fadeInLeftBig {
+ animation-name: fadeInLeftBig;
+}
+
+
+
+@keyframes fadeInRight {
+ from {
+ opacity: 0;
+ transform: translate3d(100%, 0, 0);
+ }
+
+ to {
+ opacity: 1;
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.fadeInRight {
+ animation-name: fadeInRight;
+}
+
+
+
+@keyframes fadeInRightBig {
+ from {
+ opacity: 0;
+ transform: translate3d(2000px, 0, 0);
+ }
+
+ to {
+ opacity: 1;
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.fadeInRightBig {
+ animation-name: fadeInRightBig;
+}
+
+
+
+@keyframes fadeInUp {
+ from {
+ opacity: 0;
+ transform: translate3d(0, 100%, 0);
+ }
+
+ to {
+ opacity: 1;
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.fadeInUp {
+ animation-name: fadeInUp;
+}
+
+
+
+@keyframes fadeInUpBig {
+ from {
+ opacity: 0;
+ transform: translate3d(0, 2000px, 0);
+ }
+
+ to {
+ opacity: 1;
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.fadeInUpBig {
+ animation-name: fadeInUpBig;
+}
+
+
+
+@keyframes fadeOut {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ }
+}
+
+.fadeOut {
+ animation-name: fadeOut;
+}
+
+
+
+@keyframes fadeOutDown {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(0, 100%, 0);
+ }
+}
+
+.fadeOutDown {
+ animation-name: fadeOutDown;
+}
+
+
+
+@keyframes fadeOutDownBig {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(0, 2000px, 0);
+ }
+}
+
+.fadeOutDownBig {
+ animation-name: fadeOutDownBig;
+}
+
+
+
+@keyframes fadeOutLeft {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(-100%, 0, 0);
+ }
+}
+
+.fadeOutLeft {
+ animation-name: fadeOutLeft;
+}
+
+
+
+@keyframes fadeOutLeftBig {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(-2000px, 0, 0);
+ }
+}
+
+.fadeOutLeftBig {
+ animation-name: fadeOutLeftBig;
+}
+
+
+
+@keyframes fadeOutRight {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(100%, 0, 0);
+ }
+}
+
+.fadeOutRight {
+ animation-name: fadeOutRight;
+}
+
+
+
+@keyframes fadeOutRightBig {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(2000px, 0, 0);
+ }
+}
+
+.fadeOutRightBig {
+ animation-name: fadeOutRightBig;
+}
+
+
+
+@keyframes fadeOutUp {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(0, -100%, 0);
+ }
+}
+
+.fadeOutUp {
+ animation-name: fadeOutUp;
+}
+
+
+
+@keyframes fadeOutUpBig {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(0, -2000px, 0);
+ }
+}
+
+.fadeOutUpBig {
+ animation-name: fadeOutUpBig;
+}
+
+
+
+@keyframes flip {
+ from {
+ transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg);
+ animation-timing-function: ease-out;
+ }
+
+ 40% {
+ transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
+ rotate3d(0, 1, 0, -190deg);
+ animation-timing-function: ease-out;
+ }
+
+ 50% {
+ transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
+ rotate3d(0, 1, 0, -170deg);
+ animation-timing-function: ease-in;
+ }
+
+ 80% {
+ transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0)
+ rotate3d(0, 1, 0, 0deg);
+ animation-timing-function: ease-in;
+ }
+
+ to {
+ transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg);
+ animation-timing-function: ease-in;
+ }
+}
+
+.animated.flip {
+ backface-visibility: visible;
+ animation-name: flip;
+}
+
+
+
+@keyframes flipInX {
+ from {
+ transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
+ animation-timing-function: ease-in;
+ opacity: 0;
+ }
+
+ 40% {
+ transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
+ animation-timing-function: ease-in;
+ }
+
+ 60% {
+ transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
+ opacity: 1;
+ }
+
+ 80% {
+ transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
+ }
+
+ to {
+ transform: perspective(400px);
+ }
+}
+
+.flipInX {
+ backface-visibility: visible !important;
+ animation-name: flipInX;
+}
+
+
+
+@keyframes flipInY {
+ from {
+ transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
+ animation-timing-function: ease-in;
+ opacity: 0;
+ }
+
+ 40% {
+ transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
+ animation-timing-function: ease-in;
+ }
+
+ 60% {
+ transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
+ opacity: 1;
+ }
+
+ 80% {
+ transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
+ }
+
+ to {
+ transform: perspective(400px);
+ }
+}
+
+.flipInY {
+ backface-visibility: visible !important;
+ animation-name: flipInY;
+}
+
+
+
+@keyframes flipOutX {
+ from {
+ transform: perspective(400px);
+ }
+
+ 30% {
+ transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
+ opacity: 1;
+ }
+
+ to {
+ transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
+ opacity: 0;
+ }
+}
+
+.flipOutX {
+ animation-duration: 0.75s;
+ animation-name: flipOutX;
+ backface-visibility: visible !important;
+}
+
+
+
+@keyframes flipOutY {
+ from {
+ transform: perspective(400px);
+ }
+
+ 30% {
+ transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
+ opacity: 1;
+ }
+
+ to {
+ transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
+ opacity: 0;
+ }
+}
+
+.flipOutY {
+ animation-duration: 0.75s;
+ backface-visibility: visible !important;
+ animation-name: flipOutY;
+}
+
+
+
+@keyframes lightSpeedIn {
+ from {
+ transform: translate3d(100%, 0, 0) skewX(-30deg);
+ opacity: 0;
+ }
+
+ 60% {
+ transform: skewX(20deg);
+ opacity: 1;
+ }
+
+ 80% {
+ transform: skewX(-5deg);
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.lightSpeedIn {
+ animation-name: lightSpeedIn;
+ animation-timing-function: ease-out;
+}
+
+
+
+@keyframes lightSpeedOut {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ transform: translate3d(100%, 0, 0) skewX(30deg);
+ opacity: 0;
+ }
+}
+
+.lightSpeedOut {
+ animation-name: lightSpeedOut;
+ animation-timing-function: ease-in;
+}
+
+
+
+@keyframes rotateIn {
+ from {
+ transform-origin: center;
+ transform: rotate3d(0, 0, 1, -200deg);
+ opacity: 0;
+ }
+
+ to {
+ transform-origin: center;
+ transform: translate3d(0, 0, 0);
+ opacity: 1;
+ }
+}
+
+.rotateIn {
+ animation-name: rotateIn;
+}
+
+
+
+@keyframes rotateInDownLeft {
+ from {
+ transform-origin: left bottom;
+ transform: rotate3d(0, 0, 1, -45deg);
+ opacity: 0;
+ }
+
+ to {
+ transform-origin: left bottom;
+ transform: translate3d(0, 0, 0);
+ opacity: 1;
+ }
+}
+
+.rotateInDownLeft {
+ animation-name: rotateInDownLeft;
+}
+
+
+
+@keyframes rotateInDownRight {
+ from {
+ transform-origin: right bottom;
+ transform: rotate3d(0, 0, 1, 45deg);
+ opacity: 0;
+ }
+
+ to {
+ transform-origin: right bottom;
+ transform: translate3d(0, 0, 0);
+ opacity: 1;
+ }
+}
+
+.rotateInDownRight {
+ animation-name: rotateInDownRight;
+}
+
+
+
+@keyframes rotateInUpLeft {
+ from {
+ transform-origin: left bottom;
+ transform: rotate3d(0, 0, 1, 45deg);
+ opacity: 0;
+ }
+
+ to {
+ transform-origin: left bottom;
+ transform: translate3d(0, 0, 0);
+ opacity: 1;
+ }
+}
+
+.rotateInUpLeft {
+ animation-name: rotateInUpLeft;
+}
+
+
+
+@keyframes rotateInUpRight {
+ from {
+ transform-origin: right bottom;
+ transform: rotate3d(0, 0, 1, -90deg);
+ opacity: 0;
+ }
+
+ to {
+ transform-origin: right bottom;
+ transform: translate3d(0, 0, 0);
+ opacity: 1;
+ }
+}
+
+.rotateInUpRight {
+ animation-name: rotateInUpRight;
+}
+
+
+
+@keyframes rotateOut {
+ from {
+ transform-origin: center;
+ opacity: 1;
+ }
+
+ to {
+ transform-origin: center;
+ transform: rotate3d(0, 0, 1, 200deg);
+ opacity: 0;
+ }
+}
+
+.rotateOut {
+ animation-name: rotateOut;
+}
+
+
+
+@keyframes rotateOutDownLeft {
+ from {
+ transform-origin: left bottom;
+ opacity: 1;
+ }
+
+ to {
+ transform-origin: left bottom;
+ transform: rotate3d(0, 0, 1, 45deg);
+ opacity: 0;
+ }
+}
+
+.rotateOutDownLeft {
+ animation-name: rotateOutDownLeft;
+}
+
+
+
+@keyframes rotateOutDownRight {
+ from {
+ transform-origin: right bottom;
+ opacity: 1;
+ }
+
+ to {
+ transform-origin: right bottom;
+ transform: rotate3d(0, 0, 1, -45deg);
+ opacity: 0;
+ }
+}
+
+.rotateOutDownRight {
+ animation-name: rotateOutDownRight;
+}
+
+
+
+@keyframes rotateOutUpLeft {
+ from {
+ transform-origin: left bottom;
+ opacity: 1;
+ }
+
+ to {
+ transform-origin: left bottom;
+ transform: rotate3d(0, 0, 1, -45deg);
+ opacity: 0;
+ }
+}
+
+.rotateOutUpLeft {
+ animation-name: rotateOutUpLeft;
+}
+
+
+
+@keyframes rotateOutUpRight {
+ from {
+ transform-origin: right bottom;
+ opacity: 1;
+ }
+
+ to {
+ transform-origin: right bottom;
+ transform: rotate3d(0, 0, 1, 90deg);
+ opacity: 0;
+ }
+}
+
+.rotateOutUpRight {
+ animation-name: rotateOutUpRight;
+}
+
+
+
+@keyframes hinge {
+ 0% {
+ transform-origin: top left;
+ animation-timing-function: ease-in-out;
+ }
+
+ 20%,
+ 60% {
+ transform: rotate3d(0, 0, 1, 80deg);
+ transform-origin: top left;
+ animation-timing-function: ease-in-out;
+ }
+
+ 40%,
+ 80% {
+ transform: rotate3d(0, 0, 1, 60deg);
+ transform-origin: top left;
+ animation-timing-function: ease-in-out;
+ opacity: 1;
+ }
+
+ to {
+ transform: translate3d(0, 700px, 0);
+ opacity: 0;
+ }
+}
+
+.hinge {
+ animation-duration: 2s;
+ animation-name: hinge;
+}
+
+
+
+@keyframes jackInTheBox {
+ from {
+ opacity: 0;
+ transform: scale(0.1) rotate(30deg);
+ transform-origin: center bottom;
+ }
+
+ 50% {
+ transform: rotate(-10deg);
+ }
+
+ 70% {
+ transform: rotate(3deg);
+ }
+
+ to {
+ opacity: 1;
+ transform: scale(1);
+ }
+}
+
+.jackInTheBox {
+ animation-name: jackInTheBox;
+}
+
+
+
+@keyframes rollIn {
+ from {
+ opacity: 0;
+ transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg);
+ }
+
+ to {
+ opacity: 1;
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.rollIn {
+ animation-name: rollIn;
+}
+
+
+
+@keyframes rollOut {
+ from {
+ opacity: 1;
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg);
+ }
+}
+
+.rollOut {
+ animation-name: rollOut;
+}
+
+
+@keyframes zoomIn {
+ from {
+ opacity: 0;
+ transform: scale3d(0.3, 0.3, 0.3);
+ }
+
+ 50% {
+ opacity: 1;
+ }
+}
+
+.zoomIn {
+ animation-name: zoomIn;
+}
+
+
+
+@keyframes zoomInDown {
+ from {
+ opacity: 0;
+ transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
+ animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
+ animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
+ }
+}
+
+.zoomInDown {
+ animation-name: zoomInDown;
+}
+
+
+
+@keyframes zoomInLeft {
+ from {
+ opacity: 0;
+ transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0);
+ animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0);
+ animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
+ }
+}
+
+.zoomInLeft {
+ animation-name: zoomInLeft;
+}
+
+
+
+@keyframes zoomInRight {
+ from {
+ opacity: 0;
+ transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
+ animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
+ animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
+ }
+}
+
+.zoomInRight {
+ animation-name: zoomInRight;
+}
+
+
+
+@keyframes zoomInUp {
+ from {
+ opacity: 0;
+ transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
+ animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
+ animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
+ }
+}
+
+.zoomInUp {
+ animation-name: zoomInUp;
+}
+
+
+
+@keyframes zoomOut {
+ from {
+ opacity: 1;
+ }
+
+ 50% {
+ opacity: 0;
+ transform: scale3d(0.3, 0.3, 0.3);
+ }
+
+ to {
+ opacity: 0;
+ }
+}
+
+.zoomOut {
+ animation-name: zoomOut;
+}
+
+
+
+@keyframes zoomOutDown {
+ 40% {
+ opacity: 1;
+ transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
+ animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
+ }
+
+ to {
+ opacity: 0;
+ transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0);
+ transform-origin: center bottom;
+ animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
+ }
+}
+
+.zoomOutDown {
+ animation-name: zoomOutDown;
+}
+
+
+
+@keyframes zoomOutLeft {
+ 40% {
+ opacity: 1;
+ transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0);
+ }
+
+ to {
+ opacity: 0;
+ transform: scale(0.1) translate3d(-2000px, 0, 0);
+ transform-origin: left center;
+ }
+}
+
+.zoomOutLeft {
+ animation-name: zoomOutLeft;
+}
+
+
+
+@keyframes zoomOutRight {
+ 40% {
+ opacity: 1;
+ transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0);
+ }
+
+ to {
+ opacity: 0;
+ transform: scale(0.1) translate3d(2000px, 0, 0);
+ transform-origin: right center;
+ }
+}
+
+.zoomOutRight {
+ animation-name: zoomOutRight;
+}
+
+
+
+@keyframes zoomOutUp {
+ 40% {
+ opacity: 1;
+ transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
+ animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
+ }
+
+ to {
+ opacity: 0;
+ transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0);
+ transform-origin: center bottom;
+ animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
+ }
+}
+
+.zoomOutUp {
+ animation-name: zoomOutUp;
+}
+
+
+
+@keyframes slideInDown {
+ from {
+ transform: translate3d(0, -100%, 0);
+ visibility: visible;
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.slideInDown {
+ animation-name: slideInDown;
+}
+
+
+
+@keyframes slideInLeft {
+ from {
+ transform: translate3d(-100%, 0, 0);
+ visibility: visible;
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.slideInLeft {
+ animation-name: slideInLeft;
+}
+
+
+
+@keyframes slideInRight {
+ from {
+ transform: translate3d(100%, 0, 0);
+ visibility: visible;
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.slideInRight {
+ animation-name: slideInRight;
+}
+
+
+
+@keyframes slideInUp {
+ from {
+ transform: translate3d(0, 100%, 0);
+ visibility: visible;
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+.slideInUp {
+ animation-name: slideInUp;
+}
+
+
+
+@keyframes slideOutDown {
+ from {
+ transform: translate3d(0, 0, 0);
+ }
+
+ to {
+ visibility: hidden;
+ transform: translate3d(0, 100%, 0);
+ }
+}
+
+.slideOutDown {
+ animation-name: slideOutDown;
+}
+
+
+
+@keyframes slideOutLeft {
+ from {
+ transform: translate3d(0, 0, 0);
+ }
+
+ to {
+ visibility: hidden;
+ transform: translate3d(-100%, 0, 0);
+ }
+}
+
+.slideOutLeft {
+ animation-name: slideOutLeft;
+}
+
+
+
+@keyframes slideOutRight {
+ from {
+ transform: translate3d(0, 0, 0);
+ }
+
+ to {
+ visibility: hidden;
+ transform: translate3d(100%, 0, 0);
+ }
+}
+
+.slideOutRight {
+ animation-name: slideOutRight;
+}
+
+
+
+@keyframes slideOutUp {
+ from {
+ transform: translate3d(0, 0, 0);
+ }
+
+ to {
+ visibility: hidden;
+ transform: translate3d(0, -100%, 0);
+ }
+}
+
+.slideOutUp {
+ animation-name: slideOutUp;
+}
+
+.animated {
+ animation-duration: 1s;
+ animation-fill-mode: both;
+}
+
+.animated.infinite {
+ animation-iteration-count: infinite;
+}
+
+.animated.delay-1s {
+ animation-delay: 1s;
+}
+
+.animated.delay-2s {
+ animation-delay: 2s;
+}
+
+.animated.delay-3s {
+ animation-delay: 3s;
+}
+
+.animated.delay-4s {
+ animation-delay: 4s;
+}
+
+.animated.delay-5s {
+ animation-delay: 5s;
+}
+
+.animated.fast {
+ animation-duration: 800ms;
+}
+
+.animated.faster {
+ animation-duration: 500ms;
+}
+
+.animated.slow {
+ animation-duration: 2s;
+}
+
+.animated.slower {
+ animation-duration: 3s;
+}
+
+@media (prefers-reduced-motion) {
+ .animated {
+ animation: unset !important;
+ transition: none !important;
+ }
+}
\ No newline at end of file
diff --git a/miniprogram/images/001-2.png b/miniprogram/images/001-2.png
new file mode 100644
index 0000000..d326e37
Binary files /dev/null and b/miniprogram/images/001-2.png differ
diff --git a/miniprogram/images/001.png b/miniprogram/images/001.png
new file mode 100644
index 0000000..b3a0731
Binary files /dev/null and b/miniprogram/images/001.png differ
diff --git a/miniprogram/images/002-2.png b/miniprogram/images/002-2.png
new file mode 100644
index 0000000..4775cfa
Binary files /dev/null and b/miniprogram/images/002-2.png differ
diff --git a/miniprogram/images/002.png b/miniprogram/images/002.png
new file mode 100644
index 0000000..0b90666
Binary files /dev/null and b/miniprogram/images/002.png differ
diff --git a/miniprogram/images/1-1.png b/miniprogram/images/1-1.png
new file mode 100644
index 0000000..782e48f
Binary files /dev/null and b/miniprogram/images/1-1.png differ
diff --git a/miniprogram/images/1-2.png b/miniprogram/images/1-2.png
new file mode 100644
index 0000000..aac2cbe
Binary files /dev/null and b/miniprogram/images/1-2.png differ
diff --git a/miniprogram/images/2-1.png b/miniprogram/images/2-1.png
new file mode 100644
index 0000000..21d52b8
Binary files /dev/null and b/miniprogram/images/2-1.png differ
diff --git a/miniprogram/images/2-2.png b/miniprogram/images/2-2.png
new file mode 100644
index 0000000..b985fa5
Binary files /dev/null and b/miniprogram/images/2-2.png differ
diff --git a/miniprogram/images/3-1.png b/miniprogram/images/3-1.png
new file mode 100644
index 0000000..7b3a73a
Binary files /dev/null and b/miniprogram/images/3-1.png differ
diff --git a/miniprogram/images/3-2.png b/miniprogram/images/3-2.png
new file mode 100644
index 0000000..5a184f8
Binary files /dev/null and b/miniprogram/images/3-2.png differ
diff --git a/miniprogram/images/code-cloud-callback-config.png b/miniprogram/images/code-cloud-callback-config.png
new file mode 100644
index 0000000..25b0bfc
Binary files /dev/null and b/miniprogram/images/code-cloud-callback-config.png differ
diff --git a/miniprogram/images/code-db-inc-dec.png b/miniprogram/images/code-db-inc-dec.png
new file mode 100644
index 0000000..d8770b1
Binary files /dev/null and b/miniprogram/images/code-db-inc-dec.png differ
diff --git a/miniprogram/images/code-db-onAdd.png b/miniprogram/images/code-db-onAdd.png
new file mode 100644
index 0000000..22c7afb
Binary files /dev/null and b/miniprogram/images/code-db-onAdd.png differ
diff --git a/miniprogram/images/code-db-onQuery.png b/miniprogram/images/code-db-onQuery.png
new file mode 100644
index 0000000..218550d
Binary files /dev/null and b/miniprogram/images/code-db-onQuery.png differ
diff --git a/miniprogram/images/code-db-onRemove.png b/miniprogram/images/code-db-onRemove.png
new file mode 100644
index 0000000..b4eff71
Binary files /dev/null and b/miniprogram/images/code-db-onRemove.png differ
diff --git a/miniprogram/images/code-func-sum.png b/miniprogram/images/code-func-sum.png
new file mode 100644
index 0000000..0414529
Binary files /dev/null and b/miniprogram/images/code-func-sum.png differ
diff --git a/miniprogram/images/console-entrance.png b/miniprogram/images/console-entrance.png
new file mode 100644
index 0000000..bbbb973
Binary files /dev/null and b/miniprogram/images/console-entrance.png differ
diff --git a/miniprogram/images/create-collection.png b/miniprogram/images/create-collection.png
new file mode 100644
index 0000000..e0fdb34
Binary files /dev/null and b/miniprogram/images/create-collection.png differ
diff --git a/miniprogram/pages/checkPwd/checkPwd.js b/miniprogram/pages/checkPwd/checkPwd.js
new file mode 100644
index 0000000..6053b96
--- /dev/null
+++ b/miniprogram/pages/checkPwd/checkPwd.js
@@ -0,0 +1,143 @@
+// miniprogram/pages/checkPwd/checkPwd.js
+const db = wx.cloud.database()
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ hasUserInfo : false,
+ confirmUserInfo : false,
+ userInfo : null,
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ getPwdInfo: function(e){
+ console.log(e)
+ if(e.detail.value.passwd.length < 6){
+ wx.showToast({
+ title: '独立密码长度要为6位',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ else{
+ const that = this;
+ wx.showModal({
+ title: '确认你刚刚输入的密码',
+ content: "“"+e.detail.value.passwd+'”,对吗?',
+ success: function (res) {
+ if (res.confirm) {
+ var nowdate = Date.parse(new Date())
+ console.log("[云函数]调用createUser")
+ wx.cloud.callFunction({
+ name: 'createUser',
+ data: {
+ avatarUrl: that.data.userInfo.avatarUrl,
+ city: that.data.userInfo.city,
+ gender: that.data.userInfo.gender,
+ language: that.data.userInfo.language,
+ nickName: that.data.userInfo.nickName,
+ openid: app.globalData.openid,
+ passwd: String(e.detail.value.passwd),
+ date: nowdate
+ },
+ success: res => {
+ wx.showToast({
+ title: '注册成功',
+ icon: 'success',
+ duration: 1500
+ })
+ app.globalData.hasRegister = true
+ app.globalData.refresh = true
+ setTimeout(function () { wx.navigateBack() }, 1500)
+ },
+ fail :err =>{
+ console.log(err)
+ }
+ })
+ }
+ else if (res.cancel) {
+ wx.showToast({
+ title: '我愿意等你',
+ icon: 'none',
+ duration: 800
+ })
+ }
+ }
+ })
+
+ }
+ },
+
+ confirmUserInfo: function (e) {
+ this.setData({
+ confirmUserInfo: true,
+ })
+ },
+
+ userInfoHandler: function (e) {
+ if(e.detail.errMsg == "getUserInfo:ok"){
+ this.setData({
+ hasUserInfo : true,
+ userInfo : e.detail.userInfo
+ })
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/pages/checkPwd/checkPwd.json b/miniprogram/pages/checkPwd/checkPwd.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/miniprogram/pages/checkPwd/checkPwd.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/pages/checkPwd/checkPwd.wxml b/miniprogram/pages/checkPwd/checkPwd.wxml
new file mode 100644
index 0000000..a5aa08c
--- /dev/null
+++ b/miniprogram/pages/checkPwd/checkPwd.wxml
@@ -0,0 +1,25 @@
+