48 lines
2.0 KiB
Plaintext
48 lines
2.0 KiB
Plaintext
<view class="container">
|
||
<view class="page-header">
|
||
<view class="page-title">安全工具</view>
|
||
<view class="page-subtitle">生成密码与加解密</view>
|
||
</view>
|
||
<view class="card">
|
||
<view class="card-title">生成密码</view>
|
||
<view class="section-title">长度</view>
|
||
<input class="input" type="number" data-key="length" value="{{length}}" bindinput="onInput" />
|
||
<view class="section-title">类型(mix/num/alpha)</view>
|
||
<input class="input" data-key="type" value="{{type}}" bindinput="onInput" />
|
||
<view class="row action-row">
|
||
<button class="btn" bindtap="generate">生成</button>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="card-title">加密/解密</view>
|
||
<view class="section-title">明文</view>
|
||
<textarea class="textarea" data-key="plaintext" value="{{plaintext}}" bindinput="onInput" placeholder="请输入明文"></textarea>
|
||
<view class="row action-row">
|
||
<button class="btn" bindtap="encrypt">加密</button>
|
||
</view>
|
||
<view class="section-title" style="margin-top:20rpx;">密文</view>
|
||
<textarea class="textarea" data-key="ciphertext" value="{{ciphertext}}" bindinput="onInput" placeholder="请输入密文"></textarea>
|
||
<view class="row action-row">
|
||
<button class="btn" bindtap="decrypt">解密</button>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card result-card" wx:if="{{result}}">
|
||
<view class="result-header">
|
||
<view class="result-title">结果</view>
|
||
<view class="badge">原始数据</view>
|
||
</view>
|
||
<view class="result-hint">已为你保留完整响应</view>
|
||
<view wx:if="{{resultCards.length}}" class="list">
|
||
<view wx:for="{{resultCards}}" wx:key="label" class="card card--inner list-item">
|
||
<view class="row" style="justify-content: space-between;">
|
||
<view class="module-title">{{item.label}}</view>
|
||
<view class="badge">{{item.value}}</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="result">{{result}}</view>
|
||
</view>
|
||
</view>
|