环信IM Demo登录方式如何修改为自己项目的?

news2024/9/17 7:07:54
在环信即时通讯云IM 官网下载Demo,本地运行只有手机+验证码的方式登录?怎么更改为自己项目的Appkey和用户去进行登录呢?

👇👇👇本文以Web端为例,教大家如何更改代码来实现

1、 VUE2 Demo

vue2 demo源码下载

vue2 demo线上体验

第一步:更改appkey

webim-vue-demo===>src===>utils===>WebIMConfig.js
在这里插入图片描述

第二步:更改代码

webim-vue-demo===>src===>pages===>login===>index.vue

<template>
  <a-layout>
		<div class="login">
			<div class="login-panel">
				<div class="logo">Web IM</div>
				<a-input v-model="username" :maxLength="64" placeholder="用户名" />
				<a-input v-model="password" :maxLength="64" v-on:keyup.13="toLogin" type="password" placeholder="密码" />
				<a-input v-model="nickname" :maxLength="64" placeholder="昵称" v-show="isRegister == true" />

				<a-button type="primary" @click="toRegister" v-if="isRegister == true">注册</a-button>
				<a-button type="primary" @click="toLogin" v-else>登录</a-button>
			</div>
			<p class="tip" v-if="isRegister == true">
				已有账号?
				<span class="green" v-on:click="changeType">去登录</span>
			</p>
			<p class="tip" v-else>
				没有账号?
				<span class="green" v-on:click="changeType">注册</span>
			</p>

			<!-- <div class="login-panel">
			<div class="logo">Web IM</div>
			<a-form :form="form" >
			    <a-form-item has-feedback>
			      <a-input
			      	placeholder="手机号码"
			        v-decorator="[
			          'phone',
			          {
			            rules: [{ required: true, message: 'Please input your phone number!' }],
			          },
			        ]"
			        style="width: 100%"
			      >
			        <a-select
			          initialValue="86"
			          slot="addonBefore"
			          v-decorator="['prefix', { initialValue: '86' }]"
			          style="width: 70px"
			        >
			          <a-select-option value="86">
			            +86
			          </a-select-option>
			        </a-select>
			      </a-input>
			    </a-form-item>

			    <a-form-item>
			      <a-row :gutter="8">
			        <a-col :span="14">
			          <a-input
			          	placeholder="短信验证码"
			            v-decorator="[
			              'captcha',
			              { rules: [{ required: true, message: 'Please input the captcha you got!' }] },
			            ]"
			          />
			        </a-col>
			        <a-col :span="10">
			          <a-button v-on:click="getSmsCode" class="getSmsCodeBtn">{{btnTxt}}</a-button>
			        </a-col>
			      </a-row>
			    </a-form-item>
				<a-button style="width: 100%" type="primary" @click="toLogin" class="login-rigester-btn">登录</a-button>

			</a-form> -->
			<!-- </div> -->
		</div>
  </a-layout>
</template>

