uniapp 微信小程序使用高德地图Vue3不兼容Vue2问题

1. uniapp 微信小程序使用高德地图Vue3不兼容Vue2问题

1.1. 问题

  uniapp Vue3项目引用高德地图报错
import amapPlugin from ‘…/…/…/js_sdk/js_amap/amap-wx.130’;

"default" is not exported by "../../../MyProject/Base/Szy/js_sdk/js_amap/amap-wx.130.js", imported by "../../../MyProject/Base/Szy/pages/template/pageAmapWx/pageAmapWx.vue".

在这里插入图片描述

1.2. 原因

  amap-wx库不支持es6 ES module模块导出,vue3不支持commonjs导入导出

1.3. 处理方案

1.3.1. 下载 微信小程序插件 amap-wx.130.js

下载 微信小程序插件 amap-wx.130.js

1.3.2. 修改 amap-wx.130.js 文件的尾部 module.exports.AMapWX=AMapWX; 修改为 export default { AMapWX };

// module.exports.AMapWX = AMapWX;
export default { AMapWX };

1.3.3. 修改后完整代码

function AMapWX(a) {
    this.key = a.key;
    this.requestConfig = {
        key: a.key,
        s: "rsx",
        platform: "WXJS",
        appname: a.key,
        sdkversion: "1.2.0",
        logversion: "2.0"
    };
    this.MeRequestConfig = {key: a.key, serviceName: "https://restapi.amap.com/rest/me"}
}

