jufubao-base 1.0.72 → 1.0.73-beta1
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/package.json
CHANGED
package/src/common/authorize.js
CHANGED
|
@@ -29,6 +29,7 @@ class JfbAuthorize {
|
|
|
29
29
|
'card': 'JFB-CARD-TOKEN-{siteID}',
|
|
30
30
|
'refresh': 'JFB-REFRESH-TOKEN-{siteID}',
|
|
31
31
|
'access': 'JFB-ACCESS-TOKEN',
|
|
32
|
+
'cardCode':'JFB-CARD-CODE-{siteID}'
|
|
32
33
|
}, settings.token? settings.token: {});
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -40,6 +41,7 @@ class JfbAuthorize {
|
|
|
40
41
|
* @returns {string|*}
|
|
41
42
|
*/
|
|
42
43
|
getTokenKeyword(key){
|
|
44
|
+
|
|
43
45
|
if (!this.config[key]) key = 'user';
|
|
44
46
|
if(key === 'access') return this.config.access;
|
|
45
47
|
else{
|
|
@@ -83,6 +85,8 @@ class JfbAuthorize {
|
|
|
83
85
|
*/
|
|
84
86
|
removeToken(key, options = {}) {
|
|
85
87
|
key = this.getTokenKeyword(key);
|
|
88
|
+
let codeKey = this.getTokenKeyword('cardCode');
|
|
89
|
+
debugger
|
|
86
90
|
//#ifdef H5
|
|
87
91
|
cookie.remove(key, options);
|
|
88
92
|
console.warn(`cookie.key=${key}`);
|
|
@@ -142,7 +146,7 @@ class JfbAuthorize {
|
|
|
142
146
|
* @description 跳转到用户登陆页面
|
|
143
147
|
* @param $vm {Vue}
|
|
144
148
|
*/
|
|
145
|
-
jumpToUserLogin($vm) {
|
|
149
|
+
jumpToUserLogin($vm,isRedirect) {
|
|
146
150
|
let redirect_url = '';
|
|
147
151
|
if(store.state.configProject.platform === 'mp.weixin') {
|
|
148
152
|
redirect_url = $vm['$xdUniHelper'].parseURL().source;
|
|
@@ -131,4 +131,13 @@ module.exports = [
|
|
|
131
131
|
provider_id: ['登陆提供者id', 'String', '必选']
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
+
{
|
|
135
|
+
mapFnName: 'loginExperience',
|
|
136
|
+
title: '体验码登录',
|
|
137
|
+
path: '/passport-pb/v1/user/login-experience',
|
|
138
|
+
isRule: false,
|
|
139
|
+
params: {
|
|
140
|
+
experience_code: ['体验码code', 'String', '必选'],
|
|
141
|
+
}
|
|
142
|
+
},
|
|
134
143
|
];
|
|
@@ -170,6 +170,23 @@
|
|
|
170
170
|
>忘记密码</view
|
|
171
171
|
>
|
|
172
172
|
</view>
|
|
173
|
+
<view class="bottom_btn" :style="prod_bottom">
|
|
174
|
+
<view @click="dialogPreview = true" :style="{
|
|
175
|
+
color: mainColor,
|
|
176
|
+
border: `1px solid ${mainColor}`
|
|
177
|
+
}">进入体验 ></view>
|
|
178
|
+
</view>
|
|
179
|
+
<xd-dailog
|
|
180
|
+
title="体验码"
|
|
181
|
+
:show.sync="dialogPreview"
|
|
182
|
+
:cancel="false"
|
|
183
|
+
confirm-text="进入体验模式"
|
|
184
|
+
@onBtn="handlePreview"
|
|
185
|
+
>
|
|
186
|
+
<view class="preview-login">
|
|
187
|
+
<input v-model="previewAccout" type="text" class="preview-login-input" placeholder="请输入体验码">
|
|
188
|
+
</view>
|
|
189
|
+
</xd-dailog>
|
|
173
190
|
</view>
|
|
174
191
|
</view>
|
|
175
192
|
</template>
|
|
@@ -187,6 +204,7 @@ import XdFormCheckbox from "@/components/XdFormCheckbox/XdFormCheckbox";
|
|
|
187
204
|
import XdFormInput from "@/components/XdFormInput/XdFormInput";
|
|
188
205
|
import XdForm from "@/components/XdForm/XdForm";
|
|
189
206
|
import XdFormItem from "@/components/XdFormItem/XdFormItem";
|
|
207
|
+
import XdDailog from "@/components/XdDailog/XdDailog.vue";
|
|
190
208
|
import { Base64 } from "js-base64";
|
|
191
209
|
import { mapState } from "vuex";
|
|
192
210
|
import getServiceUrl from "@/common/getServiceUrl";
|
|
@@ -208,15 +226,19 @@ export default {
|
|
|
208
226
|
XdFormInput,
|
|
209
227
|
XdForm,
|
|
210
228
|
XdFormItem,
|
|
229
|
+
XdDailog
|
|
211
230
|
},
|
|
212
231
|
mixins: [componentsMixins, extsMixins, JfbBaseLoginMixin, privacyMixins],
|
|
213
232
|
data() {
|
|
214
233
|
return {
|
|
234
|
+
//体验模式
|
|
235
|
+
dialogPreview: false,
|
|
236
|
+
previewAccout: '',
|
|
237
|
+
|
|
215
238
|
showStep: 1,
|
|
216
239
|
panel_1_checked: "",
|
|
217
240
|
panel_2_checked: "",
|
|
218
241
|
password: "",
|
|
219
|
-
//todo
|
|
220
242
|
accountLoginType: "phone", //phone: 验证码登录 pwd: 密码登录
|
|
221
243
|
accountForm: {
|
|
222
244
|
phone_number: "", //15801505541
|
|
@@ -265,6 +287,9 @@ export default {
|
|
|
265
287
|
panelTwoIsChecked() {
|
|
266
288
|
return this.panel_2_checked.includes(1);
|
|
267
289
|
},
|
|
290
|
+
prod_bottom() {
|
|
291
|
+
return this.fixedStyle({ height: 0, zIndex: 111 });
|
|
292
|
+
},
|
|
268
293
|
},
|
|
269
294
|
watch: {
|
|
270
295
|
container(value) {
|
|
@@ -296,16 +321,46 @@ export default {
|
|
|
296
321
|
url: `/pages/content/content?${params}`
|
|
297
322
|
})
|
|
298
323
|
},
|
|
299
|
-
|
|
300
|
-
|
|
324
|
+
|
|
325
|
+
loginPreview(experience_code){
|
|
326
|
+
return new Promise((resolve,reject)=>{
|
|
327
|
+
jfbRootExec("loginExperience", {
|
|
328
|
+
vm: this,
|
|
329
|
+
data: {experience_code},
|
|
330
|
+
}).then(res=>{
|
|
331
|
+
resolve(res)
|
|
332
|
+
}).catch(err=>{
|
|
333
|
+
reject(err)
|
|
334
|
+
})
|
|
335
|
+
})
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
async handlePreview(){
|
|
339
|
+
if(!this.previewAccout) {
|
|
340
|
+
this.$xdAlert({
|
|
341
|
+
content: '请输入体验码',
|
|
342
|
+
type:'error'
|
|
343
|
+
});
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
this.$xdShowLoading({});
|
|
347
|
+
try{
|
|
348
|
+
const res = await this.loginPreview(this.previewAccout);
|
|
349
|
+
if(res) this.jfbAuthorize.setAllToken(res);
|
|
350
|
+
this.toHomeAfterLogin();
|
|
351
|
+
this.$xdHideLoading();
|
|
352
|
+
}catch (e){
|
|
353
|
+
this.$xdHideLoading();
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
|
|
357
|
+
|
|
301
358
|
onJfbLoad(options) {
|
|
302
359
|
this.redirect_url = options.redirect_url ? Base64.decode(options.redirect_url): '';
|
|
303
360
|
// #ifdef MP-WEIXIN
|
|
304
361
|
this.authWxMpListProviders();
|
|
305
362
|
// #endif
|
|
306
|
-
|
|
307
363
|
this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.start')
|
|
308
|
-
|
|
309
364
|
// #ifdef H5
|
|
310
365
|
try{
|
|
311
366
|
this.authH5ListProviders();
|
|
@@ -313,7 +368,6 @@ export default {
|
|
|
313
368
|
this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.error');
|
|
314
369
|
this.$xdLog.setARMSError(error);
|
|
315
370
|
}
|
|
316
|
-
|
|
317
371
|
//#endif
|
|
318
372
|
|
|
319
373
|
// if (options.isDebug === "1") {
|
|
@@ -354,7 +408,7 @@ export default {
|
|
|
354
408
|
this.phone_number_collect_url = getContainerPropsValue(value, "content.phone_number_collect_url", {value: ''}).value;
|
|
355
409
|
this.forget_pwd_url = getContainerPropsValue(value, "content.forget_pwd_url", {value: ''}).value;
|
|
356
410
|
this.error_callback_url = getContainerPropsValue(value, "content.error_url", {value: ''}).value;
|
|
357
|
-
|
|
411
|
+
|
|
358
412
|
},
|
|
359
413
|
|
|
360
414
|
/**
|
|
@@ -464,22 +518,22 @@ export default {
|
|
|
464
518
|
"62fde99f2583a19c58fd937b",
|
|
465
519
|
"62fde9432583a19c58fd937a",
|
|
466
520
|
];
|
|
467
|
-
|
|
521
|
+
|
|
468
522
|
let { redirect_url, callback_url } = this;
|
|
469
|
-
|
|
523
|
+
|
|
470
524
|
//不同项目直接域名替换
|
|
471
525
|
if (/^(@site_domain@).+$/.test(redirect_url)) {
|
|
472
526
|
redirect_url = redirect_url.replace(/@site_domain@/, location.origin)
|
|
473
527
|
}
|
|
474
|
-
|
|
528
|
+
|
|
475
529
|
try {
|
|
476
530
|
let redirectURL = new URL(redirect_url);
|
|
477
531
|
redirect_url = redirectURL.href;
|
|
478
532
|
} catch (e) {
|
|
479
533
|
redirect_url = location.origin + this.base + redirect_url;
|
|
480
534
|
}
|
|
481
|
-
|
|
482
|
-
|
|
535
|
+
|
|
536
|
+
|
|
483
537
|
let params = {
|
|
484
538
|
providers: providers.join(","),
|
|
485
539
|
callback_url: redirect_url,
|
|
@@ -487,9 +541,9 @@ export default {
|
|
|
487
541
|
phone_number_collect_url: location.origin + this.base + this.phone_number_collect_url,
|
|
488
542
|
error_callback_url: location.origin + this.base + this.error_callback_url,
|
|
489
543
|
};
|
|
490
|
-
|
|
544
|
+
|
|
491
545
|
this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.loading..');
|
|
492
|
-
|
|
546
|
+
|
|
493
547
|
jfbRootExec("listSiteProvider", {
|
|
494
548
|
vm: this,
|
|
495
549
|
data: params,
|
|
@@ -701,7 +755,7 @@ export default {
|
|
|
701
755
|
margin-left: unit(20,rpx) !important;
|
|
702
756
|
}
|
|
703
757
|
}
|
|
704
|
-
|
|
758
|
+
|
|
705
759
|
.form-group {
|
|
706
760
|
padding: 40rpx 70rpx;
|
|
707
761
|
}
|
|
@@ -851,4 +905,45 @@ export default {
|
|
|
851
905
|
.login-pub {
|
|
852
906
|
margin-top: unit(40, rpx);
|
|
853
907
|
}
|
|
908
|
+
.bottom_btn {
|
|
909
|
+
position: fixed;
|
|
910
|
+
width: 100%;
|
|
911
|
+
display:flex;
|
|
912
|
+
justify-content: center;
|
|
913
|
+
align-items: center;
|
|
914
|
+
height: unit(100, rpx);
|
|
915
|
+
background: #ffffff;
|
|
916
|
+
|
|
917
|
+
& > view {
|
|
918
|
+
height: unit(44, rpx);
|
|
919
|
+
line-height: unit(44, rpx);
|
|
920
|
+
width: unit(150, rpx);
|
|
921
|
+
text-align: center;
|
|
922
|
+
cursor: pointer;
|
|
923
|
+
font-size: unit(24, rpx);
|
|
924
|
+
border-radius: unit(12, rpx);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
.preview-login {
|
|
929
|
+
padding: unit(40, rpx) 0;
|
|
930
|
+
|
|
931
|
+
&-input {
|
|
932
|
+
height: unit(70, rpx);
|
|
933
|
+
border-radius: unit(12, rpx);
|
|
934
|
+
padding: 0 unit(20, rpx);
|
|
935
|
+
text-align: left;
|
|
936
|
+
border: 1px solid #eee;
|
|
937
|
+
background: #F7F7F7;
|
|
938
|
+
color: #666;
|
|
939
|
+
transition: box-shadow 0.5s;
|
|
940
|
+
box-shadow: 0 0 0 rgba(0,0,0,0);
|
|
941
|
+
|
|
942
|
+
&:hover {
|
|
943
|
+
box-shadow: 0 0 unit(10, rpx) rgba(0,0,0,.1);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
|
|
854
949
|
</style>
|
|
@@ -37,19 +37,20 @@
|
|
|
37
37
|
<xd-font-icon :color="color" icon="iconwode_mian" size="100"></xd-font-icon>
|
|
38
38
|
</view>
|
|
39
39
|
</template>
|
|
40
|
-
<view class="no-image" :style="{borderColor: color}"
|
|
40
|
+
<view v-else class="no-image" :style="{borderColor: color}">
|
|
41
41
|
<xd-font-icon :color="color" icon="iconwode_mian" size="90"></xd-font-icon>
|
|
42
42
|
</view>
|
|
43
|
+
|
|
43
44
|
<view v-if="logined && textType ==='N'" :style="{color:color}">{{userInfo|getName}}</view>
|
|
44
45
|
<view class="vertical-user" v-if="logined && textType ==='Y'" :style="{color:color}">
|
|
45
46
|
<view>{{userInfo|getName}}</view>
|
|
46
|
-
<view @click="handleToLink()"
|
|
47
|
+
<view @click="handleToLink()">
|
|
47
48
|
<xd-font-icon :color="color" size="40" icon="iconshezhi_mian"></xd-font-icon>
|
|
48
49
|
</view>
|
|
49
50
|
</view>
|
|
50
51
|
</view>
|
|
51
|
-
<view @click="
|
|
52
|
-
<
|
|
52
|
+
<view @click="handleLogout()" v-if="logined" class="logout">
|
|
53
|
+
<view v-if="textType ==='N'">[退出登录]</view>
|
|
53
54
|
</view>
|
|
54
55
|
</view>
|
|
55
56
|
</view>
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
import extsMixins from "@/mixins/extsMixins"
|
|
65
66
|
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
66
67
|
import {mapState} from 'vuex';
|
|
68
|
+
import store from "@/store";
|
|
67
69
|
export default {
|
|
68
70
|
name: "JfbBaseUserInfo",
|
|
69
71
|
components: {
|
|
@@ -72,7 +74,7 @@
|
|
|
72
74
|
mixins: [componentsMixins,extsMixins,JfbBaseUserInfoMixin],
|
|
73
75
|
computed: {
|
|
74
76
|
...mapState(['jfbAuthorize']),
|
|
75
|
-
|
|
77
|
+
|
|
76
78
|
outMargin() {
|
|
77
79
|
let margin = `${this.margin.top !== null ? this.margin.top : 20}rpx`;
|
|
78
80
|
margin = `${margin} ${this.margin.right !== null ? this.margin.right : 20}rpx`;
|
|
@@ -106,24 +108,24 @@
|
|
|
106
108
|
logined: false,
|
|
107
109
|
userInfo: null,
|
|
108
110
|
address_url: '',
|
|
109
|
-
|
|
111
|
+
|
|
110
112
|
//基础
|
|
111
113
|
color: '#333',
|
|
112
114
|
backgroundColor: 'rgba(0,0,0,0)',
|
|
113
115
|
textType: 'N', //默认水平
|
|
114
116
|
radius: 0,
|
|
115
|
-
|
|
117
|
+
|
|
116
118
|
//投影
|
|
117
119
|
is_shadow: 'Y',
|
|
118
120
|
is_shadow_bg: 0,
|
|
119
121
|
is_shadow_w: 0,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
|
|
123
|
+
|
|
122
124
|
//边框
|
|
123
125
|
is_border: 'Y',
|
|
124
126
|
is_border_w: 0,
|
|
125
127
|
is_border_c: '',
|
|
126
|
-
|
|
128
|
+
|
|
127
129
|
//其他
|
|
128
130
|
margin: {
|
|
129
131
|
top: 0,
|
|
@@ -137,7 +139,7 @@
|
|
|
137
139
|
right: 0,
|
|
138
140
|
bottom: 0
|
|
139
141
|
},
|
|
140
|
-
|
|
142
|
+
|
|
141
143
|
}
|
|
142
144
|
},
|
|
143
145
|
watch: {
|
|
@@ -154,8 +156,27 @@
|
|
|
154
156
|
url: '/pages/settings/settings'
|
|
155
157
|
})
|
|
156
158
|
},
|
|
159
|
+
|
|
160
|
+
async handleLogout(){
|
|
161
|
+
debugger
|
|
162
|
+
// #ifdef H5
|
|
163
|
+
if (this.$configProject.isPreview) return;
|
|
164
|
+
// #endif
|
|
165
|
+
|
|
166
|
+
if (this.jfbAuthorize !== null) {
|
|
167
|
+
this.$xdShowLoading({});
|
|
168
|
+
store.dispatch('logout').then(res=>{
|
|
169
|
+
this.$xdHideLoading();
|
|
170
|
+
this.jfbAuthorize.removeToken('card');
|
|
171
|
+
this.jfbAuthorize.jumpToUserLogin(this, false);
|
|
172
|
+
}).catch(err=>{
|
|
173
|
+
console.error(err);
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
|
|
157
178
|
async onJfbLoad(options) {
|
|
158
|
-
|
|
179
|
+
|
|
159
180
|
//预览模式
|
|
160
181
|
if(this.$configProject.isPreview) {
|
|
161
182
|
jfbRootExec('getBaseUserInfo', {
|
|
@@ -170,10 +191,10 @@
|
|
|
170
191
|
});
|
|
171
192
|
return;
|
|
172
193
|
}
|
|
173
|
-
|
|
194
|
+
|
|
174
195
|
this.logined = await this.jfbAuthorize.checkUserLogin(true, this, false);
|
|
175
196
|
if(!this.logined) return;
|
|
176
|
-
|
|
197
|
+
|
|
177
198
|
jfbRootExec('getBaseUserInfo', {
|
|
178
199
|
vm: this,
|
|
179
200
|
data: {}
|
|
@@ -194,16 +215,16 @@
|
|
|
194
215
|
this.address_url = getContainerPropsValue(container, 'content.address_url', {value: ''});
|
|
195
216
|
this.color = getContainerPropsValue(container, 'content.textColor', '#333');
|
|
196
217
|
this.backgroundColor = getContainerPropsValue(container, 'content.backgroundColor', 'rgba(0,0,0,0)');
|
|
197
|
-
this.textType = getContainerPropsValue(container, 'content.text_type', 'N');
|
|
198
|
-
|
|
218
|
+
this.textType = "N";//getContainerPropsValue(container, 'content.text_type', 'N');
|
|
219
|
+
|
|
199
220
|
this.is_shadow = getContainerPropsValue(container, 'content.is_shadow', 'N');
|
|
200
221
|
this.is_shadow_bg = getContainerPropsValue(container, 'content.is_shadow_bg', '#fff');
|
|
201
222
|
this.is_shadow_w = getContainerPropsValue(container, 'content.is_shadow_w', '10');
|
|
202
|
-
|
|
223
|
+
|
|
203
224
|
this.is_border = getContainerPropsValue(container, 'content.is_border', 'N');
|
|
204
225
|
this.is_border_c = getContainerPropsValue(container, 'content.is_border_c', '#fff');
|
|
205
226
|
this.is_border_w = getContainerPropsValue(container, 'content.is_border_w', '10');
|
|
206
|
-
|
|
227
|
+
|
|
207
228
|
this.radius = getContainerPropsValue(container, 'content.radius', '0');
|
|
208
229
|
},
|
|
209
230
|
}
|
|
@@ -213,7 +234,7 @@
|
|
|
213
234
|
|
|
214
235
|
<style scoped lang="less">
|
|
215
236
|
@import "./JfbBaseUserInfoLess.less";
|
|
216
|
-
|
|
237
|
+
|
|
217
238
|
.vertical-user {
|
|
218
239
|
display: flex;
|
|
219
240
|
justify-content: center;
|
|
@@ -229,29 +250,29 @@
|
|
|
229
250
|
display: flex;
|
|
230
251
|
align-items: center;
|
|
231
252
|
justify-content: flex-start;
|
|
232
|
-
|
|
233
|
-
|
|
253
|
+
|
|
254
|
+
|
|
234
255
|
&-left {
|
|
235
256
|
display: flex;
|
|
236
257
|
align-items: center;
|
|
237
258
|
flex: 1;
|
|
238
|
-
|
|
259
|
+
|
|
239
260
|
&.vertical {
|
|
240
261
|
width: 100%;
|
|
241
262
|
flex-direction: column;
|
|
242
|
-
|
|
263
|
+
|
|
243
264
|
& > view:last-child {
|
|
244
265
|
width: 100%;
|
|
245
266
|
text-align: center;
|
|
246
267
|
flex-shrink: 0;
|
|
247
268
|
padding-top: unit(20, rpx);
|
|
248
269
|
}
|
|
249
|
-
|
|
270
|
+
|
|
250
271
|
& > image, .no-image {
|
|
251
272
|
margin-right: unit(0, rpx);
|
|
252
273
|
}
|
|
253
274
|
}
|
|
254
|
-
|
|
275
|
+
|
|
255
276
|
& > image, .no-image {
|
|
256
277
|
width: unit(140, rpx);
|
|
257
278
|
height: unit(140, rpx);
|
|
@@ -263,21 +284,28 @@
|
|
|
263
284
|
flex-shrink: 0;
|
|
264
285
|
overflow: hidden;
|
|
265
286
|
}
|
|
266
|
-
|
|
287
|
+
|
|
267
288
|
.no-image {
|
|
268
289
|
border: unit(4, rpx) solid #e5e5e5;
|
|
269
290
|
}
|
|
270
|
-
|
|
291
|
+
|
|
271
292
|
& > view {
|
|
272
293
|
color: #383838;
|
|
273
294
|
font-size: unit(32, rpx);
|
|
274
295
|
}
|
|
275
296
|
}
|
|
276
|
-
|
|
297
|
+
|
|
277
298
|
& > view:nth-child(2) {
|
|
278
299
|
flex-shrink: 0;
|
|
279
300
|
}
|
|
280
301
|
}
|
|
281
302
|
}
|
|
303
|
+
|
|
304
|
+
.logout {
|
|
305
|
+
font-size: unit(26, rpx);
|
|
306
|
+
& > view {
|
|
307
|
+
color: #333;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
282
310
|
}
|
|
283
311
|
</style>
|