<script>
import './index.less';
import { mapState, mapActions } from 'vuex';
import axios from 'axios'
import { Message } from 'ant-design-vue';
const domain = window.location.protocol+'//a1.easemob.com'
const userInfo = localStorage.getItem('userInfo') && JSON.parse(localStorage.getItem('userInfo'));
let times = 60;
let timer
export default{
	data(){
		return {
			username: userInfo && userInfo.userId || '',
			password: userInfo && userInfo.password || '',
			nickname: '',
			btnTxt: '获取验证码'
		};
	},
	beforeCreate() {
	    this.form = this.$form.createForm(this, { name: 'register' });
	},
	mounted: function(){
		const path = this.isRegister ? '/register' : '/login';

		if(path !== location.pathname){
			this.$router.push(path);
		}
		if(this.isRegister){
			this.getImageVerification()
		}
	},
	watch: {
		isRegister(result){
			if(result){
				this.getImageVerification()
			}
		}
	},
	components: {},
	computed: {
		isRegister(){
			return  this.$store.state.login.isRegister;
		},
		imageUrl(){
			return this.$store.state.login.imageUrl
		},
		imageId(){
			return this.$store.state.login.imageId
		}
	},
	methods: {
		...mapActions(['onLogin', 'setRegisterFlag', 'onRegister', 'getImageVerification', 'registerUser', 'loginWithToken']),
		toLogin(){
			this.onLogin({
				username: this.username.toLowerCase(),
				password: this.password
			});
			// const form = this.form;
		    // form.validateFields(['phone', 'captcha'], { force: true }, (err, value) => {
		    // 	if(!err){
		    // 		const {phone, captcha} = value
		    // 		this.loginWithToken({phone, captcha})
		    // 	}
		    // });
		},
		toReset(){
			this.$router.push('/resetpassword')
		},
		toRegister(e){
			e.preventDefault(e);
		    // this.form.validateFieldsAndScroll((err, values) => {
		    //     if (!err) {
		    //     	this.registerUser({
		    //     		userId: values.username,
		    //             userPassword: values.password,
		    //             phoneNumber: values.phone,
		    //             smsCode: values.captcha,
		    //     	})
		    //     }
		    // });

			this.onRegister({
				username: this.username.toLowerCase(),
				password: this.password,
				nickname: this.nickname.toLowerCase(),
			});
		},
		changeType(){
			this.setRegisterFlag(!this.isRegister);
		},
		getSmsCode(){
			if(this.$data.btnTxt != '获取验证码') return
			const form = this.form;
		    form.validateFields(['phone'], { force: true }, (err, value) => {
		    	if(!err){
		    		const {phone, imageCode} = value
		    		this.getCaptcha({phoneNumber: phone, imageCode})
		    	}
		    });
		},
		getCaptcha(payload){
			const self = this
			const imageId = this.imageId
			axios.post(domain+`/inside/app/sms/send/${payload.phoneNumber}`, {
                phoneNumber: payload.phoneNumber,
            })
            .then(function (response) {
                Message.success('短信已发送')
                self.countDown()
            })
            .catch(function (error) {
                if(error.response && error.response.status == 400){
                	if(error.response.data.errorInfo == 'Image verification code error.'){
                		self.getImageVerification()
                	}
                	if(error.response.data.errorInfo == 'phone number illegal'){
						Message.error('请输入正确的手机号!')
					}else if(error.response.data.errorInfo == 'Please wait a moment while trying to send.'){
						Message.error('你的操作过于频繁,请稍后再试!')
					}else if(error.response.data.errorInfo.includes('exceed the limit')){
						Message.error('获取已达上限!')
					}else{
						Message.error(error.response.data.errorInfo)
					}
                }
            });
		},
		countDown(){
			this.$data.btnTxt = times
			timer = setTimeout(() => {
				this.$data.btnTxt--
				times--
				if(this.$data.btnTxt === 0){
					times = 60
					this.$data.btnTxt = '获取验证码'
					return clearTimeout(timer)
				}
				this.countDown()
			}, 1000)
		}
	}
};
</script>

webim-vue-demo===>src===>store===>login.js
只用更改actions下的onLogin,其余不用动

onLogin: function(context, payload){
			context.commit('setUserName', payload.username);
			let options = {
				user: payload.username,
				pwd: payload.password,
				appKey: WebIM.config.appkey,
				apiUrl: 'https://a1.easecdn.com'
			};
			WebIM.conn.open(options).then((res)=>{
				localStorage.setItem('userInfo', JSON.stringify({ userId: payload.username, password: payload.password,accessToken:res.accessToken}));
			});

		},

2、VUE3 DEMO:

vue3 demo源码下载

vue3 demo线上体验

第一步:更改appkey

webim-vue-demo===>src===>IM===>config===>index.js

c27eca4aefd5861bb4014d86d7b080de.png

第二步:更改代码

webim-vue-demo===>src===>views===>Login===>components===>LoginInput===>index.vue