AMapWX.prototype.getWxLocation = function (a, b) {
    wx.getLocation({
        type: "gcj02", success: function (c) {
            c = c.longitude + "," + c.latitude;
            wx.setStorage({key: "userLocation", data: c});
            b(c)
        }, fail: function (c) {
            wx.getStorage({
                key: "userLocation", success: function (d) {
                    d.data && b(d.data)
                }
            });
            a.fail({errCode: "0", errMsg: c.errMsg || ""})
        }
    })
};
AMapWX.prototype.getMEKeywordsSearch = function (a) {
    if (!a.options) return a.fail({errCode: "0", errMsg: "\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});
    var b = a.options, c = this.MeRequestConfig,
        d = {key: c.key, s: "rsx", platform: "WXJS", appname: a.key, sdkversion: "1.2.0", logversion: "2.0"};
    b.layerId && (d.layerId = b.layerId);
    b.keywords && (d.keywords = b.keywords);
    b.city && (d.city = b.city);
    b.filter && (d.filter = b.filter);
    b.sortrule && (d.sortrule = b.sortrule);
    b.pageNum && (d.pageNum = b.pageNum);
    b.pageSize && (d.pageSize = b.pageSize);
    b.sig && (d.sig =
        b.sig);
    wx.request({
        url: c.serviceName + "/cpoint/datasearch/local",
        data: d,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (e) {
            (e = e.data) && e.status && "1" === e.status && 0 === e.code ? a.success(e.data) : a.fail({
                errCode: "0",
                errMsg: e
            })
        },
        fail: function (e) {
            a.fail({errCode: "0", errMsg: e.errMsg || ""})
        }
    })
};
AMapWX.prototype.getMEIdSearch = function (a) {
    if (!a.options) return a.fail({errCode: "0", errMsg: "\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});
    var b = a.options, c = this.MeRequestConfig,
        d = {key: c.key, s: "rsx", platform: "WXJS", appname: a.key, sdkversion: "1.2.0", logversion: "2.0"};
    b.layerId && (d.layerId = b.layerId);
    b.id && (d.id = b.id);
    b.sig && (d.sig = b.sig);
    wx.request({
        url: c.serviceName + "/cpoint/datasearch/id",
        data: d,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (e) {
            (e = e.data) && e.status && "1" === e.status &&
            0 === e.code ? a.success(e.data) : a.fail({errCode: "0", errMsg: e})
        },
        fail: function (e) {
            a.fail({errCode: "0", errMsg: e.errMsg || ""})
        }
    })
};
AMapWX.prototype.getMEPolygonSearch = function (a) {
    if (!a.options) return a.fail({errCode: "0", errMsg: "\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});
    var b = a.options, c = this.MeRequestConfig,
        d = {key: c.key, s: "rsx", platform: "WXJS", appname: a.key, sdkversion: "1.2.0", logversion: "2.0"};
    b.layerId && (d.layerId = b.layerId);
    b.keywords && (d.keywords = b.keywords);
    b.polygon && (d.polygon = b.polygon);
    b.filter && (d.filter = b.filter);
    b.sortrule && (d.sortrule = b.sortrule);
    b.pageNum && (d.pageNum = b.pageNum);
    b.pageSize && (d.pageSize = b.pageSize);
    b.sig && (d.sig = b.sig);
    wx.request({
        url: c.serviceName + "/cpoint/datasearch/polygon",
        data: d,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (e) {
            (e = e.data) && e.status && "1" === e.status && 0 === e.code ? a.success(e.data) : a.fail({
                errCode: "0",
                errMsg: e
            })
        },
        fail: function (e) {
            a.fail({errCode: "0", errMsg: e.errMsg || ""})
        }
    })
};
AMapWX.prototype.getMEaroundSearch = function (a) {
    if (!a.options) return a.fail({errCode: "0", errMsg: "\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});
    var b = a.options, c = this.MeRequestConfig,
        d = {key: c.key, s: "rsx", platform: "WXJS", appname: a.key, sdkversion: "1.2.0", logversion: "2.0"};
    b.layerId && (d.layerId = b.layerId);
    b.keywords && (d.keywords = b.keywords);
    b.center && (d.center = b.center);
    b.radius && (d.radius = b.radius);
    b.filter && (d.filter = b.filter);
    b.sortrule && (d.sortrule = b.sortrule);
    b.pageNum && (d.pageNum = b.pageNum);
    b.pageSize &&
    (d.pageSize = b.pageSize);
    b.sig && (d.sig = b.sig);
    wx.request({
        url: c.serviceName + "/cpoint/datasearch/around",
        data: d,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (e) {
            (e = e.data) && e.status && "1" === e.status && 0 === e.code ? a.success(e.data) : a.fail({
                errCode: "0",
                errMsg: e
            })
        },
        fail: function (e) {
            a.fail({errCode: "0", errMsg: e.errMsg || ""})
        }
    })
};
AMapWX.prototype.getGeo = function (a) {
    var b = this.requestConfig, c = a.options;
    b = {
        key: this.key,
        extensions: "all",
        s: b.s,
        platform: b.platform,
        appname: this.key,
        sdkversion: b.sdkversion,
        logversion: b.logversion
    };
    c.address && (b.address = c.address);
    c.city && (b.city = c.city);
    c.batch && (b.batch = c.batch);
    c.sig && (b.sig = c.sig);
    wx.request({
        url: "https://restapi.amap.com/v3/geocode/geo",
        data: b,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (d) {
            (d = d.data) && d.status && "1" === d.status ? a.success(d) : a.fail({
                errCode: "0",
                errMsg: d
            })
        },
        fail: function (d) {
            a.fail({errCode: "0", errMsg: d.errMsg || ""})
        }
    })
};
AMapWX.prototype.getRegeo = function (a) {
    function b(d) {
        var e = c.requestConfig;
        wx.request({
            url: "https://restapi.amap.com/v3/geocode/regeo",
            data: {
                key: c.key,
                location: d,
                extensions: "all",
                s: e.s,
                platform: e.platform,
                appname: c.key,
                sdkversion: e.sdkversion,
                logversion: e.logversion
            },
            method: "GET",
            header: {"content-type": "application/json"},
            success: function (g) {
                if (g.data.status && "1" == g.data.status) {
                    g = g.data.regeocode;
                    var h = g.addressComponent, f = [], k = g.roads[0].name + "\u9644\u8fd1", m = d.split(",")[0],
                        n = d.split(",")[1];
                    if (g.pois &&
                        g.pois[0]) {
                        k = g.pois[0].name + "\u9644\u8fd1";
                        var l = g.pois[0].location;
                        l && (m = parseFloat(l.split(",")[0]), n = parseFloat(l.split(",")[1]))
                    }
                    h.provice && f.push(h.provice);
                    h.city && f.push(h.city);
                    h.district && f.push(h.district);
                    h.streetNumber && h.streetNumber.street && h.streetNumber.number ? (f.push(h.streetNumber.street), f.push(h.streetNumber.number)) : f.push(g.roads[0].name);
                    f = f.join("");
                    a.success([{
                        iconPath: a.iconPath,
                        width: a.iconWidth,
                        height: a.iconHeight,
                        name: f,
                        desc: k,
                        longitude: m,
                        latitude: n,
                        id: 0,
                        regeocodeData: g
                    }])
                } else a.fail({
                    errCode: g.data.infocode,
                    errMsg: g.data.info
                })
            },
            fail: function (g) {
                a.fail({errCode: "0", errMsg: g.errMsg || ""})
            }
        })
    }

    var c = this;
    a.location ? b(a.location) : c.getWxLocation(a, function (d) {
        b(d)
    })
};
AMapWX.prototype.getWeather = function (a) {
    function b(g) {
        var h = "base";
        a.type && "forecast" == a.type && (h = "all");
        wx.request({
            url: "https://restapi.amap.com/v3/weather/weatherInfo",
            data: {
                key: d.key,
                city: g,
                extensions: h,
                s: e.s,
                platform: e.platform,
                appname: d.key,
                sdkversion: e.sdkversion,
                logversion: e.logversion
            },
            method: "GET",
            header: {"content-type": "application/json"},
            success: function (f) {
                if (f.data.status && "1" == f.data.status) if (f.data.lives) {
                    if ((f = f.data.lives) && 0 < f.length) {
                        f = f[0];
                        var k = {
                            city: {text: "\u57ce\u5e02", data: f.city},
                            weather: {text: "\u5929\u6c14", data: f.weather},
                            temperature: {text: "\u6e29\u5ea6", data: f.temperature},
                            winddirection: {text: "\u98ce\u5411", data: f.winddirection + "\u98ce"},
                            windpower: {text: "\u98ce\u529b", data: f.windpower + "\u7ea7"},
                            humidity: {text: "\u6e7f\u5ea6", data: f.humidity + "%"}
                        };
                        k.liveData = f;
                        a.success(k)
                    }
                } else f.data.forecasts && f.data.forecasts[0] && a.success({forecast: f.data.forecasts[0]}); else a.fail({
                    errCode: f.data.infocode,
                    errMsg: f.data.info
                })
            },
            fail: function (f) {
                a.fail({errCode: "0", errMsg: f.errMsg || ""})
            }
        })
    }

    function c(g) {
        wx.request({
            url: "https://restapi.amap.com/v3/geocode/regeo",
            data: {
                key: d.key,
                location: g,
                extensions: "all",
                s: e.s,
                platform: e.platform,
                appname: d.key,
                sdkversion: e.sdkversion,
                logversion: e.logversion
            },
            method: "GET",
            header: {"content-type": "application/json"},
            success: function (h) {
                if (h.data.status && "1" == h.data.status) {
                    h = h.data.regeocode;
                    if (h.addressComponent) var f = h.addressComponent.adcode; else h.aois && 0 < h.aois.length && (f = h.aois[0].adcode);
                    b(f)
                } else a.fail({errCode: h.data.infocode, errMsg: h.data.info})
            },
            fail: function (h) {
                a.fail({errCode: "0", errMsg: h.errMsg || ""})
            }
        })
    }

    var d = this, e = d.requestConfig;
    a.city ? b(a.city) : d.getWxLocation(a, function (g) {
        c(g)
    })
};
AMapWX.prototype.getPoiAround = function (a) {
    function b(e) {
        e = {
            key: c.key,
            location: e,
            s: d.s,
            platform: d.platform,
            appname: c.key,
            sdkversion: d.sdkversion,
            logversion: d.logversion
        };
        a.querytypes && (e.types = a.querytypes);
        a.querykeywords && (e.keywords = a.querykeywords);
        wx.request({
            url: "https://restapi.amap.com/v3/place/around",
            data: e,
            method: "GET",
            header: {"content-type": "application/json"},
            success: function (g) {
                if (g.data.status && "1" == g.data.status) {
                    if ((g = g.data) && g.pois) {
                        for (var h = [], f = 0; f < g.pois.length; f++) {
                            var k = 0 ==
                            f ? a.iconPathSelected : a.iconPath;
                            h.push({
                                latitude: parseFloat(g.pois[f].location.split(",")[1]),
                                longitude: parseFloat(g.pois[f].location.split(",")[0]),
                                iconPath: k,
                                width: 22,
                                height: 32,
                                id: f,
                                name: g.pois[f].name,
                                address: g.pois[f].address
                            })
                        }
                        a.success({markers: h, poisData: g.pois})
                    }
                } else a.fail({errCode: g.data.infocode, errMsg: g.data.info})
            },
            fail: function (g) {
                a.fail({errCode: "0", errMsg: g.errMsg || ""})
            }
        })
    }

    var c = this, d = c.requestConfig;
    a.location ? b(a.location) : c.getWxLocation(a, function (e) {
        b(e)
    })
};
AMapWX.prototype.getStaticmap = function (a) {
    function b(e) {
        c.push("location=" + e);
        a.zoom && c.push("zoom=" + a.zoom);
        a.size && c.push("size=" + a.size);
        a.scale && c.push("scale=" + a.scale);
        a.markers && c.push("markers=" + a.markers);
        a.labels && c.push("labels=" + a.labels);
        a.paths && c.push("paths=" + a.paths);
        a.traffic && c.push("traffic=" + a.traffic);
        e = "https://restapi.amap.com/v3/staticmap?" + c.join("&");
        a.success({url: e})
    }

    var c = [];
    c.push("key=" + this.key);
    var d = this.requestConfig;
    c.push("s=" + d.s);
    c.push("platform=" + d.platform);
    c.push("appname=" + d.appname);
    c.push("sdkversion=" + d.sdkversion);
    c.push("logversion=" + d.logversion);
    a.location ? b(a.location) : this.getWxLocation(a, function (e) {
        b(e)
    })
};
AMapWX.prototype.getInputtips = function (a) {
    var b = Object.assign({}, this.requestConfig);
    a.location && (b.location = a.location);
    a.keywords && (b.keywords = a.keywords);
    a.type && (b.type = a.type);
    a.city && (b.city = a.city);
    a.citylimit && (b.citylimit = a.citylimit);
    wx.request({
        url: "https://restapi.amap.com/v3/assistant/inputtips",
        data: b,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (c) {
            c && c.data && c.data.tips && a.success({tips: c.data.tips})
        },
        fail: function (c) {
            a.fail({
                errCode: "0", errMsg: c.errMsg ||
                    ""
            })
        }
    })
};
AMapWX.prototype.getDrivingRoute = function (a) {
    var b = Object.assign({}, this.requestConfig);
    a.origin && (b.origin = a.origin);
    a.destination && (b.destination = a.destination);
    a.strategy && (b.strategy = a.strategy);
    a.waypoints && (b.waypoints = a.waypoints);
    a.avoidpolygons && (b.avoidpolygons = a.avoidpolygons);
    a.avoidroad && (b.avoidroad = a.avoidroad);
    wx.request({
        url: "https://restapi.amap.com/v3/direction/driving",
        data: b,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (c) {
            c && c.data && c.data.route && a.success({
                paths: c.data.route.paths,
                taxi_cost: c.data.route.taxi_cost || ""
            })
        },
        fail: function (c) {
            a.fail({errCode: "0", errMsg: c.errMsg || ""})
        }
    })
};
AMapWX.prototype.getWalkingRoute = function (a) {
    var b = Object.assign({}, this.requestConfig);
    a.origin && (b.origin = a.origin);
    a.destination && (b.destination = a.destination);
    wx.request({
        url: "https://restapi.amap.com/v3/direction/walking",
        data: b,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (c) {
            c && c.data && c.data.route && a.success({paths: c.data.route.paths})
        },
        fail: function (c) {
            a.fail({errCode: "0", errMsg: c.errMsg || ""})
        }
    })
};
AMapWX.prototype.getTransitRoute = function (a) {
    var b = Object.assign({}, this.requestConfig);
    a.origin && (b.origin = a.origin);
    a.destination && (b.destination = a.destination);
    a.strategy && (b.strategy = a.strategy);
    a.city && (b.city = a.city);
    a.cityd && (b.cityd = a.cityd);
    wx.request({
        url: "https://restapi.amap.com/v3/direction/transit/integrated",
        data: b,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (c) {
            c && c.data && c.data.route && (c = c.data.route, a.success({
                distance: c.distance || "", taxi_cost: c.taxi_cost ||
                    "", transits: c.transits
            }))
        },
        fail: function (c) {
            a.fail({errCode: "0", errMsg: c.errMsg || ""})
        }
    })
};
AMapWX.prototype.getRidingRoute = function (a) {
    var b = Object.assign({}, this.requestConfig);
    a.origin && (b.origin = a.origin);
    a.destination && (b.destination = a.destination);
    wx.request({
        url: "https://restapi.amap.com/v3/direction/riding",
        data: b,
        method: "GET",
        header: {"content-type": "application/json"},
        success: function (c) {
            c && c.data && c.data.route && a.success({paths: c.data.route.paths})
        },
        fail: function (c) {
            a.fail({errCode: "0", errMsg: c.errMsg || ""})
        }
    })
};
// module.exports.AMapWX = AMapWX;
export default { AMapWX };

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

3.2日-线性模型,基础优化方法,线性回归从零开始实现

3.2日-线性模型&#xff0c;基础优化方法&#xff0c;线性回归从零开始实现 1线性模型衡量预估质量训练数据总结2基础优化方法3 线性回归从零开始实现 1线性模型 衡量预估质量 训练数据 总结 2基础优化方法 梯度下降是一种优化算法&#xff0c;常用于机器学习和深度学习中&…

#WEB前端(浮动与定位)

1.实验&#xff1a; 2.IDE&#xff1a;VSCODE 3.记录&#xff1a; float、position 没有应用浮动前 应用左浮动和右浮动后 应用定位 4.代码&#xff1a; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><me…

基于ZYNQ的PCIE高速数据采集卡的设计(一)

作为信息处理的第一步&#xff0c;数据采集的作用越来越重要。目前&#xff0c;数据采集已经在航 空、民用、军事、医疗等领域得到广泛应用。随着相关技术的不断发展&#xff0c;信号频率越 来高&#xff0c;带宽越来越大&#xff0c;使得数据采集技术逐渐向高速大数据的方向…

位运算---求n的二进制表示中第k位是1还是0 (lowbit)

操作&#xff1a; 先把第k位移到最后一位&#xff08;右边第一位&#xff09; 看个位是1还是0 lowbit(x)&#xff1a;返回x的最右边的1。 原理&#xff1a; 其中 &#xff0c;意思是 是 的补码。 就可以求出最右边的一位1。 应用&#xff1a; 当中 的个数。 int re…

【创作回顾】17个月峥嵘创作史

#里程碑专区#、#创作者纪念日# 还记得 2022 年 10 月 05 日&#xff0c;我在CSDN撰写了第 1 篇博客——《关于测试工程师瓶颈和突围的一个思考》&#xff0c;也是我在全网发布的第一篇技术文章。 回想当时&#xff0c;这一篇的诞生过程并不轻松&#xff0c;不像是一篇网络文章…

昇腾ACL应用开发之硬件编解码dvpp

1.前言 在我们进行实际的应用开发时&#xff0c;都会随着对一款产品或者AI芯片的了解加深&#xff0c;大家都会想到有什么可以加速预处理啊或者后处理的手段&#xff1f;常见的不同厂家对于应用开发的时候&#xff0c;都会提供一个硬件解码和硬件编码的能力&#xff0c;这也是抛…

JetBrains Gateway Github Copilot 客户端插件和主机插件

JetBrains Gateway可以通过插件支持Github Copilot&#xff08;需另行注册&#xff09;。 需要安装插件 客户端&#xff0c;而非插件 主机&#xff0c;如图所示&#xff1a; 大概是因为代码显示在客户端&#xff08;运行在本地的IDE&#xff09;&#xff1f;

新王炸:文生视频Sora模型发布,能否引爆AI芯片热潮

前言 前方高能预警&#xff0c;Sora来袭&#xff01; 浅析Sora的技术亮点 语言模型中构建关键词联系 视频素材分解为时空碎片 扩散模型DiT Not for play, But change world! OpenAI的宏大目标 未来已来&#xff0c;只是尚未流行 Sora的成本与OpenAI的7万亿美金豪赌 算…

基于阿里云OSS上传图片实战案例

一、案例描述 基于Springboot框架实现一个上传图片到阿里云服务端保存的小案例。 二、准备工作 基于Springboot免费搭载轻量级阿里云OSS数据存储库&#xff08;将本地文本、照片、视频、音频等上传云服务保存&#xff09;-CSDN博客 三、代码 新建这两个类&#xff1a;一个…

Qt开发 显示类控件

Label QLabel 可以用来显示文本和图片 核心属性如下 属性说明textQLabel 中的文本textFormat文本的格式&#xff1a;Qt::PlainText 纯文本Qt::RichText 富文本(支持 html 标签)Qt::MarkdownText markdown 格式Qt::AutoText 根据文本内容自动决定文本格式.pixmapQLabel 内部包…

贪心算法(区间问题)

452. 用最少数量的箭引爆气球 题目(求无重复区间) 有一些球形气球贴在一堵用 XY 平面表示的墙面上。墙面上的气球记录在整数数组 points &#xff0c;其中points[i] [xstart, xend] 表示水平直径在 xstart 和 xend之间的气球。你不知道气球的确切 y 坐标。 一支弓箭可以沿着…

【保姆级教程】如何订阅patreon?patreon订阅需要银行卡?patreon虚拟信用卡购买支付教程

1. 引言 什么是Patreon&#xff1a; Patreon是一个在线平台&#xff0c;允许内容创作者通过订阅服务的模式从他们的粉丝那里直接获得资金或者打赏。 这个平台支持各种创作者&#xff0c;包括艺术家、音乐家、作家、视频制作人等。 他们通过定期发布独家内容&#xff0c;然后粉丝…

在原有项目进行业务逻辑开发:同一用户短时间不得提交多次申请,以及更新主表时数据刷新掉了角色权限以及密码重置的问题,详细思路及代码

开发背景&#xff1a; 用户提交表单后&#xff0c;插入到对应数据库表的字段中去&#xff0c;因需要保存是哪一个用户提交的&#xff0c;所以需要拿到主表的user_id&#xff0c;更新功能为记录提交时间&#xff0c;短时间不得再次提交 在对一个已有角色权限分配&#xff0c;登录…

Redis主从复制+Redis哨兵模式+Redis群集模式

Redis主从复制Redis哨兵模式Redis群集模式一、Redis主从复制1、主从复制的作用2、主从复制过程3、搭建Redis主从复制3.1 所有节点服务器安装redis3.2 修改Redis配置文件(Master节点操作)3.3 修改Redis配置文件(Slave节点操作)3.4 验证主从效果 二、Redis哨兵模式1、哨兵模式的作…

Kali Linux下载与安装

目录 1 kali官网下载镜像文件 2 VMware打开kali linux文件 3 启动kali-linux-2023.4操作系统 1 kali官网下载镜像文件 kali官网&#xff1a;https://www.kali.org/get-kali/#kali-platforms 进入kali官网主页后看到如图所示界面&#xff0c;左边“Installer Images”界面是…

112.路径总和

// 定义一个名为 Solution 的类 class Solution {// 定义一个名为 hasPathSum 的公共方法&#xff0c;接收一个 TreeNode 类型的根节点 root 和一个整数 targetSum 作为参数// 方法返回一个布尔值&#xff0c;表示从根节点开始是否存在一条路径&#xff0c;使得路径上所有节点的…

给nginx部署https及自签名ssl证书

一、生成服务器root证书 openssl genrsa -out root.key 2048 openssl req -new -key root.key -out root.csr#Country Name (2 letter code) [XX]:---> CN#Country Name (2 letter code) [XX]:---> CN#State or Province Name (full name) []:---> Shanghai#Locality…

数据库系统架构与DBMS功能探微:现代信息时代数据管理的关键

✨✨ 欢迎大家来访Srlua的博文&#xff08;づ&#xffe3;3&#xffe3;&#xff09;づ╭❤&#xff5e;✨✨ &#x1f31f;&#x1f31f; 欢迎各位亲爱的读者&#xff0c;感谢你们抽出宝贵的时间来阅读我的文章。 我是Srlua&#xff0c;在这里我会分享我的知识和经验。&#x…

字符串匹配——烦人的KMP

相信很多同学看到这篇文章的时候&#xff0c;已经被KMP拿捏了吧&#xff01;KMP算法说难&#xff0c;倒也不是很难&#xff0c;手算都会&#xff0c;说不难吧&#xff0c;短短几行代码愣是看不懂&#xff0c;辗转反侧&#xff0c;翻书查阅&#xff0c;视频讲解&#xff0c;最后…

基于pytorch实现手写数字识别

1&#xff0c;先安装pytorch&#xff0c;在pytorch环境中安装库&#xff1a; 1&#xff09;进入所安装的pytorch环境&#xff0c;我的是pytorch 所以激活它&#xff1a; conda activate pytorch 2&#xff09;使用pip安装numpy,torch,torchvision,matplotlib库 pip instal…