qlfy-postmate 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,7 +50,35 @@ const childrenComm = new ChildPostmate({
|
|
|
50
50
|
|
|
51
51
|
3、error、success函数仅作为链接状态的标注函数,不传递数据
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### 接入步骤
|
|
56
|
+
|
|
57
|
+
1. 对系统登录状态进行改造,系统加载时先将登陆状态判断屏蔽
|
|
58
|
+
|
|
59
|
+
2. 系统公共部分(app.vue)对该插件进行导入和 new,创建实例,并传入相应回调
|
|
60
|
+
|
|
61
|
+
3. 等待回调被执行,并做出以下操作:
|
|
62
|
+
|
|
63
|
+
------- 如果error回调执行:解除对登录状态的屏蔽;
|
|
64
|
+
|
|
65
|
+
------- 如果success回调执行:
|
|
66
|
+
|
|
67
|
+
2.1、保持对登录状态的屏蔽,并等待receive回调执行;
|
|
68
|
+
|
|
69
|
+
2.2、receive回调执行:
|
|
70
|
+
|
|
71
|
+
(1)使用接收数据中的token、loginInfo数据,将本地的登陆状态设置为已登录,后续接口请求时携带本回调传入的token;
|
|
72
|
+
|
|
73
|
+
(2)使用接收数据中的isHideHeader字段,对本系统页头的显隐进行控制
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<my-header v-if="!isHideHeader" />
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
(3)解除对登陆状态判断的屏蔽(因已使用接收的数据配置了登录状态,不会触发本系统的登陆);
|
|
80
|
+
|
|
81
|
+
### 样例:
|
|
54
82
|
|
|
55
83
|
App.vue
|
|
56
84
|
|
|
@@ -77,9 +105,9 @@ import { ChildPostmate } from 'qlfy-postmate'
|
|
|
77
105
|
|
|
78
106
|
// 系统loading
|
|
79
107
|
const loading = ref(false)
|
|
80
|
-
//
|
|
108
|
+
// 页头是否展示
|
|
81
109
|
const isHideHeader = ref(false)
|
|
82
|
-
//
|
|
110
|
+
// pinia系统数据管理对象
|
|
83
111
|
const systemStore = useSystemStore()
|
|
84
112
|
|
|
85
113
|
initPostMate()
|
|
@@ -125,3 +153,19 @@ function initPostMate() {
|
|
|
125
153
|
|
|
126
154
|
```
|
|
127
155
|
|
|
156
|
+
### 集成调试
|
|
157
|
+
|
|
158
|
+
按下面链接格式在浏览器中访问,该链接支持前端的本地调试
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
http://10.76.91.80:28084/test?url=本地前端服务地址
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
url后配置本地所启用的前端服务
|
|
165
|
+
|
|
166
|
+
例:
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
http://10.76.91.80:28084/test?url=http://192.168.3.136:8080/
|
|
170
|
+
```
|
|
171
|
+
|