uni-oaview 1.1.4 → 1.1.6

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.
@@ -35,4 +35,7 @@ regionData.forEach((data: any) => {
35
35
  }
36
36
  });
37
37
 
38
+ /** 针对regionData中不存在的区域添加其它区域选项 */
39
+ regionData.push({ label: '其他', value: '其他' });
40
+
38
41
  export default regionData;
@@ -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
- uni.request({
105
- url: `${baseUrl}/api/gatewayproxy/routing/getToken?t=${Date.now()}`,
106
- method: 'POST',
107
- success: (res: any) => {
108
- uni.hideLoading();
109
- emit('loginSuccess', {
110
- ...formData,
111
- token: res.data.data,
112
- userInfo,
113
- });
114
- uni.showToast({
115
- title: '登录成功',
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-oaview",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "uniapp小程序组件库",
5
5
  "main": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",