支付宝支付功能实现

article/2025/10/15 9:12:46

支付宝支付功能

  • 1、电脑网站支付,手机网站支付,app支付
    • 1.1、异步通知介绍
    • 1.2、API和请求示例介绍
  • 2、当面付
  • 3、小程序支付接入
  • 4、代码
  • 完整代码

支付宝开发文档中心
注意:个人无法使用此功能,因为个人申请使用是不会通过的

1、电脑网站支付,手机网站支付,app支付

查看接入准备,里面详细介绍了创建应用和配置应用的过程,还介绍了接口调用配置的使用即调用支付宝API客户端的配置
在这里插入图片描述
分两种模式:
1.一种是公钥模式加签在这里插入图片描述
2.另一种是公钥证书模式加签在这里插入图片描述
需要注意的是公钥证书模式加签提交数据使用certificateExecute方法

依赖:
依赖位于:在这里插入图片描述
在这里插入图片描述

<dependency><groupId>com.alipay.sdk</groupId><artifactId>alipay-sdk-java</artifactId><version>4.33.26.ALL</version>
</dependency>

请详细查看每个(app支付,手机网站支付,电脑网站支付)的接入准备
在这里插入图片描述

1.1、异步通知介绍

1.app支付的位于
在这里插入图片描述
在这里插入图片描述
2.手机网站支付(电脑网站支付类似)的位于
在这里插入图片描述

1.2、API和请求示例介绍

app支付,手机网站支付,电脑网站支付类似
在这里插入图片描述

2、当面付

当面付文档中心
流程和上面类似
在这里插入图片描述

在这里插入图片描述

3、小程序支付接入

创建小程序过程详细看一遍(比较麻烦):https://opendocs.alipay.com/mini/development
需要其中的AppID
在这里插入图片描述
小程序API:
在这里插入图片描述
在这里插入图片描述

小程序支付接入
需要注意小程序支付接入和当面付-接入准备一样
在这里插入图片描述
请求示例:
在这里插入图片描述
需要的详细参数:
注意:buyer_id为必填
在这里插入图片描述

获取小程序用户身份user_id(buyer_id)/验证小程序用户/用户授权 my.getAuthCode
在这里插入图片描述

4、代码

实现了小程序支付,电脑网站支付,手机网站支付,当面付,及支付回调

yaml中配置
需要注意的是:
#通知地址不能直接写成localhost:9090/xxx等,需要使用内网穿透免费的内网穿透工具-飞鸽穿透,什么是内网穿透

alipay-payment:#支付宝小程序alipay-mini-app:#AppIDapp-id: "xxx"#应用私钥app-private-key-string: "xxx"#应用公钥证书路径(绝对位置)app-public-cert-path: "G:/OEM/project/xxxx"#支付宝公钥证书路径(绝对位置)alipay-public-cert-path: "G:/OEM/project/xxxx"#支付宝根证书路径(绝对位置)alipay-root-cert-path: "G:/OEM/project/xxxx"#通知地址#通知地址不能直接写成localhost:9090/xxx等,需要使用内网穿透notify-url: "http://dreamrenderx.ifast3.vipnps.vip/alipay-payment/alipayMiniAppPaymentNotify"#WebWapApp程序web:#AppIDapp-id: "xxx"#应用私钥app-private-key-string: "xxxx"#应用公钥证书路径(绝对位置)app-public-cert-path: "G:/OEM/project/xxxx"#支付宝公钥证书路径(绝对位置)alipay-public-cert-path: "G:/OEM/project/xxxx"#支付宝根证书路径(绝对位置)alipay-root-cert-path: "G:/OEM/project/xxxx"#通知地址notify-url: "http://dreamrenderx.ifast3.vipnps.vip/alipay-payment/webPaymentNotify"

配置支付宝调用客户端,这里用的是公钥证书模式加签:

