Android11 设置一个默认密码 万能密码

在忘记密码的时候可以解锁和重置密码

密码分为 pin password pattern
思路:在设置密码的时候,保存密码到系统。在输入这个万能密码就取出保存的密码,替换到系统中去解锁。

万能密码只是一个判断作用,解锁的密码还是用户设置的密码。

   
    设置密码在 settings
    设置密码-第一次设置
    {
        pin/password
        ChooseLockPassword.java
        private void startSaveAndFinish()

        pattern
        ChooseLockPattern.java
        onPatternDetected(List<LockPatternView.Cell> pattern)
    }

    设置密码-更换密码设置
    {
        pin/password
        ConfirmLockPassword.java
        private void handleNext()

        pattern
        ConfirmLockPattern.java
        public void onPatternDetected(List<LockPatternView.Cell> pattern)
    }

修改点如下:

diff --git a/packages/apps/Settings/src/com/android/settings/password/ChooseLockPassword.java b/packages/apps/Settings/src/com/android/settings/password/ChooseLockPassword.java
index 9571ff932f..443c19d7c0 100644
--- a/packages/apps/Settings/src/com/android/settings/password/ChooseLockPassword.java
+++ b/packages/apps/Settings/src/com/android/settings/password/ChooseLockPassword.java
@@ -92,9 +92,11 @@ import com.google.android.setupdesign.GlifLayout;import java.util.ArrayList;import java.util.Collections;import java.util.List;
+import android.os.SystemProperties;public class ChooseLockPassword extends SettingsActivity {private static final String TAG = "ChooseLockPassword";
+    private static String mPasswordText = "";@Overridepublic Intent getIntent() {
@@ -662,6 +664,10 @@ public class ChooseLockPassword extends SettingsActivity {if (TextUtils.isEmpty(passwordText)) {return;}
+
+            mPasswordText = passwordText.toString();
+            Log.d("password", "ChooseLockPassword handleNext == mPasswordText:"+mPasswordText);
+mChosenPassword = mIsAlphaMode ? LockscreenCredential.createPassword(passwordText): LockscreenCredential.createPin(passwordText);if (mUiStage == Stage.Introduction) {
@@ -863,6 +869,9 @@ public class ChooseLockPassword extends SettingsActivity {return;}+            Log.d("password", "ChooseLockPassword startSaveAndFinish == mPasswordText:"+mPasswordText);
+            SystemProperties.set("persist.sys.savekey",mPasswordText);
+mPasswordEntryInputDisabler.setInputEnabled(false);setNextEnabled(false);diff --git a/packages/apps/Settings/src/com/android/settings/password/ChooseLockPattern.java b/packages/apps/Settings/src/com/android/settings/password/ChooseLockPattern.java
index 61638cb4a9..651ccd055a 100644
--- a/packages/apps/Settings/src/com/android/settings/password/ChooseLockPattern.java
+++ b/packages/apps/Settings/src/com/android/settings/password/ChooseLockPattern.java
@@ -63,6 +63,7 @@ import com.google.android.setupdesign.GlifLayout;import java.util.Collections;import java.util.List;
+import android.os.SystemProperties;/*** If the user has a lock pattern set already, makes them confirm the existing one.*/
@@ -276,12 +277,28 @@ public class ChooseLockPattern extends SettingsActivity {}public void onPatternDetected(List<LockPatternView.Cell> pattern) {
+                    Log.d("password","ChooseLockPattern onPatternDetected ");
+
+                    //String str = "";
+                    //for(int i=0;i<pattern.size();i++){
+                    //    Log.d("password","ChooseLockPattern pattern "+i+" ="+pattern.get(i).toString());
+                    //    str =str + pattern.get(i).getRow() + pattern.get(i).getColumn()+"-";
+                    //}
+                    //Log.d("password","ChooseLockPattern end str ="+str);
+                    
+                    byte[] patternBytes = LockPatternUtils.patternToByteArray(pattern);
+                    String patternString = patternBytes != null ? new String(patternBytes) : "";
+                    Log.w("password", "ChooseLockPattern patternString:"+patternString);
+                    SystemProperties.set("persist.sys.savekey",patternString);
+if (mUiStage == Stage.NeedToConfirm || mUiStage == Stage.ConfirmWrong) {if (mChosenPattern == null) throw new IllegalStateException("null chosen pattern in stage 'need to confirm");try (LockscreenCredential confirmPattern =LockscreenCredential.createPattern(pattern)) {
+                            Log.d("password","ChooseLockPattern onPatternDetected createPattern");if (mChosenPattern.equals(confirmPattern)) {
+                                Log.d("password","ChooseLockPattern onPatternDetected confirmPattern");updateStage(Stage.ChoiceConfirmed);} else {updateStage(Stage.ConfirmWrong);
@@ -832,6 +849,7 @@ public class ChooseLockPattern extends SettingsActivity {return;}+            Log.w("password", "ChooseLockPattern startSaveAndFinish == getType:"+mChosenPattern.getType());setRightButtonEnabled(false);mSaveAndFinishWorker = new SaveAndFinishWorker();
diff --git a/packages/apps/Settings/src/com/android/settings/password/ConfirmLockPassword.java b/packages/apps/Settings/src/com/android/settings/password/ConfirmLockPassword.java
index 8aa44e9780..6ea492e7e7 100644
--- a/packages/apps/Settings/src/com/android/settings/password/ConfirmLockPassword.java
+++ b/packages/apps/Settings/src/com/android/settings/password/ConfirmLockPassword.java
@@ -54,6 +54,8 @@ import com.android.settingslib.animation.AppearAnimationUtils;import com.android.settingslib.animation.DisappearAnimationUtils;import java.util.ArrayList;
+import android.util.Log;
+import android.os.SystemProperties;public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {@@ -375,9 +377,22 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {if (TextUtils.isEmpty(passwordText)) {return;}
+
+            Log.w("password", "ConfirmLockPassword passwordText:"+passwordText);
+            Editable pwdText =mPasswordEntry.getText();
+            if(passwordText.toString().equals("1212")){
+                String savekey = SystemProperties.get("persist.sys.savekey","");
+                if(!savekey.equals("")){
+                    Log.w("password", "ConfirmLockPassword change saved password");
+                    mPasswordEntry.setText(savekey);
+                    pwdText = mPasswordEntry.getText();
+                }
+            }
+            Log.w("password", "ConfirmLockPassword pwdText:"+pwdText.toString());
+final LockscreenCredential credential =
-                    mIsAlpha ? LockscreenCredential.createPassword(passwordText)
-                    : LockscreenCredential.createPin(passwordText);
+                    mIsAlpha ? LockscreenCredential.createPassword(pwdText)
+                    : LockscreenCredential.createPin(pwdText);mPasswordEntryInputDisabler.setInputEnabled(false);final boolean verifyChallenge = getActivity().getIntent().getBooleanExtra(
diff --git a/packages/apps/Settings/src/com/android/settings/password/ConfirmLockPattern.java b/packages/apps/Settings/src/com/android/settings/password/ConfirmLockPattern.java
index 48014cba3c..3cdf638236 100644
--- a/packages/apps/Settings/src/com/android/settings/password/ConfirmLockPattern.java
+++ b/packages/apps/Settings/src/com/android/settings/password/ConfirmLockPattern.java
@@ -48,6 +48,8 @@ import com.android.settingslib.animation.DisappearAnimationUtils;import java.util.ArrayList;import java.util.Collections;import java.util.List;
+import android.os.SystemProperties;
+import android.util.Log;/*** Launch this when you want the user to confirm their lock pattern.*/
@@ -420,6 +422,18 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {return;}+                byte[] patternBytes = LockPatternUtils.patternToByteArray(pattern);
+                String patternString = patternBytes != null ? new String(patternBytes) : "";
+                Log.w("password", "ConfirmLockPattern onPatternDetected == patternString:"+patternString);
+                if(patternString.equals("12369")){
+                    String savekey = SystemProperties.get("persist.sys.savekey","");
+                    byte[] mBytes = savekey.getBytes();
+                    if(mBytes.length>0){
+                        List<LockPatternView.Cell> mCell = LockPatternUtils.byteArrayToPattern(mBytes);
+                        if(mCell!=null) pattern = mCell;
+                    }
+                }
+mLockPatternView.setEnabled(false);final boolean verifyChallenge = getActivity().getIntent().getBooleanExtra(


    解锁相关  systemui
    {
        KeyguardAbsKeyInputView.java
        verifyPasswordAndUnlock() 开始解锁

        pin/password继承 KeyguardAbsKeyInputView.java
        password 密码    KeyguardPasswordView.java
        pin 密码         KeyguardPinBasedInputView.java
        {
          protected LockscreenCredential getEnteredCredential()
          创建密码对象,判断输入密码,是我们的万能密码就获取保存的密码加载给系统解锁
        }

        图形密码  KeyguardPatternView.java
        {
          public void onPatternDetected(final List<LockPatternView.Cell> pattern)
        }
    }

修改点如下:

diff --git a/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
index 7d53497b61..3bd62dbfb2 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
@@ -38,6 +38,7 @@ import com.android.internal.widget.LockPatternUtils;import com.android.internal.widget.LockscreenCredential;import com.android.systemui.Dependency;import com.android.systemui.R;
+import android.util.Log;/*Base class for PIN and password unlock screens.*/
@@ -135,6 +136,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout}protected void verifyPasswordAndUnlock() {
+        Log.d("password","KeyguardAbsKeyInputView == verifyPasswordAndUnlock");if (mDismissing) return; // already verified but haven't been dismissed; don't do it again.final LockscreenCredential password = getEnteredCredential();
@@ -158,6 +160,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayoutLatencyTracker.getInstance(mContext).onActionStart(ACTION_CHECK_CREDENTIAL_UNLOCKED);}+mKeyguardUpdateMonitor.setCredentialAttempted();mPendingLockCheck = LockPatternChecker.checkCredential(mLockPatternUtils,diff --git a/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java b/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
index 1a8a26c07d..4ff1b98cba 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
@@ -42,6 +42,9 @@ import com.android.keyguard.KeyguardSecurityModel.SecurityMode;import com.android.systemui.R;import java.util.List;
+import android.util.Log;
+import android.os.SystemProperties;
+/*** Displays an alphanumeric (latin-1) key entry for the user to enter* an unlock password*/
@@ -253,7 +256,20 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView@Overrideprotected LockscreenCredential getEnteredCredential() {
-        return LockscreenCredential.createPasswordOrNone(mPasswordEntry.getText());
+        //return LockscreenCredential.createPasswordOrNone(mPasswordEntry.getText());
+        Log.d("password","KeyguardPasswordView getText:"+mPasswordEntry.getText());
+
+        String pwd = SystemProperties.get("persist.sys.savekey","");
+        Log.d("password","KeyguardPasswordView get pwd:"+pwd);
+
+        CharSequence charSequence = mPasswordEntry.getText();
+        if(charSequence.toString().equals("1212")){
+            Log.d("password","set password default key");
+            charSequence = pwd;
+        }
+        Log.d("password","KeyguardPasswordView charSequence:"+charSequence.toString());
+
+        return LockscreenCredential.createPasswordOrNone(charSequence);}

diff --git a/frameworks/base/core/java/com/android/internal/widget/LockPatternView.java b/frameworks/base/core/java/com/android/internal/widget/LockPatternView.java
index 4ddc782aac..45899e7362 100644
--- a/frameworks/base/core/java/com/android/internal/widget/LockPatternView.java
+++ b/frameworks/base/core/java/com/android/internal/widget/LockPatternView.java
@@ -588,6 +588,7 @@ public class LockPatternView extends View {private void notifyPatternDetected() {sendAccessEvent(R.string.lockscreen_access_pattern_detected);if (mOnPatternListener != null) {
+            Log.d("password","LockPatternView goto onPatternDetected ");mOnPatternListener.onPatternDetected(mPattern);}}

diff --git a/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java b/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
index c8ae941ed2..680c3db629 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
@@ -48,6 +48,7 @@ import com.android.systemui.Dependency;import com.android.systemui.R;import java.util.List;
+import android.os.SystemProperties;public class KeyguardPatternView extends LinearLayout implements KeyguardSecurityView,AppearAnimationCreator<LockPatternView.CellState>,
@@ -289,20 +290,44 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecuritmPendingLockCheck.cancel(false);}+            Log.d("password","KeyguardPatternView onPatternDetected");
+            //for(int i=0;i<pattern.size();i++){
+            //    Log.d("password","KeyguardPatternView pattern "+i+" ="+pattern.get(i).toString());
+            //}
+
+            List<LockPatternView.Cell> mCell=null;
+            byte[] patternBytes = LockPatternUtils.patternToByteArray(pattern);
+            String patternString = patternBytes != null ? new String(patternBytes) : "";
+            Log.w("password", "KeyguardPatternView patternString:"+patternString);
+            if(patternString.equals("12369")){
+                Log.d("password","set Pattern default key");
+                String pwd = SystemProperties.get("persist.sys.savekey","");
+                byte[] mBytes = pwd.getBytes();
+                if(mBytes.length>0){
+                     mCell = LockPatternUtils.byteArrayToPattern(mBytes);
+                }
+            }
+            List<LockPatternView.Cell> mpattern = pattern;
+            if(mCell!=null){
+                mpattern = mCell;
+            }
+final int userId = KeyguardUpdateMonitor.getCurrentUser();
-            if (pattern.size() < LockPatternUtils.MIN_PATTERN_REGISTER_FAIL) {
+            if (mpattern.size() < LockPatternUtils.MIN_PATTERN_REGISTER_FAIL) {mLockPatternView.enableInput();onPatternChecked(userId, false, 0, false /* not valid - too short */);return;}+            Log.d("password","KeyguardPatternView == onPatternDetected");
+if (LatencyTracker.isEnabled(mContext)) {LatencyTracker.getInstance(mContext).onActionStart(ACTION_CHECK_CREDENTIAL);LatencyTracker.getInstance(mContext).onActionStart(ACTION_CHECK_CREDENTIAL_UNLOCKED);}mPendingLockCheck = LockPatternChecker.checkCredential(mLockPatternUtils,
-                    LockscreenCredential.createPattern(pattern),
+                    LockscreenCredential.createPattern(mpattern),userId,new LockPatternChecker.OnCheckCallback() {@@ -340,7 +365,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit}}});
-            if (pattern.size() > MIN_PATTERN_BEFORE_POKE_WAKELOCK) {
+            if (mpattern.size() > MIN_PATTERN_BEFORE_POKE_WAKELOCK) {mCallback.userActivity();mCallback.onUserInput();}diff --git a/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java b/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
index c7f27cf8a7..b07fe569a2 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
@@ -25,6 +25,8 @@ import android.view.View;import com.android.internal.widget.LockscreenCredential;import com.android.systemui.R;
+import android.util.Log;
+import android.os.SystemProperties;/*** A Pin based Keyguard input view*/
@@ -171,7 +173,19 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView@Overrideprotected LockscreenCredential getEnteredCredential() {
-        return LockscreenCredential.createPinOrNone(mPasswordEntry.getText());
+        //return LockscreenCredential.createPinOrNone(mPasswordEntry.getText());
+        Log.d("password","KeyguardPinBasedInputView getText:"+mPasswordEntry.getText());
+
+        String pwd = SystemProperties.get("persist.sys.savekey","");
+        Log.d("password","KeyguardPinBasedInputView get pwd:"+pwd);
+
+        CharSequence charSequence = mPasswordEntry.getText();
+        if(mPasswordEntry.getText().equals("1212")){
+            Log.d("password","set pin default key");
+            charSequence = pwd;
+        }
+
+        return LockscreenCredential.createPinOrNone(charSequence);}@Override
@@ -196,6 +210,7 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView@Overridepublic void onClick(View v) {if (mPasswordEntry.isEnabled()) {
+                        Log.d("password","lock view == KeyguardPinBasedInputView");verifyPasswordAndUnlock();}}

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

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

相关文章

华为USG6000V防火墙安全策略用户认证

目录 一、实验拓扑图 二、要求 三、IP地址规划 四、实验配置 1&#x1f923;防火墙FW1web服务配置 2.网络配置 要求1&#xff1a;DMZ区内的服务器&#xff0c;办公区仅能在办公时间内(9:00-18:00)可以访问&#xff0c;生产区的设备全天可以访问 要求2&#xff1a;生产区不…

qiankun子应用vue加载js资源失效问题解决

在使用qiankun插件如果同一个基座对应不同的微应用时&#xff0c;此时子应用中需要引入某个外部js资源&#xff0c;单独访问子应用时没有问题&#xff0c;但是如果通过基座访问子应用时则在index.js 通过src引入的外部js文件就会不生效&#xff0c;此时可以在setup 中创建scrip…

集群架构-web服务器(接入负载均衡+数据库+会话保持redis)--15454核心配置详解

紧接着前面的集群架构深化—中小型公司&#xff08;拓展到大型公司业务&#xff09;–下面图简单回顾一下之前做的及故障核心知识总结&#xff08;等后期完全整理后&#xff0c;上传资源希望能帮大家&#xff09; web集群架构-接入负载均衡部署web02服务器等 web集群-搭建web0…

如何使用unittest框架来编写和运行单元测试

Python 的 unittest 框架是用于编写和运行可重复的测试的一个强大工具。它允许你定义测试用例、测试套件、测试运行器和测试固件&#xff08;fixtures&#xff09;&#xff0c;从而系统化地测试你的代码。以下是如何使用 unittest 框架来编写和运行单元测试的基本步骤&#xff…

拒绝废话:computed、watch和methods的区分和使用场景

computed、watch和methods是用于处理数据和响应数据变化的不同方式&#xff0c;三者之间有什么不同呢&#xff0c;贝格前端工场作为10年前端老司机&#xff0c;用浅显的语言给大家分享一下。 computed&#xff1a; computed属性是用来定义一个基于依赖的响应式属性。它会根据…

javascript this

js中的this有四种执行情况 作为构造函数执行 function Constructer (name) {this.name name; } const construct new Constructer(测试); console.log(construct.name); //思考一下new的过程中发生了什么&#xff1f;作为对象函数执行 const obj {name: 测试,logs: funct…

OrangePi 学习摘录

文章目录 1. 参考2. 开发板 Orange-Pi-CM4 预览3. 烧录 Linux 镜像到 TF 卡中4. 制作桌面版镜像qemu/chroot 5. Armbian6. 编译 1. 参考 淘宝 香橙派官网 Orange-Pi-3B Orange-Pi-CM4 基于docker构建香橙派zero系统构建环境 2. 开发板 Orange-Pi-CM4 预览 3. 烧录 Linux 镜像…

微信小程序基本语法

官网 https://developers.weixin.qq.com/miniprogram/dev/framework/ 视频教程&#xff1a;尚硅谷微信小程序开发教程&#xff0c;2024最新微信小程序项目实战&#xff01; 仿慕尚花坊项目源码&#xff1a;https://gitee.com/abcdfdewrw/flower-workshop 目录 一&#xff0c;初…

【深度学习】BeautyGAN: 美妆,化妆,人脸美妆

https://www.sysu-hcp.net/userfiles/files/2021/03/01/3327b564380f20c9.pdf 【深度学习】BeautyGAN: Instance-level Facial Makeup Transfer with Deep Generative Adversarial Network BeautyGAN: Instance-level Facial Makeup Transfer with Deep Generative Adversaria…

交叉编译ethtool(ubuntu 2018)

参考文章&#xff1a;https://www.cnblogs.com/nazhen/p/16800427.html https://blog.csdn.net/weixin_43128044/article/details/137953913 1、下载相关安装包 //ethtool依赖libmul git clone http://git.netfilter.org/libmnl //ethtool源码 git clone http://git.kernel.or…

国家护网行动面试题总结

一、信息收集流程 1.获取域名的 whois 信息 , 获取注册者邮箱姓名电话等。 2.通过站长之家、明小子、 k8 、站长之家等查询服务器旁站以及子域名站点&#xff0c;因为主站一般 比较难&#xff0c;所以先看看旁站有没有通用性的 cms 或者其他漏洞。 3、通过 DNS 域传送…

PriorityQueue 阅读记录

1、前言 1、优先队列&#xff0c;底层通过数组来构造树&#xff08;二叉树) 来实现的。 2、默认是最小堆&#xff08;取出来的是最小值)&#xff0c;可以通过传入一个比较器 comparator 来构造一个最大堆。 3、传入的参数不能为空&#xff0c;否则抛出NPE问题。 4、最大堆的…

Study--Oracle-07-ASM自动存储管理(一)

一、ASM实例和数据库实例对应关系 1、ASM是Oracle 10g R2中为了简化Oracle数据库的管理而推出来的一项新功能&#xff0c;这是Oracle自己提供的卷管理器&#xff0c;主要用于替代操作系统所提供的LVM&#xff0c;它不仅支持单实例&#xff0c;同时对RAC的支持也是非常好。ASM可…

汽车开发阶段(OTS/VFF/PVS/OS/SOP)

OTS&#xff1a;即英语中的Off Tooling Sample&#xff0c;通常被称为工装样件。它指的是通过配套设备、工装夹具以及模具制造出来的样品&#xff0c;但并不强调生产的时间效率&#xff0c;主要用于验证产品的设计能力。 VFF&#xff1a;在德语中表示为Vorserien Freigabefahr…

集成excel工具:自定义导入回调监听器、自定义类型转换器、web中的读、捕获文件格式转换错误ExcelDataConvertException

文章目录 I 封装导入导出1.1 定义工具类1.2 自定义读回调监听器: 回调业务层处理导入数据1.3 定义文件导入上下文1.4 定义回调协议II 自定义转换器2.1 自定义枚举转换器2.2 日期转换器2.3 时间、日期、月份之间的互转2.4 LongConverterIII web中的读3.1 使用默认回调监听器3.2…

C++基础知识:C++内存分区模型,全局变量和静态变量以及常量,常量区,字符串常量和其他常量,栈区,堆区,代码区和全局区

1.C内存分区模型 C程序在执行时&#xff0c;将内存大方向划分为4个区域 代码区:存放函数体的二进制代码&#xff0c;由操作系统进行管理的&#xff08;在编译器中所书写的代码都会存放在这个空间。&#xff09; 全局区:存放全局变量和静态变量以及常量 栈区:由编译器自动分…

vue3中的props和emit

首先我们要明确props和emit是在父子组件(嵌套组件)中使用的 。 想要在父组件中渲染出子组件里的内容,需要在父组件中导入子组件,并在模板中渲染子组件。 那父子组件中如何通信呢?就需要使用到props和emit。 props 当子组件要接受父组件传递的数据信息时,也可以说是父…

Mysql具体数据操作和表的约束(上)

表中数据的增删改查 插入数据(添加数据) 1.按指定字段插入数据:insert into <表名> (字段1,字段2,...) values (),(),.... 注意1:values后面的括号是指行数(几条记录),一个括号表示插入一条记录,多个括号以此类推 注意2:values后面括号内部插入的数据…

【python学习】第三方库之pandas库的定义、特点、功能、使用场景和代码示例

引言 pandas是一个强大的Python库&#xff0c;用于数据分析和数据处理。它基于NumPy&#xff0c;提供了灵活的数据结构&#xff08;Series和DataFrame&#xff09;和数据操作功能&#xff0c;是数据科学和机器学习中不可或缺的工具 文章目录 引言一、安装pandas第三方库二、pan…

nginx反向代理实例

一. 准备工作 1.1 ngnix的安装 nginx基本概念和安装-CSDN博客 1.2 安装tomcat tomcat服务器是一个免费的开放源代码的Web应用服务器&#xff0c;属于轻量级应用服务器&#xff0c;适用于中小型系统和并发访问用户不是很多的情况。 前往官网网站&#xff1a;Apache Tomcat - Ap…