<script setup>
import { ref, reactive, watch, computed } from 'vue'
import { ElMessage } from 'element-plus'
import { EaseChatClient } from '@/IM/initwebsdk'
import { handleSDKErrorNotifi } from '@/utils/handleSomeData'
import { fetchUserLoginSmsCode, fetchUserLoginToken } from '@/api/login'
import { useStore } from 'vuex'
import { usePlayRing } from '@/hooks'
const store = useStore()
const loginValue = reactive({
    phoneNumber: '',
    smsCode: ''
})
const buttonLoading = ref(false)
//根据登陆初始化一部分状态
const loginState = computed(() => store.state.loginState)
watch(loginState, (newVal) => {
    if (newVal) {
        buttonLoading.value = false
        loginValue.phoneNumber = ''
        loginValue.smsCode = ''
    }
})
const rules = reactive({
    phoneNumber: [
        { required: true, message: '请输入手机号', trigger: 'blur' },
        {
            pattern: /^1[3-9]\d{9}$/,
            message: '请输入正确的手机号',
            trigger: ['blur', 'change']
        }
    ],
    smsCode: [
        {
            required: true,
            message: '请输入短信验证码',
            trigger: ['blur', 'change']
        }
    ]
})
//登陆接口调用
const loginIM = async () => {
    const { clickRing } = usePlayRing()
    clickRing()
    buttonLoading.value = true
    /* SDK 登陆的方式 */
    try {
      let { accessToken } = await EaseChatClient.open({
        user: loginValue.phoneNumber.toLowerCase(),
        pwd: loginValue.smsCode.toLowerCase(),
      });
      window.localStorage.setItem(`EASEIM_loginUser`, JSON.stringify({ user: loginValue.phoneNumber, accessToken: accessToken }))
    } catch (error) {
      console.log('>>>>登陆失败', error);
      const { data: { extraInfo } } = error
      handleSDKErrorNotifi(error.type, extraInfo.errDesc);
      loginValue.phoneNumber = '';
      loginValue.smsCode = '';
    }
    finally {
      buttonLoading.value = false;
    }
    /*  !环信后台接口登陆(仅供环信线上demo使用!) */
    // const params = {
    //     phoneNumber: loginValue.phoneNumber.toString(),
    //     smsCode: loginValue.smsCode.toString()
    // }
    // try {
    //     const res = await fetchUserLoginToken(params)
    //     if (res?.code === 200) {
    //         console.log('>>>>>>登陆token获取成功', res.token)
    //         EaseChatClient.open({
    //             user: res.chatUserName.toLowerCase(),
    //             accessToken: res.token
    //         })
    //         window.localStorage.setItem(
    //             'EASEIM_loginUser',
    //             JSON.stringify({
    //                 user: res.chatUserName.toLowerCase(),
    //                 accessToken: res.token
    //             })
    //         )
    //     }
    // } catch (error) {
    //     console.log('>>>>登陆失败', error)
    //     if (error.response?.data) {
    //         const { code, errorInfo } = error.response.data
    //         if (errorInfo.includes('does not exist.')) {
    //             ElMessage({
    //                 center: true,
    //                 message: `用户${loginValue.username}不存在!`,
    //                 type: 'error'
    //             })
    //         } else {
    //             handleSDKErrorNotifi(code, errorInfo)
    //         }
    //     }
    // } finally {
    //     buttonLoading.value = false
    // }
}
/* 短信验证码相关 */
const isSenedAuthCode = ref(false)
const authCodeNextCansendTime = ref(60)
const sendMessageAuthCode = async () => {
    const phoneNumber = loginValue.phoneNumber
    try {
        await fetchUserLoginSmsCode(phoneNumber)
        ElMessage({
            type: 'success',
            message: '验证码获取成功!',
            center: true
        })
        startCountDown()
    } catch (error) {
        ElMessage({ type: 'error', message: '验证码获取失败!', center: true })
    }
}
const startCountDown = () => {
    isSenedAuthCode.value = true
    let timer = null
    timer = setInterval(() => {
        if (
            authCodeNextCansendTime.value <= 60 &&
            authCodeNextCansendTime.value > 0
        ) {
            authCodeNextCansendTime.value--
        } else {
            clearInterval(timer)
            timer = null
            authCodeNextCansendTime.value = 60
            isSenedAuthCode.value = false
        }
    }, 1000)
}
</script>

