Skip to content

Commit

Permalink
✨ feat(tools): 增加微信key计算工具
Browse files Browse the repository at this point in the history
  • Loading branch information
lqzhgood committed Dec 9, 2023
1 parent ff2db67 commit ec09c04
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ export default defineConfig({
{ text: '常见问题', link: '/guide/setup-runtime/Q&A' },
],
},
{
text: '工具',
collapsed: true,
items: [{ text: 'Wechat', collapsed: true, items: [{ text: '计算数据库Key', link: '/guide/tools/Wechat/calc-wechat-key' }] }],
},
{
text: '其他',
items: [
Expand Down
49 changes: 49 additions & 0 deletions docs/guide/tools/Wechat/calc-wechat-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 计算微信数据库 key

<script>
import MD5 from 'md5'

export default {
data: () => ({
_IMEI:'',
uni:''
}),
computed:{
IMEI: {
get() {
return this._IMEI
},
set(value) {
this._IMEI = value.toUpperCase();
}
},
key(){
if (!this.IMEI|| !this.uni) return '';
const full = this.IMEI + '' + this.uni;
const key = MD5(full).substring(0, 7).toLowerCase()
return key;
}
}
};
</script>

<div>
<div class="form">
<label for="IMEI">
<span>IMEI: </span>
<input type="text" name="IMEI" v-model.lazy.trim="IMEI" placeholder="请输入 IMEI"/>
</label>
<br />
<label for="uni">
<span>uni: </span>
<input type="text" name="uni" v-model.lazy.trim="uni" placeholder="请输入 uni" />
</label>
</div>
<p>key: {{ key }}</p>
</div>

<style lang="sass">
.form
input
border: 1px solid #333
</style>
57 changes: 57 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"dependencies": {
"lodash": "^4.17.21",
"md5": "^2.3.0",
"vitepress": "^1.0.0-rc.31",
"vue": "^3.3.8",
"vue-select": "^4.0.0-beta.6"
Expand Down

0 comments on commit ec09c04

Please sign in to comment.