uni-oaview 1.1.4 → 1.1.5
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/components/oa-login/oa-login.vue +32 -16
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script setup lang="ts">
|
|
21
|
-
import { ref, reactive } from 'vue';
|
|
21
|
+
import { ref, reactive, PropType } from 'vue';
|
|
22
22
|
const formRef = ref();
|
|
23
23
|
const props = defineProps({
|
|
24
24
|
password: {
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
default:
|
|
27
27
|
'f0d5937ddef983a4fbf56eec5c84ab78e7402fd6b55b8b7271f75f676b57bae1afe09a476702f414c12b5259899db3790ab1d8915827f2f956f48c8ab4af7541',
|
|
28
28
|
},
|
|
29
|
+
type: {
|
|
30
|
+
type: String as PropType<'token' | 'cookie'>,
|
|
31
|
+
default: 'token',
|
|
32
|
+
},
|
|
29
33
|
});
|
|
30
34
|
const emit = defineEmits(['loginSuccess']);
|
|
31
35
|
const updateFormData = (key: string, value: any) => {
|
|
@@ -101,21 +105,33 @@
|
|
|
101
105
|
department: '这是一个很长很长的部门部门321312321312',
|
|
102
106
|
position: '这是一个很长很长的职位321312312321321312',
|
|
103
107
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
if (props.type === 'token') {
|
|
109
|
+
uni.request({
|
|
110
|
+
url: `${baseUrl}/api/gatewayproxy/routing/getToken?t=${Date.now()}`,
|
|
111
|
+
method: 'POST',
|
|
112
|
+
success: (res: any) => {
|
|
113
|
+
uni.hideLoading();
|
|
114
|
+
emit('loginSuccess', {
|
|
115
|
+
...formData,
|
|
116
|
+
token: res.data.data,
|
|
117
|
+
userInfo,
|
|
118
|
+
});
|
|
119
|
+
uni.showToast({
|
|
120
|
+
title: '登录成功',
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
} else {
|
|
125
|
+
uni.hideLoading();
|
|
126
|
+
emit('loginSuccess', {
|
|
127
|
+
...formData,
|
|
128
|
+
userInfo,
|
|
129
|
+
session: res.header['m_token'],
|
|
130
|
+
});
|
|
131
|
+
uni.showToast({
|
|
132
|
+
title: '登录成功',
|
|
133
|
+
});
|
|
134
|
+
}
|
|
119
135
|
},
|
|
120
136
|
complete: () => {
|
|
121
137
|
uni.hideLoading();
|