af-mobile-client-vue3 1.4.96 → 1.4.98
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.vue +2 -2
- package/src/components/data/XCellList/index.vue +1 -1
- package/src/components/data/XForm/index.vue +1 -1
- package/src/components/data/XFormGroup/index.vue +1 -1
- package/src/router/routes.ts +9 -0
- package/src/views/user/login/LoginForm.vue +39 -19
- package/src/views/user/my/comm/ModifyPassword.vue +5 -6
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -108,8 +108,8 @@ input[type='password']::-ms-clear {
|
|
|
108
108
|
.app-container {
|
|
109
109
|
display: flex;
|
|
110
110
|
flex-direction: column;
|
|
111
|
-
|
|
112
|
-
height:
|
|
111
|
+
/*noinspection CssUnresolvedCustomProperty*/
|
|
112
|
+
height: calc(100vh - var(--system-header-height, 0px)); /* 使用 vh 确保在移动端浏览器中也能撑满 */
|
|
113
113
|
width: 100%;
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -1114,7 +1114,7 @@ function emitFunc(func: any, data: any, value: any) {
|
|
|
1114
1114
|
|
|
1115
1115
|
<style scoped lang="less">
|
|
1116
1116
|
#XCellList {
|
|
1117
|
-
height:
|
|
1117
|
+
height: 100%;
|
|
1118
1118
|
display: flex;
|
|
1119
1119
|
flex-direction: column;
|
|
1120
1120
|
--van-search-padding: 3px;
|
|
@@ -184,7 +184,7 @@ defineExpose({ init, removeRef, xFormListRef, getGroupFormData })
|
|
|
184
184
|
display: flex;
|
|
185
185
|
flex-direction: column;
|
|
186
186
|
background-color: rgb(247, 248, 250);
|
|
187
|
-
height:
|
|
187
|
+
height: 100%;
|
|
188
188
|
flex: 1;
|
|
189
189
|
overflow-y: auto;
|
|
190
190
|
// 让 Tabs 区域自适应剩余空间
|
package/src/router/routes.ts
CHANGED
|
@@ -362,6 +362,15 @@ const routes: Array<RouteRecordRaw> = [
|
|
|
362
362
|
keepAlive: false,
|
|
363
363
|
},
|
|
364
364
|
},
|
|
365
|
+
{
|
|
366
|
+
path: '/XCellListView',
|
|
367
|
+
name: 'ComponentView',
|
|
368
|
+
component: ComponentView,
|
|
369
|
+
meta: {
|
|
370
|
+
title: '组件工具列表',
|
|
371
|
+
keepAlive: false,
|
|
372
|
+
},
|
|
373
|
+
},
|
|
365
374
|
{
|
|
366
375
|
path: '/login',
|
|
367
376
|
name: 'login',
|
|
@@ -11,6 +11,7 @@ import { checkAndInitDrivingConfig } from '@af-mobile-client-vue3/utils/driving/
|
|
|
11
11
|
import { isWechat } from '@af-mobile-client-vue3/utils/platform-auth'
|
|
12
12
|
import { funcToRouter, loadRoutes } from '@af-mobile-client-vue3/utils/routerUtil'
|
|
13
13
|
import { secureStorageBatchWrite, secureStorageRead } from '@af-mobile-client-vue3/utils/secureStorage'
|
|
14
|
+
import ModifyPassword from '@af-mobile-client-vue3/views/user/my/comm/ModifyPassword.vue'
|
|
14
15
|
import bcrypt from 'bcryptjs'
|
|
15
16
|
import {
|
|
16
17
|
closeToast,
|
|
@@ -51,6 +52,8 @@ const setting = useSettingStore()
|
|
|
51
52
|
const getShow = computed(() => (unref(getLoginState) === LoginStateEnum.LOGIN))
|
|
52
53
|
|
|
53
54
|
const login: any = inject('$login')
|
|
55
|
+
const showModifyPwdModal = ref(false)
|
|
56
|
+
|
|
54
57
|
onBeforeMount(async () => {
|
|
55
58
|
if (isWechat() && setting.getSetting()?.wxAutoLogin) {
|
|
56
59
|
// 检测是否要开放微信登录
|
|
@@ -101,6 +104,11 @@ onBeforeMount(async () => {
|
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
})
|
|
107
|
+
|
|
108
|
+
function openModifyPwdModal() {
|
|
109
|
+
showModifyPwdModal.value = true
|
|
110
|
+
}
|
|
111
|
+
|
|
104
112
|
function handleSubmit() {
|
|
105
113
|
formRef.value
|
|
106
114
|
?.validate()
|
|
@@ -124,28 +132,34 @@ function handleSubmit() {
|
|
|
124
132
|
password: bcrypt.hashSync(password, 10),
|
|
125
133
|
resourceName: setting.getSetting()?.routerName || '智慧手机',
|
|
126
134
|
})
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
f: login.f,
|
|
131
|
-
jwt: login.f.id,
|
|
132
|
-
r: login.r,
|
|
135
|
+
if (password === '000000') {
|
|
136
|
+
openModifyPwdModal()
|
|
137
|
+
loading.value = false
|
|
133
138
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
else {
|
|
140
|
+
login.f = data
|
|
141
|
+
await Promise.all([GetAppDataService.load()])
|
|
142
|
+
const loginInfo = {
|
|
143
|
+
f: login.f,
|
|
144
|
+
jwt: login.f.id,
|
|
145
|
+
r: login.r,
|
|
146
|
+
}
|
|
147
|
+
userState.setLogin(loginInfo)
|
|
148
|
+
const compatible = import.meta.env.VITE_APP_COMPATIBLE
|
|
149
|
+
if (compatible === 'OA')
|
|
150
|
+
await afterGeneral(data)
|
|
141
151
|
else
|
|
142
|
-
|
|
152
|
+
if (data.resources.data)
|
|
153
|
+
await afterGeneral(data.resources.data, data.access_token)
|
|
154
|
+
else
|
|
155
|
+
await afterGeneral(data.resources, data.access_token)
|
|
143
156
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
157
|
+
const toPath = decodeURIComponent((route.query?.redirect || '/') as string)
|
|
158
|
+
closeToast()
|
|
159
|
+
if (route.name === '/login')
|
|
160
|
+
await router.replace('/')
|
|
161
|
+
else await router.replace(toPath)
|
|
162
|
+
}
|
|
149
163
|
}
|
|
150
164
|
finally {
|
|
151
165
|
loading.value = false
|
|
@@ -357,6 +371,12 @@ onMounted(() => {
|
|
|
357
371
|
微信登录
|
|
358
372
|
</VanButton>
|
|
359
373
|
</VanForm>
|
|
374
|
+
<!-- 修改密码弹窗 -->
|
|
375
|
+
<ModifyPassword
|
|
376
|
+
v-model:visible="showModifyPwdModal"
|
|
377
|
+
:ename="formData.username"
|
|
378
|
+
:password="formData.password"
|
|
379
|
+
/>
|
|
360
380
|
</div>
|
|
361
381
|
</template>
|
|
362
382
|
|
|
@@ -24,7 +24,7 @@ const formRef = ref()
|
|
|
24
24
|
|
|
25
25
|
// 表单数据
|
|
26
26
|
const formData = reactive({
|
|
27
|
-
oldPassword: '',
|
|
27
|
+
oldPassword: props.password || '',
|
|
28
28
|
newPassword: '',
|
|
29
29
|
confirmPassword: '',
|
|
30
30
|
})
|
|
@@ -53,7 +53,7 @@ function validateConfirmPassword(value: string): boolean {
|
|
|
53
53
|
// 表单验证规则
|
|
54
54
|
const rules = {
|
|
55
55
|
oldPassword: [
|
|
56
|
-
{ required:
|
|
56
|
+
{ required: !props.password, message: '请输入旧密码' },
|
|
57
57
|
],
|
|
58
58
|
newPassword: [
|
|
59
59
|
{ required: true, message: '请输入新密码' },
|
|
@@ -83,14 +83,12 @@ const rules = {
|
|
|
83
83
|
async function handleSubmit() {
|
|
84
84
|
try {
|
|
85
85
|
loading.value = true
|
|
86
|
-
|
|
87
86
|
// 验证表单
|
|
88
87
|
await formRef.value?.validate()
|
|
89
|
-
|
|
90
88
|
// 调用修改密码API
|
|
91
89
|
const result = await handleModifyPassword({ data: {
|
|
92
|
-
ename: userStore.getUserInfo().username,
|
|
93
|
-
password: formData.oldPassword,
|
|
90
|
+
ename: props.ename || userStore.getUserInfo().username,
|
|
91
|
+
password: props.password || formData.oldPassword,
|
|
94
92
|
newpassword: formData.newPassword,
|
|
95
93
|
affirmpassword: formData.confirmPassword,
|
|
96
94
|
} })
|
|
@@ -185,6 +183,7 @@ watch(() => props.visible, (newVal) => {
|
|
|
185
183
|
<van-form ref="formRef" class="password-form" @submit="handleSubmit">
|
|
186
184
|
<!-- 旧密码 -->
|
|
187
185
|
<van-field
|
|
186
|
+
v-if="!props.password"
|
|
188
187
|
v-model="formData.oldPassword"
|
|
189
188
|
name="oldPassword"
|
|
190
189
|
label="旧密码"
|