<template>
    <el-form :model="loginValue" :rules="rules">
        <el-form-item prop="phoneNumber">
            <el-input
                class="login_input_style"
                v-model="loginValue.phoneNumber"
                placeholder="手机号"
                clearable
            />
        </el-form-item>
        <el-form-item prop="smsCode">
            <el-input
                class="login_input_style"
                v-model="loginValue.smsCode"
                placeholder="请输入短信验证码"
            >
                <template #append>
                    <el-button
                        type="primary"
                        :disabled="loginValue.phoneNumber && isSenedAuthCode"
                        @click="sendMessageAuthCode"
                        v-text="
                            isSenedAuthCode
                                ? `${authCodeNextCansendTime}S`
                                : '获取验证码'
                        "
                    ></el-button>
                </template>
            </el-input>
        </el-form-item>
        <el-form-item>
            <div class="function_button_box">
                <el-button
                    v-if="loginValue.phoneNumber && loginValue.smsCode"
                    class="haveValueBtn"
                    :loading="buttonLoading"
                    @click="loginIM"
                    >登录</el-button
                >
                <el-button v-else class="notValueBtn">登录</el-button>
            </div>
        </el-form-item>
    </el-form>
</template>

<style lang="scss" scoped>
.login_input_style {
    margin: 10px 0;
    width: 400px;
    height: 50px;
    padding: 0 16px;
}

::v-deep .el-input__inner {
    padding: 0 20px;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 1.75px;
    color: #3a3a3a;

    &::placeholder {
        font-family: 'PingFang SC';
        font-style: normal;
        font-weight: 400;
        font-size: 14px;
        line-height: 20px;
        /* identical to box height */
        letter-spacing: 1.75px;
        color: #cccccc;
    }
}

::v-deep .el-input__suffix-inner {
    font-size: 20px;
    margin-right: 15px;
}

::v-deep .el-form-item__error {
    margin-left: 16px;
}

