|
@@ -1,4 +1,4 @@
|
|
-import { defineComponent, onMounted, ref } from 'vue';
|
|
|
|
|
|
+import { defineComponent, onMounted, ref, watch } from 'vue';
|
|
import styles from './index.module.less';
|
|
import styles from './index.module.less';
|
|
import { Radio, RadioGroup, Image, Button } from 'vant';
|
|
import { Radio, RadioGroup, Image, Button } from 'vant';
|
|
import checkBoxActive from './images/icon-n-1.png';
|
|
import checkBoxActive from './images/icon-n-1.png';
|
|
@@ -22,16 +22,25 @@ export default defineComponent({
|
|
const btnLoading = ref(false);
|
|
const btnLoading = ref(false);
|
|
const list = ref([] as any);
|
|
const list = ref([] as any);
|
|
|
|
|
|
- onMounted(async () => {
|
|
|
|
|
|
+ watch(
|
|
|
|
+ () => props.credential,
|
|
|
|
+ () => {
|
|
|
|
+ getUserList();
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ const getUserList = async () => {
|
|
try {
|
|
try {
|
|
|
|
+ if (!props.credential?.token) return;
|
|
const { data } = await request.post('/edu-app/open/user/getMultiUser', {
|
|
const { data } = await request.post('/edu-app/open/user/getMultiUser', {
|
|
data: {
|
|
data: {
|
|
...props.credential
|
|
...props.credential
|
|
}
|
|
}
|
|
});
|
|
});
|
|
const result = data || [];
|
|
const result = data || [];
|
|
|
|
+ const tempList = [] as any;
|
|
result.forEach((item: any) => {
|
|
result.forEach((item: any) => {
|
|
- list.value.push({
|
|
|
|
|
|
+ tempList.push({
|
|
userId: item.studentId,
|
|
userId: item.studentId,
|
|
avatar: item.avatar,
|
|
avatar: item.avatar,
|
|
nickname: item.nickname,
|
|
nickname: item.nickname,
|
|
@@ -40,9 +49,14 @@ export default defineComponent({
|
|
tokenExpireTime: item.tokenExpireTime
|
|
tokenExpireTime: item.tokenExpireTime
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ list.value = tempList;
|
|
} catch {
|
|
} catch {
|
|
//
|
|
//
|
|
}
|
|
}
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ onMounted(async () => {
|
|
|
|
+ getUserList();
|
|
});
|
|
});
|
|
return () => (
|
|
return () => (
|
|
<div class={styles.loginChangeModel}>
|
|
<div class={styles.loginChangeModel}>
|