jmash-core-mp 0.1.26 → 0.1.28
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 +1 -1
- package/src/app.mpx +3 -14
- package/src/components/auth-user/jmash-logout.mpx +4 -2
- package/src/components/auth-user/jmash-user.mpx +4 -55
- package/src/components/cms/jmash-cms-article-list.mpx +1 -1
- package/src/components/cms/jmash-cms-like.mpx +1 -1
- package/src/components/cms/jmash-cms-location-list.mpx +21 -12
- package/src/components/cms/jmash-cms-product-list.mpx +1 -1
- package/src/components/common/jmash-avatar-edit.mpx +1 -1
- package/src/components/common/jmash-popup.mpx +5 -0
- package/src/components/common/jmash-tab-bar.mpx +1 -5
- package/src/components/core/jmash-cms-protocol.mpx +10 -4
- package/src/components/core/jmash-login.mpx +2 -3
- package/src/components/core/jmash-login.web.mpx +2 -3
- package/src/components/core/jmash-popup-login.ali.mpx +2 -1
- package/src/packages/pages/auth/cms-protocol.mpx +6 -4
- package/src/packages/pages/cms/cms-article.mpx +1 -2
- package/src/packages/pages/cms/cms-location-list.mpx +2 -7
- package/src/packages/pages/cms/cms-location.mpx +1 -2
- package/src/pages/half-home.mpx +2 -2
- package/src/pages/home.mpx +3 -3
- package/src/pages/home2.mpx +2 -2
- package/src/store/user.ts +0 -1
- package/src/utils/common.ts +0 -1
- package/src/utils/request.ts +0 -3
- package/lib/components/cms/cms-channel-list.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-acticle-list.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-activity-page.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-location-page.mpx.d.ts +0 -1
- package/lib/components/common/jmash-none-data.mpx.d.ts +0 -1
- package/lib/packages/pages/cms/cms-info.mpx.d.ts +0 -1
- package/lib/packages/pages/cms/cms-list.mpx.d.ts +0 -1
package/package.json
CHANGED
package/src/app.mpx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import mpx, { createApp } from '@mpxjs/core';
|
|
3
|
-
//api代理
|
|
3
|
+
// api代理
|
|
4
4
|
import apiProxy from '@mpxjs/api-proxy';
|
|
5
5
|
mpx.use(apiProxy, { usePromise: true })
|
|
6
|
-
|
|
6
|
+
// 状态管理
|
|
7
7
|
import { createPinia } from '@mpxjs/pinia';
|
|
8
8
|
createPinia();
|
|
9
|
-
|
|
9
|
+
// 网络请求和App配置
|
|
10
10
|
import { mpxFetch, config, initConfig } from "./index";
|
|
11
11
|
mpx.use(mpxFetch);
|
|
12
12
|
|
|
@@ -58,14 +58,3 @@ createApp({
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
</script>
|
|
61
|
-
|
|
62
|
-
<!--也可以通过以下形式用js输出json,便于书写注释和使用条件编译-->
|
|
63
|
-
|
|
64
|
-
<!--<script name="json">-->
|
|
65
|
-
<!-- // 可以写注释,通过defs注入的常量做一些判断之类的操作-->
|
|
66
|
-
<!-- module.exports = {-->
|
|
67
|
-
<!-- pages: [-->
|
|
68
|
-
<!-- './pages/index'-->
|
|
69
|
-
<!-- ]-->
|
|
70
|
-
<!-- }-->
|
|
71
|
-
<!--</script>-->
|
|
@@ -33,7 +33,8 @@ createComponent({
|
|
|
33
33
|
content: '确定要退出登录吗?',
|
|
34
34
|
success: (res) => {
|
|
35
35
|
if (res.confirm) {
|
|
36
|
-
|
|
36
|
+
// 调用退出接口
|
|
37
|
+
this.userStore.logout()
|
|
37
38
|
mpx.showToast({ title: '已退出登录', icon: 'success' })
|
|
38
39
|
// 通知父组件退出成功
|
|
39
40
|
this.triggerEvent('logoutSuccess');
|
|
@@ -50,7 +51,8 @@ $primary: #07c160;
|
|
|
50
51
|
$text-3: #999999;
|
|
51
52
|
|
|
52
53
|
.logout-section {
|
|
53
|
-
|
|
54
|
+
// 底部留空适配tabbar
|
|
55
|
+
padding: 40rpx 16rpx 80rpx;
|
|
54
56
|
display: flex;
|
|
55
57
|
flex-direction: column;
|
|
56
58
|
align-items: center;
|
|
@@ -8,9 +8,6 @@
|
|
|
8
8
|
wx:if="{{ userInfo.avatar }}" mode="aspectFill"></image>
|
|
9
9
|
<image src="{{ defaultAvatar }}" class="avatar-img" wx:elif="{{ defaultAvatar }}" mode="aspectFill"></image>
|
|
10
10
|
<image src="{{ resourceUrl }}/images/mall/tswk.png" class="avatar-img" wx:else mode="aspectFill"></image>
|
|
11
|
-
<!-- <view class="avatar-badge">
|
|
12
|
-
<text class="badge-icon">✎</text>
|
|
13
|
-
</view> -->
|
|
14
11
|
</view>
|
|
15
12
|
|
|
16
13
|
<!-- 用户信息 -->
|
|
@@ -22,13 +19,8 @@
|
|
|
22
19
|
</view>
|
|
23
20
|
</view>
|
|
24
21
|
<text class="user-mobile" style="color: {{ userMobileColor }}">{{ userInfo.mobilePhoneIns || '未绑定手机号'
|
|
25
|
-
|
|
22
|
+
}}</text>
|
|
26
23
|
</view>
|
|
27
|
-
|
|
28
|
-
<!-- 右侧箭头 -->
|
|
29
|
-
<!-- <view class="right-arrow" bind:tap="handleUpdateUser">
|
|
30
|
-
<text class="arrow-icon">›</text>
|
|
31
|
-
</view> -->
|
|
32
24
|
</view>
|
|
33
25
|
</block>
|
|
34
26
|
|
|
@@ -36,7 +28,6 @@
|
|
|
36
28
|
<view class="auth-user-l not-logged-in" wx:else>
|
|
37
29
|
<view class="not-logged-wrapper">
|
|
38
30
|
<view class="avatar-wrapper" bind:tap="handleLogin">
|
|
39
|
-
<!-- <image src="{{ resourceUrl }}/images/mall/tswk.png" class="avatar-img not-logged" mode="aspectFill"></image> -->
|
|
40
31
|
<image src="{{ defaultAvatar }}" class="avatar-img not-logged" wx:if="{{ defaultAvatar }}" mode="aspectFill">
|
|
41
32
|
</image>
|
|
42
33
|
<image src="{{ resourceUrl }}/images/mall/tswk.png" class="avatar-img not-logged" wx:else mode="aspectFill">
|
|
@@ -66,7 +57,7 @@ createComponent({
|
|
|
66
57
|
properties: {
|
|
67
58
|
defaultAvatar: {
|
|
68
59
|
type: String,
|
|
69
|
-
value:
|
|
60
|
+
value: getApp().globalData.config.resourceUrl + "/images/mall/tswk.png"
|
|
70
61
|
},
|
|
71
62
|
backurl: {
|
|
72
63
|
type: String,
|
|
@@ -100,16 +91,15 @@ createComponent({
|
|
|
100
91
|
}
|
|
101
92
|
};
|
|
102
93
|
onShow(refreshFunc);
|
|
103
|
-
//console.log(resourceUrl);
|
|
104
94
|
const isLogin = computed(() => userStore.accessToken !== '');
|
|
105
95
|
return { resourceUrl, baseUrl, userInfo, userStore, refreshFunc, isLogin };
|
|
106
96
|
},
|
|
107
97
|
methods: {
|
|
108
98
|
handleLogin() {
|
|
109
99
|
console.log("handleLogin");
|
|
110
|
-
|
|
100
|
+
// 检查登录并跳转登录
|
|
111
101
|
this.userStore.loginOnlyAC().then(() => {
|
|
112
|
-
|
|
102
|
+
// 登录成功,加载业务
|
|
113
103
|
console.log("静默登录成功");
|
|
114
104
|
this.refreshFunc();
|
|
115
105
|
}).catch(() => {
|
|
@@ -146,10 +136,8 @@ $bg-card: #ffffff;
|
|
|
146
136
|
display: flex;
|
|
147
137
|
align-items: center;
|
|
148
138
|
padding: 32rpx 24rpx 32rpx 0;
|
|
149
|
-
// background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
|
|
150
139
|
border-radius: 20rpx;
|
|
151
140
|
margin: 16rpx 16rpx 24rpx 0;
|
|
152
|
-
// box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
|
|
153
141
|
transition: all 0.3s;
|
|
154
142
|
background: transparent;
|
|
155
143
|
|
|
@@ -174,11 +162,8 @@ $bg-card: #ffffff;
|
|
|
174
162
|
width: 130rpx;
|
|
175
163
|
height: 130rpx;
|
|
176
164
|
border-radius: 50%;
|
|
177
|
-
// background-color: $bg-page;
|
|
178
165
|
display: block;
|
|
179
166
|
transition: all 0.3s;
|
|
180
|
-
// border: 3rpx solid rgba(7, 193, 96, 0.1);
|
|
181
|
-
// box-shadow: 0 4rpx 12rpx rgba(7, 193, 96, 0.1);
|
|
182
167
|
|
|
183
168
|
&:active {
|
|
184
169
|
transform: scale(1.05);
|
|
@@ -190,26 +175,6 @@ $bg-card: #ffffff;
|
|
|
190
175
|
box-shadow: none;
|
|
191
176
|
}
|
|
192
177
|
}
|
|
193
|
-
|
|
194
|
-
.avatar-badge {
|
|
195
|
-
position: absolute;
|
|
196
|
-
right: -2rpx;
|
|
197
|
-
bottom: -2rpx;
|
|
198
|
-
width: 36rpx;
|
|
199
|
-
height: 36rpx;
|
|
200
|
-
background: $primary;
|
|
201
|
-
border-radius: 50%;
|
|
202
|
-
border: 2rpx solid $bg-card;
|
|
203
|
-
display: flex;
|
|
204
|
-
align-items: center;
|
|
205
|
-
justify-content: center;
|
|
206
|
-
box-shadow: 0 2rpx 6rpx rgba(7, 193, 96, 0.3);
|
|
207
|
-
|
|
208
|
-
.badge-icon {
|
|
209
|
-
font-size: 16rpx;
|
|
210
|
-
color: #fff;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
178
|
}
|
|
214
179
|
}
|
|
215
180
|
|
|
@@ -254,22 +219,6 @@ $bg-card: #ffffff;
|
|
|
254
219
|
}
|
|
255
220
|
}
|
|
256
221
|
|
|
257
|
-
.right-arrow {
|
|
258
|
-
flex-shrink: 0;
|
|
259
|
-
width: 32rpx;
|
|
260
|
-
height: 32rpx;
|
|
261
|
-
display: flex;
|
|
262
|
-
align-items: center;
|
|
263
|
-
justify-content: center;
|
|
264
|
-
|
|
265
|
-
.arrow-icon {
|
|
266
|
-
font-size: 66rpx;
|
|
267
|
-
color: $text-3;
|
|
268
|
-
font-weight: 300;
|
|
269
|
-
line-height: 1;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
222
|
// 未登录状态
|
|
274
223
|
.not-logged-in {
|
|
275
224
|
.not-logged-wrapper {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<scroll-view class="article-main" type="custom" scroll-y scroll-top="{{ scrollTop }}" bindscrolltolower="loadMore">
|
|
3
|
-
<
|
|
4
|
-
<view class="article-border"
|
|
3
|
+
<view class="article-list" wx:if="{{ styles == '1' }}">
|
|
4
|
+
<view class="article-border" wx:for="{{ articleList }}" wx:key="index" bind:tap="handleInfo"
|
|
5
|
+
data-item="{{ item }}">
|
|
5
6
|
<view class="cms-info">
|
|
6
7
|
<view class="cms-image" catch:tap="handlePreview" data-url="{{ item.imgUrl }}">
|
|
7
8
|
<image class="cms-image-thumb" src="{{ imageUrl + item.imgUrl }}" mode="aspectFill" />
|
|
@@ -16,9 +17,8 @@
|
|
|
16
17
|
</view>
|
|
17
18
|
</view>
|
|
18
19
|
</view>
|
|
19
|
-
</
|
|
20
|
-
<view wx:if="{{ loading }}"
|
|
21
|
-
<view wx:elif="{{ !hasMore && articleList.length > 0 }}" class="load-tip">没有更多了</view>
|
|
20
|
+
</view>
|
|
21
|
+
<view wx:if="{{ loading }}">加载中...</view>
|
|
22
22
|
</scroll-view>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
@@ -31,7 +31,7 @@ import { CmsInfoModel } from '../../api/cms/types';
|
|
|
31
31
|
createComponent({
|
|
32
32
|
properties: {
|
|
33
33
|
// 样式
|
|
34
|
-
|
|
34
|
+
styles: {
|
|
35
35
|
type: String,
|
|
36
36
|
value: "0",
|
|
37
37
|
},
|
|
@@ -65,7 +65,7 @@ createComponent({
|
|
|
65
65
|
type: String,
|
|
66
66
|
value: ""
|
|
67
67
|
},
|
|
68
|
-
//refreshKey
|
|
68
|
+
// refreshKey
|
|
69
69
|
refreshKey: {
|
|
70
70
|
type: Number,
|
|
71
71
|
value: 0
|
|
@@ -74,7 +74,7 @@ createComponent({
|
|
|
74
74
|
setup(props) {
|
|
75
75
|
let config = getApp().globalData.config;
|
|
76
76
|
const curPage = ref(1)
|
|
77
|
-
const
|
|
77
|
+
const totalSize = ref(0)
|
|
78
78
|
const loading = ref(false)
|
|
79
79
|
const scrollTop = ref(0)
|
|
80
80
|
// 资源路径
|
|
@@ -105,6 +105,7 @@ createComponent({
|
|
|
105
105
|
} else {
|
|
106
106
|
articleList.value = [...articleList.value, ...(res.data.results || [])];
|
|
107
107
|
}
|
|
108
|
+
totalSize.value = res.data.totalSize as number;
|
|
108
109
|
}
|
|
109
110
|
}).finally(() => {
|
|
110
111
|
loading.value = false
|
|
@@ -113,7 +114,10 @@ createComponent({
|
|
|
113
114
|
// 接口图片资源路径 容器宽高度150rpx 裁剪2倍
|
|
114
115
|
let imageUrl = config.baseUrl + "/v1/file/image/clip/300/300/";
|
|
115
116
|
const loadMore = () => {
|
|
116
|
-
if (
|
|
117
|
+
if (totalSize.value === articleList.value.length || loading.value) {
|
|
118
|
+
mpx.showToast({ title: "没有更多数据了", icon: "none" });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
117
121
|
loadRecords(curPage.value + 1)
|
|
118
122
|
}
|
|
119
123
|
loadRecords(1);
|
|
@@ -123,7 +127,7 @@ createComponent({
|
|
|
123
127
|
loadRecords(1)
|
|
124
128
|
}
|
|
125
129
|
)
|
|
126
|
-
return { resourceUrl, articleList, imageUrl, curPage,
|
|
130
|
+
return { resourceUrl, articleList, imageUrl, curPage, totalSize, loading, scrollTop, loadMore }
|
|
127
131
|
},
|
|
128
132
|
methods: {
|
|
129
133
|
// 点击详情事件
|
|
@@ -159,9 +163,14 @@ createComponent({
|
|
|
159
163
|
@use "../../styles/index.scss" as *;
|
|
160
164
|
|
|
161
165
|
.article-main {
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
max-height: calc(100vh - 90rpx - env(safe-area-inset-bottom));
|
|
167
|
+
width: 100vw;
|
|
168
|
+
box-sizing: border-box;
|
|
164
169
|
background-color: #fff;
|
|
170
|
+
|
|
171
|
+
.article-list {
|
|
172
|
+
padding: 0 30rpx;
|
|
173
|
+
}
|
|
165
174
|
}
|
|
166
175
|
|
|
167
176
|
// 有分割线列表
|
|
@@ -24,7 +24,6 @@ createComponent({
|
|
|
24
24
|
},
|
|
25
25
|
methods: {
|
|
26
26
|
clickHandler(tab) {
|
|
27
|
-
// console.log('tab was clicked', tab)
|
|
28
27
|
const target = this.tabs.find(item => item.value === tab.detail.value)
|
|
29
28
|
if (target) {
|
|
30
29
|
mpx.switchTab({
|
|
@@ -33,7 +32,6 @@ createComponent({
|
|
|
33
32
|
}
|
|
34
33
|
},
|
|
35
34
|
activeTab(value) {
|
|
36
|
-
// console.log('activeTab set value:', value)
|
|
37
35
|
this.selectedLabelDefault = value;
|
|
38
36
|
}
|
|
39
37
|
}
|
|
@@ -42,9 +40,7 @@ createComponent({
|
|
|
42
40
|
<script type="application/json">
|
|
43
41
|
{
|
|
44
42
|
"usingComponents": {
|
|
45
|
-
"cube-tab-bar": "@mpxjs/mpx-cube-ui/lib/components/tab-bar/index.mpx"
|
|
46
|
-
// "cube-tab": "@mpxjs/mpx-cube-ui/lib/components/tab-bar/tab.mpx",
|
|
47
|
-
// "cube-icon": "@mpxjs/mpx-cube-ui/lib/components/icon/index.mpx"
|
|
43
|
+
"cube-tab-bar": "@mpxjs/mpx-cube-ui/lib/components/tab-bar/index.mpx"
|
|
48
44
|
}
|
|
49
45
|
}
|
|
50
46
|
</script>
|
|
@@ -25,14 +25,20 @@ createComponent({
|
|
|
25
25
|
channelAlias: {
|
|
26
26
|
type: String,
|
|
27
27
|
value: ""
|
|
28
|
-
}
|
|
28
|
+
},
|
|
29
|
+
// refreshKey
|
|
30
|
+
refreshKey: {
|
|
31
|
+
type: Number,
|
|
32
|
+
value: 0
|
|
33
|
+
},
|
|
29
34
|
},
|
|
30
35
|
setup(props) {
|
|
31
36
|
let contents = ref([{ contentId: "123" }]);
|
|
32
37
|
let title = ref("");
|
|
33
|
-
const {
|
|
34
|
-
watch(
|
|
35
|
-
|
|
38
|
+
const { refreshKey } = toRefs(props)
|
|
39
|
+
watch(refreshKey, () => {
|
|
40
|
+
if (!props.channelAlias) return;
|
|
41
|
+
cmsApi.findCmsContentInfo({ siteId: props.siteId, channelAlias: props.channelAlias, tenant: props.tenant }).then(({ data }) => {
|
|
36
42
|
console.log(data)
|
|
37
43
|
title.value = data.cmsInfo.infoTitle;
|
|
38
44
|
contents.value = data.infoContentResults;
|
|
@@ -62,8 +62,7 @@ createComponent({
|
|
|
62
62
|
type: String,
|
|
63
63
|
value: "color: #0551ff",
|
|
64
64
|
},
|
|
65
|
-
|
|
66
|
-
//登录后跳转页面
|
|
65
|
+
// 登录后跳转页面
|
|
67
66
|
backurl: {
|
|
68
67
|
type: String,
|
|
69
68
|
value: "/pages/home",
|
|
@@ -73,7 +72,7 @@ createComponent({
|
|
|
73
72
|
type: String,
|
|
74
73
|
value: "redirectTo",
|
|
75
74
|
},
|
|
76
|
-
|
|
75
|
+
// 遮罩层效果
|
|
77
76
|
isShowModel: {
|
|
78
77
|
type: Boolean,
|
|
79
78
|
value: false,
|
|
@@ -71,8 +71,7 @@ createComponent({
|
|
|
71
71
|
type: String,
|
|
72
72
|
value: "color: #0551ff",
|
|
73
73
|
},
|
|
74
|
-
|
|
75
|
-
//登录后跳转页面
|
|
74
|
+
// 登录后跳转页面
|
|
76
75
|
backurl: {
|
|
77
76
|
type: String,
|
|
78
77
|
value: "/pages/home",
|
|
@@ -82,7 +81,7 @@ createComponent({
|
|
|
82
81
|
type: String,
|
|
83
82
|
value: "redirectTo",
|
|
84
83
|
},
|
|
85
|
-
|
|
84
|
+
// 遮罩层效果
|
|
86
85
|
isShowModel: {
|
|
87
86
|
type: Boolean,
|
|
88
87
|
value: false,
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<cms-protocol siteId="{{ siteId }}" tenant="{{ tenant }}" channelAlias="{{ channelAlias }}"
|
|
2
|
+
<cms-protocol siteId="{{ siteId }}" tenant="{{ tenant }}" channelAlias="{{ channelAlias }}"
|
|
3
|
+
refreshKey="{{ refreshKey }}"></cms-protocol>
|
|
3
4
|
</template>
|
|
4
5
|
|
|
5
6
|
<script>
|
|
6
7
|
import { createPage, ref, onLoad } from '@mpxjs/core'
|
|
7
8
|
|
|
8
9
|
createPage({
|
|
9
|
-
setup(
|
|
10
|
-
//console.log("123", props);
|
|
10
|
+
setup() {
|
|
11
11
|
let config = getApp().globalData.config;
|
|
12
12
|
let tenant = ref(config.siteTenant);
|
|
13
13
|
let siteId = ref(config.siteId);
|
|
14
14
|
let channelAlias = ref('');
|
|
15
|
+
let refreshKey = ref(0);
|
|
15
16
|
onLoad((options) => {
|
|
16
17
|
console.log(options);
|
|
17
18
|
tenant.value = options.tenant || config.siteTenant;
|
|
18
19
|
siteId.value = options.siteId || config.siteId;
|
|
19
20
|
channelAlias.value = options.channelAlias || 'privacy';
|
|
21
|
+
refreshKey.value = refreshKey.value + 1;
|
|
20
22
|
})
|
|
21
|
-
return { siteId, tenant, channelAlias };
|
|
23
|
+
return { siteId, tenant, channelAlias, refreshKey };
|
|
22
24
|
},
|
|
23
25
|
})
|
|
24
26
|
</script>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- 搜索框 -->
|
|
3
3
|
<view class="search-box">
|
|
4
|
-
<jmash-search placeholder="搜索" bind:handleSearch="handleInput" />
|
|
4
|
+
<jmash-search placeholder="搜索" backColor="#f3f4f6" bind:handleSearch="handleInput" />
|
|
5
5
|
</view>
|
|
6
6
|
<!-- 栏目列表 -->
|
|
7
|
-
<jmash-cms-location-list isInfo="false"
|
|
7
|
+
<jmash-cms-location-list isInfo="false" styles="1" organTenant="{{ queryParams.tenant }}"
|
|
8
8
|
siteId="{{ queryParams.siteId }}" likeInfoTitle="{{ queryParams.likeInfoTitle }}"
|
|
9
9
|
channelAlias="{{ queryParams.channelAlias }}" pageSize="10" refreshKey="{{ refreshKey }}" />
|
|
10
10
|
|
|
@@ -71,11 +71,6 @@ page {
|
|
|
71
71
|
.search-box {
|
|
72
72
|
padding: 15rpx 30rpx;
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
.article-list {
|
|
76
|
-
max-height: calc(100vh - 90rpx - env(safe-area-inset-bottom));
|
|
77
|
-
box-sizing: border-box;
|
|
78
|
-
}
|
|
79
74
|
</style>
|
|
80
75
|
|
|
81
76
|
<script type="application/json">
|
package/src/pages/half-home.mpx
CHANGED
|
@@ -15,9 +15,9 @@ createPage({
|
|
|
15
15
|
setup() {
|
|
16
16
|
let isLoginPopup = ref(false);
|
|
17
17
|
let userStore = useUserStore();
|
|
18
|
-
|
|
18
|
+
// 检查登录并跳转登录
|
|
19
19
|
userStore.loginOnlyAC().then(() => {
|
|
20
|
-
|
|
20
|
+
// 登录成功,加载业务
|
|
21
21
|
console.log("静默登录成功");
|
|
22
22
|
}).catch(() => {
|
|
23
23
|
isLoginPopup.value = true;
|
package/src/pages/home.mpx
CHANGED
|
@@ -16,11 +16,11 @@ createPage({
|
|
|
16
16
|
setup() {
|
|
17
17
|
let config = getApp().globalData.config;
|
|
18
18
|
let userStore = useUserStore();
|
|
19
|
-
|
|
19
|
+
// 强制登录
|
|
20
20
|
onShow(() => {
|
|
21
|
-
|
|
21
|
+
// 检查登录并跳转登录
|
|
22
22
|
userStore.loginOnlyAC().then(() => {
|
|
23
|
-
|
|
23
|
+
// 登录成功,加载业务
|
|
24
24
|
console.log("静默登录成功");
|
|
25
25
|
}).catch(() => {
|
|
26
26
|
mpx.navigateTo({
|
package/src/pages/home2.mpx
CHANGED
|
@@ -14,9 +14,9 @@ createPage({
|
|
|
14
14
|
setup() {
|
|
15
15
|
let config = getApp().globalData.config;
|
|
16
16
|
let userStore = useUserStore();
|
|
17
|
-
|
|
17
|
+
// 强制登录
|
|
18
18
|
onShow(() => {
|
|
19
|
-
|
|
19
|
+
// 检查登录并跳转登录
|
|
20
20
|
userStore.loginAC("/pages/home2", false).then((res) => {
|
|
21
21
|
console.log(res);
|
|
22
22
|
});
|
package/src/store/user.ts
CHANGED
|
@@ -154,7 +154,6 @@ export const useUserStore = defineStore("user", {
|
|
|
154
154
|
},
|
|
155
155
|
// 登录处理
|
|
156
156
|
loginProcess(resp: ResponseData<LoginRes>): LoginRes {
|
|
157
|
-
//console.log("miniappLogin", resp);
|
|
158
157
|
if (resp.statusCode === 200 && resp.data.status === true) {
|
|
159
158
|
console.log("login success");
|
|
160
159
|
this.loginSuccess(resp.data.token);
|
package/src/utils/common.ts
CHANGED
|
@@ -164,7 +164,6 @@ export const validateRequired = (
|
|
|
164
164
|
value: string | number,
|
|
165
165
|
message: string
|
|
166
166
|
): boolean => {
|
|
167
|
-
console.log(value, message);
|
|
168
167
|
const valueStr = typeof value === "number" ? String(value) : value;
|
|
169
168
|
if (!valueStr || valueStr.trim() === "") {
|
|
170
169
|
// 显示错误提示
|
package/src/utils/request.ts
CHANGED
|
@@ -18,7 +18,6 @@ mpx.xfetch.interceptors.request.use(function (config) {
|
|
|
18
18
|
const appconfig = getApp().globalData.config;
|
|
19
19
|
config.url = appconfig.baseUrl + config.url;
|
|
20
20
|
}
|
|
21
|
-
//console.log("request:", config);
|
|
22
21
|
// Grpc Gateway 清理默认值,Enum,时间等不能空;
|
|
23
22
|
grpc.clearEmpty(config.params);
|
|
24
23
|
grpc.clearEmpty(config.data);
|
|
@@ -52,7 +51,6 @@ mpx.xfetch.interceptors.request.use(function (config) {
|
|
|
52
51
|
} else {
|
|
53
52
|
delete config.header["Grpc-Metadata-Tenant"];
|
|
54
53
|
}
|
|
55
|
-
//console.log("header:", config.header);
|
|
56
54
|
} else if (!db.getRefreshToken()) {
|
|
57
55
|
console.log("not token request. ");
|
|
58
56
|
return config;
|
|
@@ -96,7 +94,6 @@ mpx.xfetch.interceptors.request.use(function (config) {
|
|
|
96
94
|
});
|
|
97
95
|
|
|
98
96
|
mpx.xfetch.interceptors.response.use(function (res) {
|
|
99
|
-
// console.log(“response:”,res);
|
|
100
97
|
if (res.statusCode === 200) {
|
|
101
98
|
return res;
|
|
102
99
|
} else if (res.statusCode === 401) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|