|
|
@@ -791,7 +791,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, watch, computed, useTemplateRef, nextTick } from 'vue'
|
|
|
+import { ref, watch, computed, useTemplateRef, nextTick, onMounted } from 'vue'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import useCreateElement from '@/hooks/useCreateElement'
|
|
|
import useSlideHandler from '@/hooks/useSlideHandler'
|
|
|
@@ -838,14 +838,17 @@ const props = withDefaults(defineProps<{
|
|
|
onlyEnglish: false,
|
|
|
})
|
|
|
|
|
|
+const getUserInfo = async (userid: string) => {
|
|
|
+ const res = await axios.get('https://pbl.cocorobo.cn/api/pbl/selectUser2', {
|
|
|
+ params: { userid }
|
|
|
+ })
|
|
|
+ return res[0][0] || {}
|
|
|
+}
|
|
|
|
|
|
const userJson = ref<any>({})
|
|
|
watch(() => props.userid, async (newVal) => {
|
|
|
if (!newVal) return
|
|
|
- const res = await axios.get('https://pbl.cocorobo.cn/api/pbl/selectUser2', {
|
|
|
- params: { userid: newVal }
|
|
|
- })
|
|
|
- userJson.value = res[0][0] || {}
|
|
|
+ userJson.value = await getUserInfo(newVal)
|
|
|
})
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
@@ -1593,6 +1596,11 @@ const addAiWeb = async (code: string) => {
|
|
|
webId.value = ''
|
|
|
isEdit.value = false
|
|
|
}
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ if (!props.userid) return
|
|
|
+ userJson.value = await getUserInfo(props.userid)
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|