::v-deep .el-input-group__append {
    background: linear-gradient(90deg, #04aef0 0%, #5a5dd0 100%);
    width: 60px;
    color: #fff;
    border: none;
    font-weight: 400;

    button {
        font-weight: 300;
    }
}

.login_text {
    font-family: 'PingFang SC';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 17px;
    text-align: right;

    .login_text_isuserid {
        display: inline-block;
        // width: 100px;
        color: #f9f9f9;
    }

    .login_text_tologin {
        margin-right: 20px;
        width: 80px;
        color: #05b5f1;
        cursor: pointer;

        &:hover {
            text-decoration: underline;
        }
    }
}

.function_button_box {
    margin-top: 10px;
    width: 400px;

    button {
        margin: 10px;
        width: 380px;
        height: 50px;
        border-radius: 57px;
    }

    .haveValueBtn {
        background: linear-gradient(90deg, #04aef0 0%, #5a5dd0 100%);
        border: none;
        font-weight: 300;
        font-size: 17px;
        color: #f4f4f4;

        &:active {
            background: linear-gradient(90deg, #0b83b2 0%, #363df4 100%);
        }
    }

    .notValueBtn {
        border: none;
        font-weight: 300;
        font-size: 17px;
        background: #000000;
        mix-blend-mode: normal;
        opacity: 0.3;
        color: #ffffff;
        cursor: not-allowed;
    }
}
</style>

3、React DEMO:

React Demo源码下载

React Demo线上体验

第一步:更改appkey

webim-dev===>demo===>src===>config===>WebIMConfig.js
在这里插入图片描述

第二步:更改代码

webim-dev===>demo===>src===>config===>WebIMConfig.js
将usePassword改为true

在这里插入图片描述

4、Uniapp Demo:

uniapp vue2 demo源码下载

uniapp vue3 demo源码下载

第一步:更改appkey

uniapp vue2 demo
webim-uniapp-demo===>utils===>WebIMConfig.js
在这里插入图片描述

uniapp vue3 demo
webim-uniapp-demo===>EaseIM===>config===>index.js

7fc3d3d4077b50be4fdba689acb2f9a4.png

第二步:更改代码

webim-uniapp-demo===>pages===>login===>login.vue

c18a811eba8546dc53bebca8fa0b31da.png

5、微信小程序 Demo:

微信小程序源码下载

第一步:更改appkey

webim-weixin-demo===>src===>utils===>WebIMConfig.js

109f65d6690a9ace085c47e9b5e9eb49.png

第二步:更改代码

webim-weixin-demo===>src===>pages===>login===>login.wxml

<import src="../../comps/toast/toast.wxml" />
<view class="login">
<view class="login_title">
<text bindlongpress="longpress">登录</text>
</view>

<!-- 测试用 请忽略 -->
<view class="config" wx:if="{{ show_config }}">
<view>
<text>使用沙箱环境</text>
<switch class="config_swich" checked="{{isSandBox? true: false}}" color="#0873DE" bindchange="changeConfig" />
</view>
</view>

<view class="login_user {{nameFocus}}">
<input type="text" placeholder="请输入用户名" placeholder-style="color:rgb(173,185,193)" bindinput="bindUsername" bindfocus="onFocusName" bindblur="onBlurName" />
</view>
<view class="login_pwd {{psdFocus}}">
<input type="text" password placeholder="用户密码" placeholder-style="color:rgb(173,185,193)" bindinput="bindPassword" bindfocus="onFocusPsd" bindblur="onBlurPsd"/>
</view>
<view class="login_btn">
<button hover-class="btn_hover" bind:tap="login">登录</button>
</view>
<template is="toast" data="{{ ..._toast_ }}"></template>
</view>

webim-weixin-demo===>src===>pages===>login===>login.js

let WebIM = require("../../utils/WebIM")["default"];
let __test_account__, __test_psword__;
let disp = require("../../utils/broadcast");

let runAnimation = true
Page({
data: {
name: "",
psd: "",
grant_type: "password",
rtcUrl: '',
show_config: false,
isSandBox: false
},

statechange(e) {
console.log('live-player code:', e.detail.code)
},

error(e) {
console.error('live-player error:', e.detail.errMsg)
},

onLoad: function(option){
const me = this;
const app = getApp();
new app.ToastPannel.ToastPannel();

disp.on("em.xmpp.error.passwordErr", function(){
me.toastFilled('用户名或密码错误');
});
disp.on("em.xmpp.error.activatedErr", function(){
me.toastFilled('用户被封禁');
});

wx.getStorage({
key: 'isSandBox',
success (res) {
console.log(res.data)
me.setData({
isSandBox: !!res.data
})
}
})

if (option.username && option.password != '') {
this.setData({
name: option.username,
psd: option.password
})
}
},

bindUsername: function(e){
this.setData({
name: e.detail.value
});
},

bindPassword: function(e){
this.setData({
psd: e.detail.value
});
},
onFocusPsd: function(){
this.setData({
psdFocus: 'psdFocus'
})
},
onBlurPsd: function(){
this.setData({
psdFocus: ''
})
},
onFocusName: function(){
this.setData({
nameFocus: 'nameFocus'
})
},
onBlurName: function(){
this.setData({
nameFocus: ''
})
},

login: function(){
runAnimation = !runAnimation
if(!__test_account__ && this.data.name == ""){
this.toastFilled('请输入用户名!')
return;
}
else if(!__test_account__ && this.data.psd == ""){
this.toastFilled('请输入密码!')
return;
}
wx.setStorage({
key: "myUsername",
data: __test_account__ || this.data.name.toLowerCase()
});

getApp().conn.open({
user: __test_account__ || this.data.name.toLowerCase(),
pwd: __test_psword__ || this.data.psd,
grant_type: this.data.grant_type,
appKey: WebIM.config.appkey
});
},

longpress: function(){
console.log('长按')
this.setData({
show_config: !this.data.show_config
})
},

changeConfig: function(){
this.setData({
isSandBox: !this.data.isSandBox
}, ()=>{
wx.setStorage({
key: "isSandBox",
data: this.data.isSandBox
});
})

}

});


相关文档:

注册环信:https://console.easemob.com/user/register

集成文档:https://docs-im-beta.easemob.com/document/ios/quickstart.html

社区支持:https://www.imgeek.net/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1366483.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

2023十大最具商业影响力量子公司 | 光子盒年度系列

量子技术以其广泛的应用范围和对多个领域的深远影响&#xff0c;是当之无愧的“通用底座”技术&#xff0c;其潜在的产业变革力正在展现&#xff0c;尽管当前量子技术与人工智能或虚拟现实等技术领域相比&#xff0c;量子对大多数人来说还有些“看不透”。 2023年&#xff0c;量…

C#实现个人账本管理系统

git地址&#xff1a;https://gitee.com/myshort-term/personal-ledger-management-system 1.系统简介 LedgerManagementSystem是一个小型的个人账本管理系统&#xff0c;可对收支项目进行增加、删除、修改、查询以及导入和导出。可对每日的各类收支项目进行汇总并查看和修改收…

作业--day42

界面设计 MyProWin::MyProWin(QWidget *parent): QMainWindow(parent) {/**********窗口主体**********///窗口大小this->setFixedSize(644, 493);this->setWindowTitle("QQ");this->setWindowIcon(QIcon("C:/Users/10988/Downloads/pictrue/pictrue/…

计算机毕业设计 | SpringBoot+vue移动端音乐网站 音乐播放器(附源码)

1&#xff0c;项目背景 随着计算机技术的发展&#xff0c;网络技术对我们生活和工作显得越来越重要&#xff0c;特别是现在信息高度发达的今天&#xff0c;人们对最新信息的需求和发布迫切的需要及时性。为了满足不同人们对网络需求&#xff0c;各种特色&#xff0c;各种主题的…

函数战争(栈帧)之创建与销毁(c语言)(vs2022)

首先&#xff0c;什么是函数栈帧&#xff1f; C语言中&#xff0c;每个栈帧对应着一个未运行完的函数。栈帧中保存了该函数的返回地址和局部变量。栈帧也叫过程活动记录&#xff0c;是编译器用来实现过程函数调用的一种数据结构。 以问答的方式解释编译器与解释器-CSDN博客htt…

【C++入门】函数模板类模板(泛型编程)

目录 前言 1. 泛型编程 2. 函数模板 2.1 概念 2.2 语法格式 2.3 原理 2.4 函数模板的实例化 隐式实例化 显示实例化 2.5 思考 2.6 模板参数的匹配原则 3. 类模板 3.1 类模板的定义格式 3.2 类模板的实例化 总结 前言 函数模板和类模板是C中的两种重要的模板形式&#xff0c;…

day11 有效的括号 删除字符串中的所有相邻重复项 逆波兰表达式求值

题目1&#xff1a;20 有效的括号 题目链接&#xff1a;20 有效的括号 题意 判断字符串是否有效&#xff0c;若有效&#xff1a; 1&#xff09;左括号必须用相应的右括号 2&#xff09;左括号的闭合顺序正确 ({)}顺序不正确&#xff0c;应该是&#xff08;{}&#xff09; …

深度解析Nginx负载均衡算法及配置实例

&#x1f604; 19年之后由于某些原因断更了三年&#xff0c;23年重新扬帆起航&#xff0c;推出更多优质博文&#xff0c;希望大家多多支持&#xff5e; &#x1f337; 古之立大事者&#xff0c;不惟有超世之才&#xff0c;亦必有坚忍不拔之志 &#x1f390; 个人CSND主页——Mi…

Python3从零基础到入门(1)

目录 一、环境搭建 1.检测Python环境 2.下载安装Python环境 3.VSCode中配置Python环境 二、第一个程序 1.编码 2.输出 3.标识符 4.import 5.保留字 6.注释 7.缩进 三、变量和赋值 1.Python 中的变量 2.变量的赋值 3.多个变量赋值 四、基础数据类型 1.类型查看…

智能音箱喇叭杂音问题

智能音箱喇叭杂音问题 智能音箱生厂或出货过程会遇到多种喇叭播放有杂音的问题&#xff0e; 螺丝不匹配 智能音箱设备在生产过程&#xff0c;会有SPL测试喇叭失真&#xff0c;发现不良率8%的杂音问题&#xff0e; 分析原因是来料导入了新螺丝&#xff0c; 使用过程进入异物…

harmonyOS 时间选择组件(TimePicker)

本文 我们来说 TimePicker 时间组件 首先 我们搭一个最基本的组件骨架 Entry Component struct Index {build() {Row() {Column() {}.width(100%)}.height(100%)} }然后 在 Column 组件内 放一个 TimePicker进去 这里 我们就可以看到 一个时间的选择器了 DatePicker 捕获当前…

EPQ艾森克人格测试 49题(免费版)

艾森克人格提出人格的三个基本因素&#xff1a;性格内外向E、神经质N&#xff08;也叫情绪性&#xff09;和精神质P。这三个维度的不同程度组合&#xff0c;形成了独立的个体人格特征。 其中性格内外向维度是目前评估性格内向和外向的成熟量表&#xff0c;神经质和精神质为人格…

机器人技能学习-robosuite-0-入门介绍

文章目录 前言模块介绍实战案例1&#xff1a;从 demo 中创建自己的 env案例2&#xff1a;更换属于自己的物体 前言 资料太少、资料太少、资料太少&#xff0c;重要的事说三边&#xff0c;想根据自己实际场景自定义下机器人&#xff0c;结果发现无路可走&#xff0c;鉴于缺少参…

Maven初学Day1

1.Maven是什么&#xff1f; 是一个构建工具&#xff0c;可以自动化构建过程、任务。是一个项目模型 2.作为构建工具有什么特点 1.跨平台&#xff0c;可以在多个操作系统上使用 2.对外提供一致的操作接口 3.Maven官网 https://maven.apache.org/download.cgi 4.安装步骤 …

卷积神经网络|迁移学习-猫狗分类完整代码实现

还记得这篇文章吗&#xff1f;迁移学习|代码实现 在这篇文章中&#xff0c;我们知道了在构建模型时&#xff0c;可以借助一些非常有名的模型&#xff0c;这些模型在ImageNet数据集上早已经得到了检验。 同时torchvision模块也提供了预训练好的模型。我们只需稍作修改&#xf…

外延炉及其相关的小知识

外延炉是一种用于生产半导体材料的设备&#xff0c;其工作原理是在高温高压环境下将半导体材料沉积在衬底上。 硅外延生长&#xff0c;是在具有一定晶向的硅单晶衬底上&#xff0c;生长一层具有和衬底相同晶向的电阻率且厚度不同的晶格结构完整性好的晶体。 外延生长的特点&…

Linux实验——页面置换算法模拟

页面置换算法模拟 【实验目的】 &#xff08;1&#xff09;理解虚拟内存管理的原理和技术。 &#xff08;2&#xff09;掌握请求分页存储管理的思想。 &#xff08;3&#xff09;理解常用页面置换算法的思想。 【实验原理/实验基础知识】 存储器是计算机系统的重要资源之…

腾讯面试总结

腾讯 一面 mysql索引结构&#xff1f;redis持久化策略&#xff1f;zookeeper节点类型说一下&#xff1b;zookeeper选举机制&#xff1f;zookeeper主节点故障&#xff0c;如何重新选举&#xff1f;syn机制&#xff1f;线程池的核心参数&#xff1b;threadlocal的实现&#xff…

揭开JavaScript数据类型的神秘面纱

&#x1f9d1;‍&#x1f393; 个人主页&#xff1a;《爱蹦跶的大A阿》 &#x1f525;当前正在更新专栏&#xff1a;《VUE》 、《JavaScript保姆级教程》、《krpano》 ​ ​ ✨ 前言 JavaScript作为一门动态类型语言,其数据类型一直是开发者们关注的话题。本文将深入探讨Jav…

C语言算法(二分查找、文件读写)

二分查找 前提条件&#xff1a;数据有序&#xff0c;随机访问 #include <stdio.h>int binary_search(int arr[],int n,int key);int main(void) {}int search(int arr[],int left,int right,int key) {//边界条件if(left > right) return -1;//int mid (left righ…