Răsfoiți Sursa

Update:最新版本小程序,由于微信小程序规则限制,未上市场

Jinhui Zhu 5 ani în urmă
părinte
comite
bf35e4f2d1

+ 0 - 25
app.js

@@ -2,30 +2,6 @@
 const appConfig = require('config')
 App({
   onLaunch: function () {
-    // 展示本地存储能力
-    // 登录
-    /*
-    wx.login({
-      success: res => {
-        this.log("wx.login", res);
-        // 发送 res.code 到后台换取 openId, sessionKey, unionId
-      } 
-    })
-    var _this = this;
-    wx.getNetworkType({
-      success(res) {
-        _this.globalData.networkType = res.networkType
-        console.log(_this.globalData.networkType);
-      },
-      complete : function(res){
-        console.log("complete", res);
-      }
-    })
-    wx.onNetworkStatusChange(function (res) {
-      console.log("res.isConnected", res.isConnected)
-      console.log("res.networkType", res.networkType)
-    })*/
-
     wx.getSystemInfo({
       success: e => {
         this.globalData.StatusBar = e.statusBarHeight;
@@ -34,7 +10,6 @@ App({
         this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
       }
     })
-
     // 获取用户信息
     this.login();
   },

+ 1 - 1
pages/components/about/about.wxml

@@ -1,6 +1,6 @@
 <scroll-view scroll-y class="scrollPage padding-tabbar">
   <view class="UCenter-bg">
-    <image src="/images/logo.png" class="png" mode="widthFix"></image>
+    <image src="/images/logo.png"></image>
     <view class="text-xl">密码本
       <text class="text-df">v1.0</text>
     </view>

+ 0 - 1
pages/components/about/about.wxss

@@ -19,7 +19,6 @@
 
 .UCenter-bg image {
   width: 200rpx;
-  height: 200rpx;
 }
 
 .UCenter-bg .gif-wave{

+ 1 - 1
pages/components/album/album.wxml

@@ -16,7 +16,7 @@
       <view class="cu-form-group bg-white">
         <view class="grid col-4 grid-square flex-sub">
           <view class="bg-img" wx:for="{{imgList}}" wx:key="{{index}}" bindtap="ViewImage" data-url="{{imgList[index]}}">
-            <image src='{{imgList[index]}}' mode='aspectFill'></image>
+            <image src='{{imgList[index]}}' mode='aspectFit'></image>
             <view class="cu-tag bg-red" catchtap="DelImg" data-index="{{index}}">
               <text class="cuIcon-close"></text>
             </view>

+ 0 - 2
pages/index/index.js

@@ -156,7 +156,6 @@ Page({
   },
   onPullDownRefresh: function () {
     if (this.data.PageCur == 'album') {
-      app.log('album onPullDownRefresh');
       this.album.onPullDownRefresh();
       return;
     }
@@ -173,7 +172,6 @@ Page({
   },
   onReachBottom: function () {
     if (this.data.PageCur == 'album') {
-      app.log('album onReachBottom');
       this.album.onReachBottom();
       return;
     }

+ 13 - 2
pages/password/password.js

@@ -22,6 +22,7 @@ Page({
     background: "",
     isEdit : false,
     passwordLength : 12,
+    randCombin: "alpha,smallLetter,bigLetter,specialChars",
   },
   inputAction: function(e) {
     var name = e.target.dataset.id;
@@ -36,11 +37,22 @@ Page({
     data[name] = e.detail.value;
     this.setData(data);
   },
+  checkboxAction:function(e){
+    var arr = [];
+    e.detail.value.forEach(current => {
+      arr.push(current);
+    });
+
+    this.setData({
+      randCombin : arr.join(",")
+    });
+    this.randPassword();
+  },
   getBack: function() {
     wx.navigateBack();
   },
   randPassword: function() {
-    var passwd = rand.randCombin("alpha,smallLetter,bigLetter,specialChars", this.data.passwordLength, true);
+    var passwd = rand.randCombin(this.data.randCombin, this.data.passwordLength, true);
     this.setData({
       password: passwd
     });
@@ -127,7 +139,6 @@ Page({
         }
       })
     }
-    app.log("serverInfo", serverInfo)
     if (app.globalData.info != null && typeof app.globalData.info == 'object') {
       //去掉服务端解密过程
       //common.decrypt(app.globalData.info.password, serverInfo.sslKeys.privateKey);

+ 10 - 1
pages/password/password.wxml

@@ -12,7 +12,7 @@
     </view>
     <view class="cu-form-group">
       <view class="title">账户</view>
-      <input name="account" id="account" placeholder="账户名称" bindinput="inputAction" data-id="account" value='{{account}}'></input>
+      <input name="account" id="account" placeholder="账户" bindinput="inputAction" data-id="account" value='{{account}}'></input>
     </view>
     <view class='cu-form-group'>
       <view class='title'>密码长度</view>
@@ -20,6 +20,15 @@
       <input class='text-center' type='text' placeholder="密码长度" bindinput="inputAction" id="passwordLength" data-id="passwordLength" value="{{passwordLength}}" disabled='disabled'></input>
       <text class='cuIcon-triangleupfill bigTriangle text-orange' bindtap="addLength"></text>
     </view>
+    <view class="cu-form-group">
+      <view class="title"></view>
+      <checkbox-group bindchange="checkboxAction">
+        <checkbox name="combin" value="smallLetter" checked="checked"></checkbox> 字母
+        <checkbox name="combin" value="bigLetter" checked="checked"></checkbox> 大写
+        <checkbox name="combin" value="alpha" checked="checked"></checkbox> 数字
+        <checkbox name="combin" value="specialChars" checked="checked"></checkbox> 特殊字符
+      </checkbox-group>
+    </view>
     <view class="cu-form-group">
       <view class="title">密码</view>
       <input name="password" id="password" placeholder="密码,将会通过公钥加密存储到服务器" bindinput="inputAction" data-id="password" value='{{password}}'></input>

+ 1 - 1
sitemap.json

@@ -1,5 +1,5 @@
 {
-  "desc": "关于本文件的更多信息,请参考文档 https://www.travelzs.com/password.html",
+  "desc": "关于本文件的更多信息,请参考文档 https://www.travelzs.com/help.html",
   "rules": [{
   "action": "allow",
   "page": "*"

+ 0 - 5
utils/util.js

@@ -137,11 +137,6 @@ var genSslKey = function(){
   crypt.getKey();
   var publicKey = crypt.getPublicKey();
   var privateKey = crypt.getPrivateKey();
-  // 去除-----*** RSA **** KEY----- 和空格换行
-  //publicKey = (publicKey.split('-----'))[2];
-  //publicKey = publicKey.replace(/\n/g, "").replace(/\r/g, "").replace(/\t/g, "").replace(/\s*/g, "");
-  //privateKey = (privateKey.split('-----'))[2];
-  //privateKey = privateKey.replace(/\n/g, "").replace(/\r/g, "").replace(/\t/g, "").replace(/\s*/g, "");
   return {
     publicKey : publicKey,
     privateKey : privateKey