1 |
|
2 | # 小程序授权插件
|
3 |
|
4 | > si-auth
|
5 |
|
6 | ## 安装
|
7 |
|
8 | ```
|
9 | npm i ylztest || cnpm i ylztest
|
10 |
|
11 | ```
|
12 |
|
13 | ## 使用方式
|
14 |
|
15 | ### props 参数
|
16 | 1. mobile 手机号 (必须传,授权要用)
|
17 | 2. token 参数 (必须传,授权要用)
|
18 |
|
19 | ### 回调事件
|
20 | **onAuthBack(result)**
|
21 |
|
22 | 参数:result 为授权网络请求数据
|
23 |
|
24 | ### demo
|
25 |
|
26 | ```
|
27 | <template lang="wxml" minapp="wepy">
|
28 | <Auth :mobile.sync="mobile" :token.sync="token" @onAuthBack.user="onAuthBack"></Auth>
|
29 | </template>
|
30 |
|
31 | <script>
|
32 | import wepy from 'wepy'
|
33 | import Auth from 'ylztest/Auth'
|
34 | export default class Demo extends wepy.page {
|
35 | components = {
|
36 | Auth
|
37 | };
|
38 | data = {
|
39 | mobile: '18511580429',
|
40 | token: 'test-token'
|
41 | }
|
42 | onShow () {
|
43 | }
|
44 | methods = {
|
45 | onAuthBack (result) {
|
46 | console.info(result)
|
47 | }
|
48 | }
|
49 | }
|
50 | </script>
|
51 |
|
52 | ``` |
\ | No newline at end of file |