基于coze+微信小程序實現圖片上傳并利用大模型解析

項目截圖:

實現代碼(直接搬去可用)

前提:需要填寫你的oss配置+coze的api授權配置!!!

<template><view class="container"><!-- 高斯模糊背景 --><view class="animated-bg"><view class="gradient-blob"></view><view class="gradient-blob two"></view><view class="gradient-blob three"></view><view class="gradient-blob four"></view><view class="overlay"></view></view><!-- 返回按鈕 --><view class="back-button" @tap="goBack"><text class="back-icon">←</text><text class="back-text">返回</text></view><!-- 頭部區域 --><view class="header"><text class="logo-text">單詞識別助手</text><text class="subtitle">上傳單詞圖片,快速獲取詳細釋義</text></view><!-- 上傳區域 --><view class="upload-section"><view class="upload-box" @tap="chooseImage" v-if="!tempFilePath"><text class="upload-icon">📷</text><text class="upload-text">點擊上傳單詞圖片</text><text class="upload-desc">支持拍照或從相冊選擇</text></view><view class="preview-box" v-else><image :src="tempFilePath" mode="aspectFit" class="preview-image"/><view class="action-buttons"><button class="action-btn cancel" @tap="cancelUpload">取消</button><button class="action-btn confirm" @tap="analyzeImage">識別</button></view></view></view><!-- 加載狀態 --><view class="loading-state" v-if="loading"><view class="pulse-loader"><view class="pulse"></view><view class="pulse"></view><view class="pulse"></view></view><text class="loading-text">正在識別中...</text></view><!-- 只有當有單詞數據時才顯示結果區域 --><div class="word-info" v-if="wordInfo.word"><div class="word-header"><text class="word">{{ wordInfo.word }}</text><text class="phonetic">{{ wordInfo.phonetic }}</text></div><div class="word-content"><div class="item"><text class="label">詞性:</text><text>{{ wordInfo.type }}</text></div><div class="item"><text class="label">中文含義:</text><text>{{ wordInfo.meaning }}</text></div><div class="item"><text class="label">例句:</text><text>{{ wordInfo.example }}</text></div><div class="item"><text class="label">相關詞匯:</text><text>{{ wordInfo.similar }}</text></div></div></div></view>
</template><script>export default {data() {return {tempFilePath: '', // 臨時圖片路徑loading: false,wordResult: null, // 模擬的識別結果// 模擬數據mockResult: {word: "Happiness",phonetic: "?h?pin?s",meanings: [{partOfSpeech: "名詞",definition: "幸福;快樂;愉快;幸福感",example: "Money doesn't buy happiness."},{partOfSpeech: "名詞",definition: "適當;恰當;正確",example: "She questioned the happiness of his choice of words."}]},ossConfig: {accessKeyId: '----------------填寫你的-----------------',accessKeySecret: '----------------填寫你的-----------------',bucket: '----------------填寫你的-----------------',region: '----------------填寫你的-----------------', // 根據你的實際地區修改endpoint: '----------------填寫你的-----------------',},cozeConfig: {apiUrl: 'https://api.coze.cn/open_api/v2/chat',token: '----------------填寫你的-----------------',botId: '----------------填寫你的-----------------',userId: '----------------填寫你的-----------------'},wordInfo: {word: '',phonetic: '',meaning: '',example: '',similar: '',pronunciation: ''}}},methods: {// 返回上一頁goBack() {uni.navigateBack({delta: 1 // 返回的頁面層數,1 表示返回上一頁});},// 選擇圖片chooseImage() {uni.chooseImage({count: 1,sizeType: ['compressed'],sourceType: ['album', 'camera'],success: (res) => {this.tempFilePath = res.tempFilePaths[0];}});},// 取消上傳cancelUpload() {this.tempFilePath = '';this.wordResult = null;},// Base64編碼函數base64Encode(str) {const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';let output = '';let chr1, chr2, chr3, enc1, enc2, enc3, enc4;let i = 0;while (i < str.length) {chr1 = str.charCodeAt(i++);chr2 = str.charCodeAt(i++);chr3 = str.charCodeAt(i++);enc1 = chr1 >> 2;enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);enc4 = chr3 & 63;if (isNaN(chr2)) {enc3 = enc4 = 64;} else if (isNaN(chr3)) {enc4 = 64;}output = output +chars.charAt(enc1) + chars.charAt(enc2) +chars.charAt(enc3) + chars.charAt(enc4);}return output;},// 上傳到OSSasync uploadToOSS(filePath) {return new Promise((resolve, reject) => {const date = new Date();date.setHours(date.getHours() + 1); // 設置policy過期時間為1小時后const policyText = {expiration: date.toISOString(), // 設置過期時間conditions: [["content-length-range", 0, 5048576000] // 設置上傳文件的大小限制]};// 生成policy,使用自定義的base64編碼函數const policy = this.base64Encode(JSON.stringify(policyText));// 生成signatureconst signature = this.computeSignature(policy, this.ossConfig.accessKeySecret);// 生成文件名const fileName = `word_images/${Date.now()}_${Math.random().toString(36).slice(2)}.jpg`;uni.uploadFile({url: this.ossConfig.endpoint,filePath: filePath,name: 'file',formData: {key: fileName,policy: policy,OSSAccessKeyId: this.ossConfig.accessKeyId,signature: signature,success_action_status: '200'},success: (res) => {if (res.statusCode === 200) {const url = `https://${this.ossConfig.bucket}.${this.ossConfig.region}/${fileName}`;resolve(url);} else {uni.showToast({title: '上傳失敗',icon: 'none'});reject(new Error('上傳失敗'));}},fail: (err) => {uni.showToast({title: '上傳失敗',icon: 'none'});reject(err);}});});},// 計算簽名computeSignature(policy, accessKeySecret) {// 由于uni-app環境中可能沒有crypto-js,這里使用一個簡單的方法來計算const hmac = function(key, str) {const crypto = require('crypto');const hmac = crypto.createHmac('sha1', key);hmac.update(str);return hmac.digest('base64');};return hmac(accessKeySecret, policy);},// 調用Coze APIasync callCozeAPI(imageUrl) {try {const response = await uni.request({url: this.cozeConfig.apiUrl,method: 'POST',header: {'Authorization': `Bearer ${this.cozeConfig.token}`,'Content-Type': 'application/json','Accept': '*/*','Host': 'api.coze.cn','Connection': 'keep-alive'},data: {conversation_id: Date.now().toString(),bot_id: this.cozeConfig.botId,user: this.cozeConfig.userId,query: `請識別這張圖片中的單詞,圖片地址是:${imageUrl}`,stream: false}});const responseData =  response;console.log(responseData)const result = JSON.parse(responseData[1].data.messages[1].content);	console.log(result)// 根據實際返回數據更新顯示return result;} catch (error) {console.error('Coze API 調用失敗:', error);uni.showToast({title: error.message || 'API調用失敗',icon: 'none',duration: 3000});return null;}},// 修改原有的analyzeImage方法async analyzeImage() {this.loading = true;try {// 1. 上傳圖片到OSSconst imageUrl = await this.uploadToOSS(this.tempFilePath);console.log(imageUrl)// 2. 調用Coze APIconst result = await this.callCozeAPI(imageUrl);console.log(result)// 3. 處理返回結果this.wordInfo = {word: result.out2, // pearphonetic: result.yinbiao, // 英/pe?(r)/;美/per/type: result.output, // 名詞meaning: result.out, // 梨example: result.liju, // I like to eat pears.(我喜歡吃梨。)similar: result.xiangsi // apple(蘋果)、banana(香蕉)等,都屬于水果類詞匯};} catch (error) {console.error('處理失敗:', error);} finally {this.loading = false;}}}}
</script><style>.container {min-height: 100vh;position: relative;overflow: hidden;background: #f8f9fa;}.animated-bg {position: fixed;width: 100%;height: 100%;top: 0;left: 0;overflow: hidden;z-index: 0;background: linear-gradient(125deg, #00fff3, #ff00e6);animation: gradientBG 15s ease infinite;}.gradient-blob {position: absolute;width: 1000rpx;height: 1000rpx;background: linear-gradient(45deg,rgba(255, 49, 97, 0.5),rgba(255, 97, 162, 0.5));border-radius: 50%;filter: blur(80px);animation: blob-movement 20s infinite linear,color-shift 10s infinite alternate;opacity: 0.7;top: -300rpx;left: -300rpx;}.gradient-blob.two {background: linear-gradient(45deg,rgba(67, 206, 162, 0.5),rgba(24, 90, 157, 0.5));animation: blob-movement-2 25s infinite linear,color-shift-2 12s infinite alternate;animation-delay: -3s;top: 60%;left: 60%;}.gradient-blob.three {background: linear-gradient(45deg,rgba(255, 197, 84, 0.5),rgba(255, 159, 0, 0.5));animation: blob-movement-3 30s infinite linear,color-shift-3 8s infinite alternate;animation-delay: -5s;top: 40%;left: 30%;}.gradient-blob.four {background: linear-gradient(45deg,rgba(147, 88, 255, 0.5),rgba(19, 123, 255, 0.5));animation: blob-movement-4 28s infinite linear,color-shift-4 15s infinite alternate;animation-delay: -7s;top: 20%;left: 70%;}.overlay {position: absolute;top: 0;left: 0;right: 0;bottom: 0;background: rgba(255, 255, 255, 0.2);backdrop-filter: blur(20px);}@keyframes gradientBG {0% {background-position: 0% 50%;}50% {background-position: 100% 50%;}100% {background-position: 0% 50%;}}@keyframes blob-movement {0% {transform: translate(0, 0) scale(1) rotate(0deg);}33% {transform: translate(300rpx, 200rpx) scale(1.2) rotate(120deg);}66% {transform: translate(-200rpx, 400rpx) scale(0.8) rotate(240deg);}100% {transform: translate(0, 0) scale(1) rotate(360deg);}}@keyframes blob-movement-2 {0% {transform: translate(0, 0) scale(1.1) rotate(0deg);}33% {transform: translate(-250rpx, -300rpx) scale(0.9) rotate(120deg);}66% {transform: translate(300rpx, -200rpx) scale(1.2) rotate(240deg);}100% {transform: translate(0, 0) scale(1.1) rotate(360deg);}}@keyframes blob-movement-3 {0% {transform: translate(0, 0) scale(0.9) rotate(0deg);}33% {transform: translate(400rpx, -100rpx) scale(1.1) rotate(120deg);}66% {transform: translate(-300rpx, 200rpx) scale(0.8) rotate(240deg);}100% {transform: translate(0, 0) scale(0.9) rotate(360deg);}}@keyframes blob-movement-4 {0% {transform: translate(0, 0) scale(1) rotate(0deg);}33% {transform: translate(-200rpx, 300rpx) scale(1.1) rotate(120deg);}66% {transform: translate(250rpx, -250rpx) scale(0.9) rotate(240deg);}100% {transform: translate(0, 0) scale(1) rotate(360deg);}}@keyframes color-shift {0% {background: linear-gradient(45deg, rgba(255, 49, 97, 0.5), rgba(255, 97, 162, 0.5));}100% {background: linear-gradient(45deg, rgba(255, 182, 193, 0.5), rgba(255, 20, 147, 0.5));}}@keyframes color-shift-2 {0% {background: linear-gradient(45deg, rgba(67, 206, 162, 0.5), rgba(24, 90, 157, 0.5));}100% {background: linear-gradient(45deg, rgba(0, 255, 255, 0.5), rgba(0, 128, 128, 0.5));}}@keyframes color-shift-3 {0% {background: linear-gradient(45deg, rgba(255, 197, 84, 0.5), rgba(255, 159, 0, 0.5));}100% {background: linear-gradient(45deg, rgba(255, 215, 0, 0.5), rgba(255, 140, 0, 0.5));}}@keyframes color-shift-4 {0% {background: linear-gradient(45deg, rgba(147, 88, 255, 0.5), rgba(19, 123, 255, 0.5));}100% {background: linear-gradient(45deg, rgba(138, 43, 226, 0.5), rgba(65, 105, 225, 0.5));}}/* 頭部樣式 */.header {padding: 60rpx 40rpx;text-align: center;z-index: 1;position: relative;}.logo-text {font-size: 48rpx;color: #1a1a1a;font-weight: 600;letter-spacing: 2rpx;text-shadow: 0 2px 4px rgba(255, 255, 255, 0.2);}.subtitle {font-size: 28rpx;color: rgba(0, 0, 0, 0.7);margin-top: 16rpx;display: block;}/* 上傳區域樣式 */.upload-section {padding: 40rpx;z-index: 2;position: relative;}.upload-box {background: rgba(255, 255, 255, 0.2);backdrop-filter: blur(20px);border-radius: 20rpx;padding: 60rpx;display: flex;flex-direction: column;align-items: center;border: 2rpx dashed rgba(255, 255, 255, 0.5);}.upload-icon {font-size: 80rpx;margin-bottom: 20rpx;}.upload-text {font-size: 32rpx;color: #333;margin-bottom: 10rpx;}.upload-desc {font-size: 24rpx;color: rgba(0, 0, 0, 0.5);}.preview-box {width: 100%;border-radius: 20rpx;overflow: hidden;}.preview-image {width: 100%;height: 400rpx;border-radius: 20rpx;}.action-buttons {display: flex;justify-content: space-between;margin-top: 20rpx;gap: 20rpx;}.action-btn {flex: 1;padding: 20rpx;border-radius: 10rpx;text-align: center;font-size: 28rpx;}.action-btn.cancel {background: rgba(255, 255, 255, 0.3);color: #333;}.action-btn.confirm {background: linear-gradient(135deg, #7C3AED, #3B82F6);color: #fff;}.word-text {font-size: 40rpx;font-weight: bold;color: #333;}.phonetic {font-size: 28rpx;color: rgba(0, 0, 0, 0.6);margin-left: 20rpx;}.meanings {margin-top: 30rpx;}.meaning-item {margin-bottom: 20rpx;}.pos {font-size: 26rpx;color: #666;background: rgba(0, 0, 0, 0.1);padding: 4rpx 12rpx;border-radius: 6rpx;margin-right: 10rpx;}.definition {font-size: 30rpx;color: #333;display: block;margin: 10rpx 0;}.example {font-size: 26rpx;color: #666;display: block;font-style: italic;}/* 加載動畫 */.loading-state {padding: 60rpx;text-align: center;}.pulse-loader {display: flex;justify-content: center;gap: 12rpx;}.pulse {width: 16rpx;height: 16rpx;background: #fff;border-radius: 50%;animation: pulse 1.5s infinite ease-in-out;}.pulse:nth-child(2) { animation-delay: 0.2s; }.pulse:nth-child(3) { animation-delay: 0.4s; }@keyframes pulse {0%, 100% { transform: scale(0.5); opacity: 0.2; }50% { transform: scale(1); opacity: 1; }}.loading-text {color: rgba(255,255,255,0.7);font-size: 28rpx;margin-top: 20rpx;display: block;}/* 結果卡片 */.result-wrapper {padding: 40rpx;}.result-card {background: rgba(255, 255, 255, 0.2);backdrop-filter: blur(15px);border-radius: 20rpx;padding: 30rpx;border: 1px solid rgba(255, 255, 255, 0.3);animation: slideUp 0.3s ease;}.result-header {display: flex;justify-content: space-between;align-items: center;margin-bottom: 20rpx;}.back-button {position: fixed;top: 40rpx;left: 20rpx;display: flex;align-items: center;padding: 10rpx 20rpx;background: rgba(255, 255, 255, 0.8);border-radius: 50rpx;backdrop-filter: blur(10px);z-index: 999;box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);}.back-icon {font-size: 36rpx;margin-right: 10rpx;color: #333;}.back-text {font-size: 28rpx;color: #333;}.word-info {padding: 20px;}.word-header {margin-bottom: 20px;}.word {font-size: 24px;font-weight: bold;margin-right: 10px;}.phonetic {color: #666;}.item {margin-bottom: 15px;}.label {color: #333;font-weight: bold;margin-right: 10px;}
</style>

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/72058.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/72058.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/72058.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Spring-boot3.4最新版整合swagger和Mybatis-plus

好家伙,今天終于開始用spring-boot3開始寫項目了&#xff0c;以后要徹底告別1.x和2.x了&#xff0c;同樣的jdk也來到了最低17的要求了,廢話不多說直接開始 這是官方文檔的要求jdk最低是17 maven最低是3.6 一. 構建工程,這一步就不需要給大家解釋了吧 二. 整合Knife4j 1.大于…

jQuery UI API 文檔

jQuery UI API 文檔 引言 jQuery UI 是一個基于 jQuery 的用戶界面庫,它提供了豐富的交互式組件和效果,使得網頁開發變得更加簡單和高效。本文檔旨在為開發者提供全面的 jQuery UI API 信息,幫助您更好地理解和應用 jQuery UI。 jQuery UI 簡介 什么是 jQuery UI? jQu…

java GUI編程實現一個計算器

概述 閑來無事&#xff0c;利用java awt庫寫個簡單的計算器玩玩。 實現 pom.xml <dependencies><dependency><groupId>cn.hutool</groupId><artifactId>hutool-all</artifactId><version>5.8.26</version></dependency&…

C#裝箱拆箱機制詳解

在C#中&#xff0c;裝箱&#xff08;Boxing&#xff09;和拆箱&#xff08;Unboxing&#xff09; 是值類型與引用類型之間轉換的核心機制。它們的實現直接影響程序的性能和類型安全。 一、裝箱&#xff08;Boxing&#xff09; 定義&#xff1a; 將值類型轉換為引用類型&#…

MySQL 8.4 SQL 全攻略:所有知識點與實戰場景

一、引言 MySQL 作為一款廣泛使用的開源關系型數據庫管理系統&#xff0c;在數據存儲和管理領域占據著重要地位。MySQL 8.4 版本在性能、功能和安全性等方面都有了顯著的提升。本文將全面介紹 MySQL 8.4 中 SQL 的各種知識點&#xff0c;并結合實戰場景進行詳細講解&#xff0…

Qt監控系統遠程回放/錄像文件遠程下載/錄像文件打上水印/批量多線程極速下載

一、前言說明 在做這個功能的時候&#xff0c;著實費了點心思&#xff0c;好在之前做ffmpeg加密解密的時候&#xff0c;已經打通了極速加密保存文件&#xff0c;主要就是之前的類中新增了進度提示信號&#xff0c;比如當前已經處理到哪個position位置&#xff0c;發個信號出來…

超高速工業相機的應用

超高速工業相機一般安裝在機器流水線上代替人眼來做測量和判斷&#xff0c;通過數字圖像攝取目標轉換成圖像信號&#xff0c;傳送給專用的圖像處理系統。圖像處理系統對這些信號進行各種運算來抽取目標的特征&#xff0c;進而根據判別的結果來控制現場的設備動作。一般來說&…

Plugin ‘mysql_native_password‘ is not loaded`

Plugin ‘mysql_native_password’ is not loaded mysql_native_password介紹1. 使用默認的認證插件2. 修改 my.cnf 或 my.ini 配置文件3. 加載插件&#xff08;如果確實沒有加載&#xff09;4. 重新安裝或檢查 MySQL 版本 遇到錯誤 ERROR 1524 (HY000): Plugin mysql_nativ…

蒼穹外賣-阿里云OSS文件上傳

蒼穹外賣-阿里云OSS文件上傳 一、阿里云OSS簡介**獲取AccessKey**獲取enpoint 二、代碼實現1 引入依賴2 定義OSS相關配置2.1 application-dev.yml2.2 application.yml 3 讀取OSS配置3.1 AliOssProperties 4 生成OSS工具類對象4.1 AliOssUtil4.2 OssConfiguration2.5 CommonCont…

【工具】前端 js 判斷當前日期是否在當前自然周內

【工具】前端 js 判斷當前日期是否在當前自然周內 function isCurrentNaturalWeek(targetDate) {const today new Date();const dayOfWeek today.getDay(); // 0&#xff08;周日&#xff09;到6&#xff08;周六&#xff09;// 計算本周一的日期&#xff08;自然周從周一開…

【操作系統】處理機調度

處理機調度 一、調度的概念、層次1.1 三個層次1.2 七狀態模型 二、調度算法的評價指標2.1 CPU利用率2.2 系統吞吐率2.3 周轉時間2.4 等待時間2.5 響應時間 三、進程調度&#xff08;低級調度&#xff09;的時機3.1 需要進程調度的情況3.2 不能進程調度的情況3.3 閑逛進程 四、進…

SpringBoot 使用 spring.profiles.active 來區分不同環境配置

很多時候&#xff0c;我們項目在開發環境和生產環境的配置是不一樣的&#xff0c;例如&#xff0c;數據庫配置&#xff0c;在開發的時候&#xff0c;我們一般用測試數據庫&#xff0c;而在生產環境&#xff0c;我們要用生產數據庫&#xff0c;這時候&#xff0c;我們可以利用 p…

怎么進行mysql的優化?

MySQL 的優化是一個系統性的工作&#xff0c;涉及多個層面&#xff0c;包括查詢優化、索引優化、配置優化、架構優化等。以下是一些常見的 MySQL 優化方法&#xff1a; 查詢優化 避免全表掃描&#xff1a;確保查詢能夠使用索引&#xff0c;避免 SELECT *&#xff0c;只選擇需要…

談談 Node.js 中的模塊系統,CommonJS 和 ES Modules 的區別是什么?

Node.js 模塊系統&#xff1a;CommonJS 和 ES Modules 核心差異與實戰指南 一、模塊系統基礎概念 **CommonJS (CJS)**? 是 Node.js 傳統模塊系統&#xff0c;采用同步加載方式&#xff0c;典型特征&#xff1a; // 導出 module.exports { name: cjs }; // 或 exports.nam…

【HarmonyOS Next】 鴻蒙應用useNormalizedOHMUrl詳解

【HarmonyOS Next】 鴻蒙應用useNormalizedOHMUrl詳解 一、useNormalizedOHMUrl是什么? useNormalizedOHMUrl指的是是否使用標準化OHMUrl拼接。 在開發過程中&#xff0c;需要根據不同的環境或配置動態生成 URL。例如&#xff0c;在加載一些遠程模塊或者資源時&#xff0c;…

wav格式的音頻壓縮,WAV 轉 MP3 VBR 體積縮減比為 13.5%、多個 MP3 格式音頻合并為一個、文件夾存在則刪除重建,不存在則直接建立

&#x1f947; 版權: 本文由【墨理學AI】原創首發、各位讀者大大、敬請查閱、感謝三連 &#x1f389; 聲明: 作為全網 AI 領域 干貨最多的博主之一&#xff0c;?? 不負光陰不負卿 ?? 文章目錄 問題一&#xff1a;wav格式的音頻壓縮為哪些格式&#xff0c;網絡傳輸給用戶播放…

MFC線程

創建線程 HANDLE m_hThread; m_hThread CreateThread(NULL, 0, save_snapshot, (LPVOID)this, 0, &iThreadId);開啟線程循環等待 DWORD WINAPI save_snapshot(LPVOID pVoid) {while (true){//持續循環等待事件到達。接收到事件信號后才進入if。if (::WaitForSingleObjec…

賦能農業數字化轉型 雛森科技助力“聚農拼”平臺建設

賦能農業數字化轉型&#xff0c;雛森科技助力“聚農拼”平臺建設 在數字化浪潮席卷各行業的今天&#xff0c;農業領域也在積極探索轉型升級之路。中農集團一直以“根植大地&#xff0c;服務三農”為核心&#xff0c;以“鄉村振興&#xff0c;農民增收”為目標&#xff0c;及時…

千峰React:Hooks(上)

什么是Hooks ref引用值 普通變量的改變一般是不好觸發函數組件的渲染的&#xff0c;如果想讓一般的數據也可以得到狀態的保存&#xff0c;可以使用ref import { useState ,useRef} from reactfunction App() {const [count, setCount] useState(0)let num useRef(0)const h…

Ubuntu20.04安裝Redis

1.切換到root用戶 如果沒有切換到root用戶的&#xff0c;切換到root用戶。 2.使用 apt install redis 安裝redis 遇到y/n直接y即可。 redis安裝好之后就自動啟動起來了&#xff0c;因此我們可以通過netstat -anp | grep redis命令來查看是否安裝成功。 6379是Redis的默認端…