package com.xunan.demo.config;import com.alipay.api.AlipayClient;
import com.alipay.api.CertAlipayRequest;
import com.alipay.api.DefaultAlipayClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;@Slf4j
@Configuration
public class AlipayPaymentConfig {/*** 支付宝网关地址*/String GATEWAY_URL = "https://openapi.alipay.com/gateway.do";/*** 请求格式,固定值json*/String REQUEST_FORMAT = "json";/*** 字符集*/String REQUEST_CHARSET = "UTF-8";/*** 签名类型*/String SIGN_TYPE = "RSA2";/*** 支付宝小程序AppID*/@Value("${alipay-payment.alipay-mini-app.app-id}")String ALIPAY_MINI_APP_APP_ID;/*** 支付宝小程序应用私钥*/@Value("${alipay-payment.alipay-mini-app.app-private-key-string}")String ALIPAY_MINI_APP_APP_PRIVATE_KEY_STRING;/*** 支付宝小程序应用公钥证书路径(绝对位置)*/@Value("${alipay-payment.alipay-mini-app.app-public-cert-path}")String ALIPAY_MINI_APP_APP_PUBLIC_CERT_PATH;/*** 支付宝小程序支付宝公钥证书路径(绝对位置)*/@Value("${alipay-payment.alipay-mini-app.alipay-public-cert-path}")String ALIPAY_MINI_APP_ALIPAY_PUBLIC_CERT_PATH;/*** 支付宝小程序支付宝根证书路径(绝对位置)*/@Value("${alipay-payment.alipay-mini-app.alipay-root-cert-path}")String ALIPAY_MINI_APP_ALIPAY_ROOT_CERT_PATH;/*** Web、Wap、App程序AppID*/@Value("${alipay-payment.web.app-id}")String WEB_APP_ID;/*** Web、Wap、App程序应用私钥*/@Value("${alipay-payment.web.app-private-key-string}")String WEB_APP_PRIVATE_KEY_STRING;/*** Web、Wap、App程序应用公钥证书路径(绝对位置)*/@Value("${alipay-payment.web.app-public-cert-path}")String WEB_APP_PUBLIC_CERT_PATH;/*** Web、Wap、App程序支付宝公钥证书路径(绝对位置)*/@Value("${alipay-payment.web.alipay-public-cert-path}")String WEB_ALIPAY_PUBLIC_CERT_PATH;/*** Web、Wap、App程序支付宝根证书路径(绝对位置)*/@Value("${alipay-payment.web.alipay-root-cert-path}")String WEB_ALIPAY_ROOT_CERT_PATH;/*** 支付宝通用证书客户端构造器* 参考文档:https://opendocs.alipay.com/open/204/105297   公钥证书模式加签(注意最后一句话)** @param appID                应用ID* @param appPrivateKeyString  应用私钥* @param appPublicCertPath    应用公钥(路径)* @param alipayPublicCertPath 支付宝公钥(路径)* @param alipayRootCertPath   支付宝根证书(路径)* @return 支付宝通用证书客户端*/private AlipayClient commonCertClientBuilder(String appID,String appPrivateKeyString,String appPublicCertPath,String alipayPublicCertPath,String alipayRootCertPath) {try {//构造clientCertAlipayRequest certAlipayRequest = new CertAlipayRequest();//设置网关地址certAlipayRequest.setServerUrl(GATEWAY_URL);//设置应用IdcertAlipayRequest.setAppId(appID);//设置请求格式certAlipayRequest.setFormat(REQUEST_FORMAT);//设置字符集certAlipayRequest.setCharset(REQUEST_CHARSET);//设置签名类型certAlipayRequest.setSignType(SIGN_TYPE);//设置应用私钥certAlipayRequest.setPrivateKey(appPrivateKeyString);/** 注意!谨慎使用setPath* 如果使用setPath,需要写绝对目录,而不能直接使用getResource。可以考虑使用getResourceAsStream* 但是必须要注意的是,验签使用的AlipaySignature.rsaCertCheckV1并不支持使用setContent或者getResourceAsStream** 由于支付宝在读取秘钥的时候使用了File,其是将File文件转为了FileInputStream* 然而,在部署环境下,this.getClass().getResource(WEB_APP_PUBLIC_CERT_PATH).getPath()获取到的路径往往是在jar文件下* file:/code/target/pro-trueziroemdemo-boot-serverless.jar!/BOOT-INF/classes!/alipay-payment-cert-web/alipay-root-cert.crt** 可见如下解释:* 1* resource.getFile() expects the resource itself to be available on the file system, i.e. it can't be nested inside a jar file.* This is why it works when you run your application in STS (Spring Tool Suite) but doesn't work once you've built your application and run it from the executable jar.* Rather than using getFile() to access the resource's contents, I'd recommend using getInputStream() instead.* That'll allow you to read the resource's content regardless of where it's located.** 2* A java.io.File represents a file on the file system, in a directory structure.* The Jar is a java.io.File.* But anything within that file is beyond the reach of java.io.File.* As far as java is concerned, until it is uncompressed, a class in jar file is no different than a word in a word document.** 相同情况亦可发生在使用Resource resource = new ClassPathResource(this.getClass().getResource(WEB_ALIPAY_ROOT_CERT_PATH).getPath());时** 参考:https://stackoverflow.com/questions/25869428/classpath-resource-not-found-when-running-as-jar* 参考:https://stackoverflow.com/questions/14876836/file-inside-jar-is-not-visible-for-spring** *///设置应用公钥证书路径(绝对位置)certAlipayRequest.setCertPath(appPublicCertPath);设置应用公钥证书路径(Resource路径)//InputStream certInputStream = this.getClass().getResourceAsStream(appPublicCertPath);//String certContent;//if (certInputStream != null) {//    certContent = IOUtils.toString(certInputStream, StandardCharsets.UTF_8);//    log.info("读取应用公钥证书成功");//    certAlipayRequest.setCertContent(certContent);//} else {//    log.info("读取应用公钥证书失败");//}//设置支付宝公钥证书路径(绝对位置)certAlipayRequest.setAlipayPublicCertPath(alipayPublicCertPath);设置支付宝公钥证书路径(Resource路径)//InputStream alipayPublicCertInputStream = this.getClass().getResourceAsStream(alipayPublicCertPath);//String alipayPublicCertContent;//if (alipayPublicCertInputStream != null) {//    alipayPublicCertContent = IOUtils.toString(alipayPublicCertInputStream, StandardCharsets.UTF_8);//    log.info("读取支付宝公钥证书成功");//    certAlipayRequest.setAlipayPublicCertContent(alipayPublicCertContent);//} else {//    log.info("读取支付宝公钥证书失败");//}////设置支付宝根证书路径(绝对位置)certAlipayRequest.setRootCertPath(alipayRootCertPath);设置支付宝根证书路径(Resource路径)//InputStream alipayRootCertInputStream = this.getClass().getResourceAsStream(alipayRootCertPath);//String alipayRootCertContent;//if (alipayRootCertInputStream != null) {//    alipayRootCertContent = IOUtils.toString(alipayRootCertInputStream, StandardCharsets.UTF_8);//    log.info("读取支付宝根证书成功");//    certAlipayRequest.setRootCertContent(alipayRootCertContent);//} else {//    log.info("读取支付宝根证书失败");//}//构造clientreturn new DefaultAlipayClient(certAlipayRequest);} catch (Exception e) {e.printStackTrace();return null;}}/*** 支付宝网页Client构造器** @return 支付宝Client*/@Beanpublic AlipayClient webAlipayClient() {try {return commonCertClientBuilder(WEB_APP_ID,WEB_APP_PRIVATE_KEY_STRING,WEB_APP_PUBLIC_CERT_PATH,WEB_ALIPAY_PUBLIC_CERT_PATH,WEB_ALIPAY_ROOT_CERT_PATH);} catch (Exception exception) {exception.printStackTrace();return null;}}/*** 支付宝小程序Client构造器** @return 支付宝Client*/@Beanpublic AlipayClient alipayMiniAppAlipayClient() {try {return commonCertClientBuilder(ALIPAY_MINI_APP_APP_ID,ALIPAY_MINI_APP_APP_PRIVATE_KEY_STRING,ALIPAY_MINI_APP_APP_PUBLIC_CERT_PATH,ALIPAY_MINI_APP_ALIPAY_PUBLIC_CERT_PATH,ALIPAY_MINI_APP_ALIPAY_ROOT_CERT_PATH);} catch (Exception exception) {exception.printStackTrace();return null;}}}

业务实现

package com.xunan.demo.service;import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.request.AlipayTradeCreateRequest;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.alipay.api.request.AlipayTradePayRequest;
import com.alipay.api.request.AlipayTradeWapPayRequest;
import com.alipay.api.response.AlipayTradeCreateResponse;
import com.alipay.api.response.AlipayTradePagePayResponse;
import com.alipay.api.response.AlipayTradePayResponse;
import com.alipay.api.response.AlipayTradeWapPayResponse;
import com.xunan.demo.pojo.CommonResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;import javax.annotation.Resource;/*** 小程序的参考文档:https://opendocs.alipay.com/mini/introduce/pay* 其他的参考文档:https://opendocs.alipay.com/open/00a0ut   开放能力,顺着看** API列表中会告诉你整么调用支付功能*/
@Service
public class AlipayPaymentService {/*** 小程序回调接口*/@Value("${alipay-payment.alipay-mini-app.notify-url}")String ALIPAY_MINI_APP_PAYMENT_NOTIFY_URL;/*** Web、Wap、App回调接口*/@Value("${alipay-payment.web.notify-url}")String WEB_PAYMENT_NOTIFY_URL;/*** 小程序支付宝请求客户端* 使用的是AlipayPaymentConfig中注入的,因没有配置name属性所以spring自动注入同名的*/@ResourceAlipayClient alipayMiniAppAlipayClient;/*** Web、Wap、App支付宝请求客户端* 使用的是AlipayPaymentConfig中注入的,因没有配置name属性所以spring自动注入同名的*/@ResourceAlipayClient webAlipayClient;public String alipayMiniAppPaymentNotify() {return "success";}public String webPaymentNotify() {return "success";}/*** 小程序支付* 获取支付宝小程序支付数据 https://opendocs.alipay.com/mini/02j1c3** @param price   商品价格* @param subject 标题* @param buyerId 购买用户的UserId* @return 支付宝小程序支付数据*/public CommonResult<AlipayTradeCreateResponse> getAlipayMiniAppPayData(Double price, String subject, String buyerId) {//判断客户端是否为空if (alipayMiniAppAlipayClient == null) {return new CommonResult<>(false, "内部错误", null);}//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.create.AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();//设置回调接口request.setNotifyUrl(ALIPAY_MINI_APP_PAYMENT_NOTIFY_URL);//生成订单号String outTradeNumber = IdUtil.simpleUUID();//组装数据JSONObject requestData = new JSONObject();//设置订单号requestData.put("out_trade_no", outTradeNumber);//设置总价requestData.put("total_amount", price);//设置订单标题requestData.put("subject", subject);//设置买家支付宝用户IDrequestData.put("buyer_id", buyerId);//SDK已经封装掉了公共参数,这里只需要传入业务参数。request.setBizContent(requestData.toString());try {AlipayTradeCreateResponse response = alipayMiniAppAlipayClient.certificateExecute(request);//返回结果return new CommonResult<>(true, "成功", response);} catch (AlipayApiException e) {e.printStackTrace();return new CommonResult<>(false, "内部错误", null);}}/*** 获取电脑网站支付数据** @param price   商品价格* @param subject 标题* @return 支付宝小程序支付数据*/public CommonResult<AlipayTradePagePayResponse> getPagePayData(Double price, String subject) {//判断客户端是否为空if (webAlipayClient == null) {return new CommonResult<>(false, "内部错误", null);}//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.create.AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();//设置回调接口request.setNotifyUrl(WEB_PAYMENT_NOTIFY_URL);//生成订单号String outTradeNumber = IdUtil.simpleUUID();//组装数据JSONObject requestData = new JSONObject();//设置订单号requestData.put("out_trade_no", outTradeNumber);//设置总价requestData.put("total_amount", price);//设置订单标题requestData.put("subject", subject);//设置销售产品码requestData.put("product_code", "FAST_INSTANT_TRADE_PAY");//SDK已经封装掉了公共参数,这里只需要传入业务参数。request.setBizContent(requestData.toString());try {AlipayTradePagePayResponse response = webAlipayClient.certificateExecute(request);//返回结果return new CommonResult<>(true, "成功", response);} catch (AlipayApiException e) {e.printStackTrace();return new CommonResult<>(false, "内部错误", null);}}/*** 获取手机网站支付数据** @param price   商品价格* @param subject 标题* @param quitUrl 用户付款中途退出返回商户网站的地址* @return 支付宝小程序支付数据*/public CommonResult<AlipayTradeWapPayResponse> getWapPayData(Double price, String subject, String quitUrl) {//判断客户端是否为空if (webAlipayClient == null) {return new CommonResult<>(false, "内部错误", null);}//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.create.AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();//设置回调接口request.setNotifyUrl(WEB_PAYMENT_NOTIFY_URL);//生成订单号String outTradeNumber = IdUtil.simpleUUID();//组装数据JSONObject requestData = new JSONObject();//设置订单号requestData.put("out_trade_no", outTradeNumber);//设置总价requestData.put("total_amount", price);//设置订单标题requestData.put("subject", subject);//设置销售产品码requestData.put("product_code", "QUICK_WAP_WAY");//设置用户付款中途退出返回商户网站的地址requestData.put("quit_url", quitUrl);//SDK已经封装掉了公共参数,这里只需要传入业务参数。request.setBizContent(requestData.toString());try {AlipayTradeWapPayResponse response = webAlipayClient.certificateExecute(request);//返回结果return new CommonResult<>(true, "成功", response);} catch (AlipayApiException e) {e.printStackTrace();return new CommonResult<>(false, "内部错误", null);}}/*** 当面付* https://opendocs.alipay.com/open/02ekfp?ref=api&scene=32** @param price    商品价格* @param subject  标题* @param authCode 支付授权码* @return 支付宝小程序支付数据*/public CommonResult<AlipayTradePayResponse> codePay(Double price, String subject, String authCode) {//判断客户端是否为空if (webAlipayClient == null) {return new CommonResult<>(false, "内部错误", null);}//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.create.AlipayTradePayRequest request = new AlipayTradePayRequest();//设置回调接口request.setNotifyUrl(WEB_PAYMENT_NOTIFY_URL);//生成订单号String outTradeNumber = IdUtil.simpleUUID();//组装数据JSONObject requestData = new JSONObject();//设置订单号requestData.put("out_trade_no", outTradeNumber);//设置总价requestData.put("total_amount", price);//设置订单标题requestData.put("subject", subject);//支付场景requestData.put("scene", "bar_code");//支付授权码requestData.put("auth_code", authCode);//SDK已经封装掉了公共参数,这里只需要传入业务参数。request.setBizContent(requestData.toString());try {AlipayTradePayResponse response = webAlipayClient.certificateExecute(request);//返回结果return new CommonResult<>(true, "成功", response);} catch (AlipayApiException e) {e.printStackTrace();return new CommonResult<>(false, "内部错误", null);}}
}

完整代码

https://gitee.com/xunan29/paymentdemo-boot-project


http://chatgpt.dhexx.cn/article/cqFo8SRv.shtml

相关文章

支付功能

Django rest framework之支付功能 一.支付宝支付 1.进入蚂蚁金服开放平台&#xff08;查看api&#xff09;&#xff1a; 1.1在正式生产环境中需要创建应用&#xff08;需审核&#xff09;&#xff1a; 1.2沙箱环境&#xff08;测试&#xff09;&#xff1a; 可以在文档中查看对…

springboot实现支付宝支付功能

支付系统中容易出现的问题 1&#xff0c;用户在页面下订单后&#xff0c;价格被篡改&#xff1b; 解决方案&#xff1a;通过后端计算订单的总金额 2&#xff0c;订单重复处理。用户支付成功后&#xff0c;支付宝会短时间内多次调用我们的回调接口&#xff0c;如果出现网络波动…

2021年,Flutter 与 React Native该如何选择?,安卓app开发教程

一、Flutter 应用的优势 =========================================================================== 1. 热重载 = 快速编码 Flutter 允许开发人员使用一种更复杂、更快速的方式来创建应用程序。这是 Flutter 的最大优势之一,也是所有顶级移动应用开发公司都颇为看重的…

一大波开发者福利来了,一份微软官方Github上发布的开源项目清单等你签收

目录 微软Github开源项目入口微软开源项目受欢迎程度排名 Visual Studio CodeTypeScriptRxJS.NET Core 基础类库CNTKMicrosoft calculatorMonaco editorMS-DOSRedis windows版.NET Core CLR (公共语言运行时)ASP.NET CoreEntity Framework CorePowerShell如何在其中搜索自己需要…

.Net资讯 | 一大波开发者福利来了, 一份微软官方Github上发布的开源项目清单等你签收...

目录 微软Github开源项目入口微软开源项目受欢迎程度排名 Visual Studio CodeTypeScriptRxJS.NET Core 基础类库CNTKMicrosoft calculatorMonaco editorMS-DOSRedis windows版.NET Core CLR (公共语言运行时)ASP.NET CoreEntity Framework CorePowerShell如何在其中搜索自己需要…

FullCalendar:eventColor,eventBackgroundColor, eventBorderColor, and eventTextColor

<!DOCTYPE html><html><head><meta charsetutf-8 /><title>背景色設定</title><link href../fullcalendar.min.css relstylesheet /><link href../fullcalendar.print.min.css relstylesheet mediaprint /><script src../l…

Flutter 与 React Native 该如何选择

跨平台程序员之间关于 React Native 和 Flutter 的旷日持久的争论越来越白热化了。前几年&#xff0c;React Native 还是开发人员的首选框架&#xff0c;但是自 2017 年 Flutter 发布以来&#xff0c;其已经发展成为 React Native 的一个强有力竞争对手。 最近&#xff0c;随着…

2021年,Flutter 与 React Native该如何选择?

????????关注后回复 “进群” &#xff0c;拉你进程序员交流群???????? 作者 | Wasim Charoliya 译者 | 王强 策划 | 田晓旭 2021 年&#xff0c;跨平台程序员之间关于 React Native 和 Flutter 的旷日持久的争论越来越白热化了。前几年&#xff0c;React Nati…

React Native 三端同构实践

⚠️ 博客中涉及的代码内容可查看 Github: react-native-isomorphism React Native三端同构皆在&#x1f22f;️在不改动 React Native 代码下&#xff0c;公用一套代码架构, 在浏览器中实现同样的展示、交互、功能。 在实际开发过程中, 尤其创业公司, 需求的迭代周期是非常快…

吐血推荐|2万字总结Mac所有应用程序、软件工具和相关资料

现在随着互联网的发展&#xff0c;越来越多的公司都鼓励Mac办公&#xff0c;属实MacOS系统对于我们的工作开发效率有很大提升&#xff0c;所以我们需要收集各种类别非常好用的 Mac 应用程序、软件以及工具。作为一个资深 Mac 用户&#xff0c;我需要它们帮助我快乐、高效的工作…

网易云音乐React Native体系建设与发展

本文作者&#xff1a;章伟东 &#xff08;网易云音乐大前端团队&#xff09; 0.33 历史 17 年 3 月份&#xff0c;为了解决商城性能和用户体验问题&#xff0c;云音乐技术团队组建了一只 4 人 ReactNative 开发小分队&#xff1a;我负责 RN 前端开发&#xff0c;安卓和 iOS 两…

每周分享第 26 期

这里记录过去一周&#xff0c;我看到的值得分享的东西&#xff0c;每周五发布。 Basecamp 是 IT 行业很有名的一家公司&#xff0c;提供团队协作工具&#xff0c;同时也是 Rails on Ruby 框架的创造者。这家公司的特别之处在于&#xff0c;它不仅写软件&#xff0c;还写畅销书&…

爱开源的微软是如何击败 Facebook、Google 成为 GitHub No.1 的?

拥抱开源的微软这几年究竟都做了些什么&#xff1f; 去年今月&#xff0c;我在微软开发者峰会上见到了《设计模式&#xff1a;可复用面向对象软件的基础》联合作者、现任微软技术院士&#xff08;Technical Fellow at Microsoft&#xff09;Erich Gamma&#xff0c;那是我第一次…

跨端与同构开发技术一览

关键词&#xff1a;React Native, uni-app, Flutter ,Tauri, Ionic 和 weex 文章目录 前言跨端技术简史几种常见跨端技术对比小程序的繁荣跨端同构技术uni-appTaroreact-native-webreactxpWeex阿里的RaxRemax去哪儿网的qrn-remax-unir去哪儿网的anuKbone腾讯新一代跨端开发框架…

@开发者,一份微软官方Github上发布的开源项目清单等你签收

最近在倒腾WPF的项目&#xff0c;试着搜一下微软官方提供的WPF Smaples, 结果找到了https://github.com/Microsoft/WPF-Samples. 当然还发现了Cortana相关的开源资料http://microsoft.github.io/UWPQuickStart/docs/challenges/cortana-integration.html和UWP资源http://micros…

React Native 三端同构实战

WeiboGoogle用电子邮件发送本页面 0 React Native 三端&#xff08;Web、iOS、Android&#xff09;同构是指在不改动原 React Native 的代码下&#xff0c;让其在浏览器中运行出和在 React Native 环境下一样的页面。对于使用 React Native 开发的页面&#xff0c;如果又单独为…

reactxp搭建,start:windows运行不起来

1、官网 reactxp 2、VSCode和Visual Studio2019 安装VSCode Visual Studio 下载地址 先不用勾选工作负荷&#xff0c;直接安装 3、安装nvm 访问下载地址下载安装nvm&#xff1a; 百度云分享 官网直装链接 nvm的github发行界面下载nvm-setup.exe GitCode镜像下载nvm-setup…

微软发布ReactXP:方便开发者构建跨平台应用

说起跨平台开发工具&#xff0c;开发者们最先想到的无外乎是 Cordova 和 Xamarin。但是前者无法提供足够令人满意的性能表现&#xff0c;而后者在 Web 开发上心有余而力不足。所以&#xff0c;微软 Skype 团队基于 React JS 和 React Native 开发了一款全新的跨平台开发工具 —…

跨平台技术实践案例: 用 reactxp 重写墨刀的移动端

重新编写&#xff0c;又一次&#xff0c;我们又一次重新编写了移动端应用和移动端网站。要重新编写是一个风险很大的决定&#xff0c;但是其必要性以及它所带来的收益是我们无法拒绝的。这篇文章会分享我们为什么这么做&#xff0c;我们是怎么做的&#xff0c;以及这次重写后为…

ReactXP入门指南

ReactXP入门指南 1.ReactXP介绍 ReactXP使用了React框架&#xff0c;使得开发人员可以使用React开发他们的跨平台任务。 React的理念是“学习一次&#xff0c;写在任何地方”。使用React和React Native&#xff0c;应用程序可以与iOS和Android应用程序共享大部分逻辑&#x…