更新记录

1.0.0(2024-09-20) 下载此版本

十年磨剑终成锋,一朝破竹势如虹 纸上得来终觉浅,绝知此事要躬行

最新PC端web前端架构:Vue3+Pinia+Vite+TS+Element-plus 最新移动端跨平台前端架构:Uniapp+Vue3+Pinia+Vite+TS+WotDesignUni+TuniaoUI 支持VScode编辑器开发 最新Electron桌面应用前端架构:Electron+Vue3+Pinia+Vite+TS+Element-plus 最新Nwjs桌面应用(支持XP系统)前端架构:Nwjs+Vue2+Vuex+Vite+js+Element-ui

开发文档官方网址:https://www.wit-ui.com

冰冻三尺,非一日之寒,积土成山,非斯须之作 2024年最新前端架构让开发效率提升8~10倍

10w级企业内部系统前端架构,几十个知名企业中后台实践。

1.同时兼容自定义tabar与原生tabar 2.类似axios请求封装 3.添加请求拦截、登录拦截、路由拦截等权限控制功能 4.全局notify-消息通知、modal-模态框能覆盖原生tabar,无须每个页面添加对应组件麻烦操作,调用hooks函数即可 5.兼容pc端与移动端同一套框架开发不同终端应用,同一批人用同一种语言专心干同一件事,降低开发与维护成本。


平台兼容性

HbuilderX/cli最低兼容版本
4.24

uni-app

Vue2 Vue3
?
app-vue app-nvue app-android app-ios app-harmony
? ? ? ? ?
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
? ? ? ? ? ? ? ? ?
微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序 钉钉小程序 快手小程序 飞书小程序 京东小程序
? ? ? ? ? ? ? ? ?
快应用-华为 快应用-联盟
? ?

uni-app x

app-android app-ios
? ?
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
? ? ? ? ? ? ? ? ?

logo

Wit-ui大型系统微前端架构-移动端

Uniapp+Vue3+Pinia+Vite+TS+WotDesignUni+TuniaoUI

✈️ 官方网站 (推荐)  🚀 文档网站 

冰冻三尺,非一日之寒,积土成山,非斯须之作

2024年最新前端架构让开发效率提升8~10倍

十年磨剑终成锋,一朝破竹势如虹

纸上得来终觉浅,绝知此事要躬行

10w级企业内部系统前端架构,几十个知名企业中后台实践

🔊 支持多端

PC端web前端架构:Vue3+Pinia+Vite+TS+Element-plus,项目地址:获取地址 不开源

移动端跨平台前端架构:Uniapp+Vue3+Pinia+Vite+TS+WotDesignUni+TuniaoUI 支持VScode编辑器开发,项目地址:https://gitee.com/wit-ui/wit-app.git 开源

Electron桌面应用前端架构:Electron+Vue3+Pinia+Vite+TS+Element-plus,项目地址:获取地址 不开源

Nwjs桌面应用(支持XP系统)前端架构:Nwjs+Vue2+Vuex+Vite+js+Element-ui,项目地址:获取地址 不开源

开发文档官方网址:https://www.wit-ui.com

🔊 安装说明

# win10安装node:node-v16.18.1-x64.msi(https://nodejs.org/download/release/v16.18.1/node-v16.18.1-x64.msi)
# vscode中文版插件:Chinese (Simplified)(必须安装)
# vscode快速生成语法糖模板: element-plus-helper(vue页面中输入vab-指令即可快速生成语法糖模板/输入el-快速生成代码)(必须安装)
# vscode代码校验: Eslint(必须安装)
# css编译时格式校验: stylelint(必须安装)
# vue3 Ts格式化:Vue - Official(必须安装)
# import 引入自动补全:Auto Import(必须安装)
# 自动补全 html 标签:Auto Close Tag(推荐安装)
# 自动重命名 html 标签:Auto Rename Tag(推荐安装)
# 查看你引入的依赖模块大小:Import Cost(可不安装)
# 查查看 git 提交历史:Git History(可不安装)

# 克隆项目
git clone https://www.gitee.com/wit-ui/wit-app.git

# 安装pnpm
npm install -g pnpm

# 安装依赖(pnpm、yarn、cnpm、npm均可,推荐用pnpm或cnpm)
pnpm i

# 本地h5开发
npm run dev:h5

# 本地app开发
npm run dev:app

# 本地h5生产打包
npm run build:h5

# 本地app生产打包
npm run build:app

# npm删除缓存
npm cache clean --force

# pnpm查看缓存路径
pnpm store path

# pnpm删除缓存
pnpm store prune

🔊 代码目录结构

├── .github # 自动化 ci 配置(可删除)
├── .vscode # vscode 配置(不可删除)
├── node_modules # 项目依赖模块
├── src
│ ├── api # API 服务模块
│ ├── components # 本地组件库
│ │ ├── witIcon # 自定义阿里图标库图标组件
│ │ ├── witStatusBar # 状态栏组件
│ │ ├── witTabbar # 自定义底部tabar组件
│ │ └── ...
│ ├── hooks # 全局hooks函数 包括$baseConfirmCenter全局弹窗组件/$baseMessageTop全局弱提示组件等
│ ├── hybrid # 本地html文件
│ ├── interceptors # 拦截器 包括请求拦截、登录拦截、路由拦截等权限控制功能
│ ├── layouts # 自定义底部tabar时,页面公用部分框架
│ │ ├── default.vue # 默认公用部分框架
│ │ ├── demo.vue # demo公用部分框架
│ │ └── tabbar.vue # 自定义tabbar公用部分框架
│ ├── pages # 页面
│ │ ├── error # 包括403/404/500/503页面,配合拦截器使用
│ │ ├── index # 首页
│ │ ├── login # 登录
│ │ ├── my # 我的
│ │ ├── news # 消息
│ │ └── test # 开发测试组件页面
│ ├── static # 本地静态资源
│ ├── store # pinia数据状态管理
│ │ ├── modules # pinia 数据模块集合
│ │ │ ├── common # 公用数据模块
│ │ │ ├── systemConfig # 系统配置模块
│ │ │ └── user # 用户信息模块
│ │ └── index # pinia数据模块化组合成一个主模块
│ ├── style # 公用样式 更改第三方组件样式
│ ├── types # 公用类型 存放自动生成的auto-import.d.ts/components.d.ts/uni-pages.d.ts等.d.ts文件,无须重复引用
│ ├── uni_modules # 第三方组件存放
│ ├── utils # ts 工具
│ │ ├── dict.ts # 获取字典方法
│ │ ├── encrypt.ts # 三级等保登录加密方法
│ │ ├── index.ts # 暴露基本方法
│ │ ├── platform.ts # 判断平台
│ │ ├── request.ts # 请求数据方法封装,类似axios请求封装
│ │ ├── validate.ts # 基本正则表达式表单校验
│ │ ├── witModal.ts # 全局modal-模态框方法
│ │ └── witNotify.ts # 全局notify-消息通知方法
│ ├── App.vue # 入口vue文件
│ ├── main.ts # # 入口ts文件
│ ├── manifest.json # 全局配置文件,由manifest.config.ts文件生成,无须手动更改自动生成
│ ├── pages.json # # 路由文件,由pages.config.ts文件生成,无须手动更改自动生成
│ ├── uni.scss # 全局css变量
│ └── wit.css # 全局第三方组件库css变量
├── .env # 全局接口域名配置文件,包括appid等
├── .env.development # 开发环境变量
├── .env.production # 生成环境变量
├── .env.test # 测试环境变量
├── .eslintrc.js # eslint 配置项
├── .gitignore # 排除提交git项
├── package.json # node启动配置
├── manifest.config.ts # 全局配置文件
├── pages.config.ts # 路由配置文件
├── index.html # 入口页
├── tsconfig.json # ts配置文件
└── vite.config.ts # vite 配置

🔊 后端返回 code 的约定

  • 常用的 code:200-正常 500-错误提示用 401-回到登录页用 402-刷新 token 用
  200: '服务器成功返回请求数据', //常用
  201: '新建或修改数据成功',
  202: '一个请求已经进入后台排队(异步任务)',
  204: '删除数据成功',
  400: '发出信息有误',
  401: '用户没有权限(令牌失效、用户名、密码错误、登录过期)', //常用
  402: '令牌过期', //常用
  403: '用户得到授权,但是访问是被禁止的',
  404: '访问资源不存在',
  406: '请求格式不可得',
  410: '请求资源被永久删除,且不会被看到',
  500: '服务器发生错误', //常用
  502: '网关错误',
  503: '服务不可用,服务器暂时过载或维护',
  504: '网关超时',

🔊 tsconfig.json 详解

"incremental": true, // TS编译器在第一次编译之后会生成一个存储编译信息的文件,第二次编译会在第一次的基础上进行增量编译,可以提高编译的速度
"tsBuildInfoFile": "./buildFile", // 增量编译文件的存储位置
"diagnostics": true, // 打印诊断信息
"target": "ES5", // 目标语言的版本
"module": "CommonJS", // 生成代码的模板标准
                 // 默认值 target === "es3" or "es5" ?"commonjs" : "es6"
"outFile": "./app.js", // 将多个相互依赖的文件生成一个文件,可以用在AMD模块中,
                      // 即开启时应设置"module": "AMD",
//target 为 es6 时: ["dom", "es6", "dom.iterable", "scripthost"]
"allowJS": true, // 允许编译器编译JS,JSX文件
"checkJs": true, // 允许在JS文件中报错,通常与allowJS一起使用
"outDir": "./dist", // 指定输出目录
"rootDir": "./", // 指定输出文件目录(用于输出),用于控制输出目录结构
"declaration": true, // 生成声明文件,开启后会自动生成声明文件
"declarationDir": "./file", // 指定生成声明文件存放目录
"emitDeclarationOnly": true, // 只生成声明文件,而不会生成js文件
"sourceMap": true, // 生成目标文件的sourceMap文件
"inlineSourceMap": true, // 生成目标文件的inline SourceMap,//inline SourceMap会包含在生成的js文件中
"declarationMap": true, // 为声明文件生成sourceMap
"typeRoots": [], // 声明文件目录,默认时node_modules/@types
"types": [], // 加载的声明文件包
              //如果指定了某个值, 她会在 typeRoots 下找这个包,找到了就只加载这个包
"removeComments":true, // 删除注释
"noEmit": true, // 不输出文件,即编译后不会生成任何js文件
"noEmitOnError": true, // 发送错误时不输出任何文件
"noEmitHelpers": true, // 不生成helper函数,减小体积,需要额外安装,常配合importHelpers一起使用
"importHelpers": true, // 通过tslib引入helper函数,文件必须是模块
"downlevelIteration": true, // 降级遍历器实现,如果目标源是es3/5,那么遍历器会有降级的实现
"strict": true, // 开启所有严格的类型检查
"alwaysStrict": true, // 在代码中注入'use strict'
"noImplicitAny": true, // 不允许隐式的any类型
"strictNullChecks": true, // 不允许把null、undefined赋值给其他类型的变量
"strictFunctionTypes": true, // 不允许函数参数双向协变
"strictPropertyInitialization": true, // 类的实例属性必须初始化
"strictBindCallApply": true, // 严格的bind/call/apply检查
"noImplicitThis": true, // 不允许this有隐式的any类型s
"noUnusedLocals": true, // 检查只声明、未使用的局部变量(只提示不报错)
"noUnusedParameters": true, // 检查未使用的函数参数(只提示不报错)
"noFallthroughCasesInSwitch": true, // 防止switch语句贯穿(即如果没有break语句后面不会执行)
"noImplicitReturns": true, //每个分支都会有返回值
"esModuleInterop": true, // 允许export=导出,由import from 导入
"allowUmdGlobalAccess": true, // 允许在模块中全局变量的方式访问umd模块
"moduleResolution": "node", // 模块解析策略,ts默认用node的解析策略,即相对的方式导入
"baseUrl": "./", // 解析非相对模块的基地址,默认是当前目录
"paths": { // 路径映射,相对于baseUrl
    // 如使用jq时不想使用默认版本,而需要手动指定版本,可进行如下配置
   "jquery": ["node_modules/jquery/dist/jquery.min.js"]
  },
"rootDirs": ["src","out"], // 将多个目录放在一个虚拟目录下,用于运行时,
                          //即编译后引入文件的位置可能发生变化,
                          //这也设置可以虚拟src和out在同一个目录下,不用再去改变路径也不会报错
"listEmittedFiles": true, // 打印输出文件
"listFiles": true , // 打印编译的文件(包括引用的声明文件)
"jsx":"Preserve"   //在 .tsx 中支持 JSX :React 或 Preserve
"jsxFactory":""   //默认值 React.createElement 。  jsx 设置为 React 时使用的创建函数

"lib": [ // 编译过程中需要引入的库文件的列表
      "es5",
      "es2015",
      "es2016",
      "es2017",
      "es2018",
      "dom"
    ]
  },
  // 指定一个匹配列表(属于自动指定该路径下的所有ts相关文件)
  "include": [
    "src/**/*"
  ],
  // 指定一个排除列表(include的反向操作)
  "exclude": [
    "demo.ts"
  ],
  // 指定哪些文件使用该配置(属于手动一个个指定文件)
  "files": [
    "demo.ts"
  ]

🔊 提高网站加载速度

nginx 配置:vim /etc/nginx/nginx.conf

#是否启动gzip压缩,on代表启动,off代表开启
gzip  on;

#需要压缩的常见静态资源
gzip_types text/plain application/javascript   application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;

#由于nginx的压缩发生在浏览器端而微软的ie6很坑爹,会导致压缩后图片看不见所以该选
项是禁止ie6发生压缩
gzip_disable "MSIE [1-6]\.";

#如果文件大于1k就启动压缩
gzip_min_length 1k;

#以16k为单位,按照原始数据的大小以4倍的方式申请内存空间,一般此项不要修改
gzip_buffers 4 16k;

#压缩的等级,数字选择范围是1-9,数字越小压缩的速度越快,消耗cpu就越大
gzip_comp_level 2;

#引导的在/etc/nginx/conf.d目录下所有后缀为.conf的子配置文件
include /etc/nginx/conf.d/*.conf;
nginx -t

nginx -s reload

🔊 样式scoped

强烈建议使用 scoped ,父组件的样式将不会渗透到子组件中。不过一个子组件的根节点会同时受其父组件的 scoped CSS 和子组件的 scoped CSS 的影响。这样设计是为了让父组件可以从布局的角度出发,调整其子组件根元素的样式。

#通过深度选择器自定义子组件样式

<style lang="scss" scoped>
:deep(*) {
      .el-menu--collapse {
        border-right: 0 !important;

        .el-submenu__icon-arrow {
          right: 10px;
          margin-top: -3px;
        }

        .el-submenu__title {
          span {
            display: none;
          }
        }
      }
    }
</style>

🔊 如何快速编写完成后端接口

  • 第 1 步: 本地启动一个最原始的带 mock 的项目,退回到登录页,打开浏览器控制台,开始模拟登录,此时你可以在浏览器 network(网络)中看到/login、/userInfo、/logout的 json 格式和参数
  • 第 2 步:开始完整照着 network 编写后端接口,使用 postman 测试通过(注意 postman 支持跨域而浏览器不支持,故需要先配置好对应的后端跨域)
  • 第 3 步:修改src/interceptors/request.ts里面的 baseURL 即可
  • 第 4 步:如需使用进阶方案,采用后端路由,请详见【路由配置】模块

🔊 如何连接后端接口

  • 直接连接方案(记得后端配置跨域) 修改位置.env里面VITE_APP_BASE_URL参数
/**
 * @description 导出网络配置
 **/
.env文件中VITE_APP_BASE_URL='https://apifoxmock.com/m1/4593503-4242983-default'

🔊 项目开发必要接口

本项目需要三个必要的接口,联调前务必保证这登录接口、用户信息接口、退出接口无问题,请注意application/x-www-form-urlencoded;charset=UTF-8与 application/json;charset=UTF-8请求的区别,具体可在src/interceptors/request.ts 中配置,注意:除登录接口外其他接口连接后端后携带 token,格式如下Authorization: Bearer admin-token-24ba1FFF-AcC8-f0AE-ECea-A1EE12d712Ae-后端在登陆时返回给你的token字符串

  • 登录接口 /login(post 请求) application/json;charset=UTF-8 请求参数(默认格式)
{
  "username": "admin",
  "password": "123456"
}

返回格式:(必须严格按照此格式,不能为空这里返回的 token 会在今后所有的接口中自动通过 headers 的 Authorization 携带到后端,后端注意接收并处理跨域问题)

{
  "code": 200,
  "msg": "success",
  "data": {
    "token": "admin-accessToken-xxxxxx"
  }
}

用户信息接口 /userInfo(get 请求)

此接口默认会通过 headers 将 Authorization(token)传递到后端,后端根据 headers 判断用户所包含的权限,并返回相应的数据即可

  • 返回格式:(必须严格按照此格式,不能为空)

rbac 文档

{
  "code": 200,
  "msg": "success",
  "data": {
    "username": "admin",
    "roles": ["Admin"],
    "permissions": ["read:system", "write:system", "delete:system"],
    "avatar": "https://i.gtimg.cn/club/item/face/img/2/16022_100.gif"
  }
}

退出接口 /logout(get 请求)

此接口默认会通过 headers 将 Authorization(token)传递到后端,后端根据 headers 判断用户所包含的权限,退出对应的账号即可

  • 返回格式
{
  "code": 200,
  "msg": "success"
}
  • 其余可配置关闭的接口,如顶部的搜索、通知接口请自行查看mock/controller下的示例
  • 接口风格将都是 restful 的规范

🔊 前端请求示例

  • 强烈建议:所有请求放到 src/api 文件夹下
// post请求示例
import request from "@/utils/request";

export function getList(data) {
  return request({
    url: "/table/list",
    method: "post",
    data,
  });
}
// get请求示例
import request from "@/utils/request";

export function getList(params) {
  return request({
    url: "/table/list",
    method: "get",
    params,
  });
}

🔊 前端请求约定

  • 请求中会在 headers 中自动传入 token,格式如下Authorization: Bearer admin-token-24ba1FFF-AcC8-f0AE-ECea-A1EE12d712Ae-后端在登陆时返回给你的token字符串
/*表格中请求参数约定*/
{
  "pageNum": 1, //页数
  "pageSize": 10 //每页条数
}

resultful 的规范,后端返回 JSON 数据的约定

{
  "code": 200, //成功的状态码
  "msg": "success", //提示信息
  "data": { //返回数据
      "list": [{},{},{}], //返回数组
      "total": 238, //总条数(表格中用到,其它接口可以不返回)
  }
}

🔊 后端返回 code 的约定

  • 常用的 code:200-正常 500-错误提示用 401-回到登录页用 402-刷新 token 用
  200: '服务器成功返回请求数据', //常用
  201: '新建或修改数据成功',
  202: '一个请求已经进入后台排队(异步任务)',
  204: '删除数据成功',
  400: '发出信息有误',
  401: '用户没有权限(令牌失效、用户名、密码错误、登录过期)', //常用
  402: '令牌过期', //常用
  403: '用户得到授权,但是访问是被禁止的',
  404: '访问资源不存在',
  406: '请求格式不可得',
  410: '请求资源被永久删除,且不会被看到',
  500: '服务器发生错误', //常用
  502: '网关错误',
  503: '服务不可用,服务器暂时过载或维护',
  504: '网关超时',

🔊 同道中人交流群

QQ交流群:379224645 微信交流群 作者微信:wit-ui

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

木兰宽松许可证,第2版

木兰宽松许可证,第2版

2020年1月 http://license.coscl.org.cn/MulanPSL2

您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:

  1. 定义

“软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。

“贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。

“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。

“法人实体” 是指提交贡献的机构及其“关联实体”。

“关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是 指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。

  1. 授予版权许可

每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可 以复制、使用、修改、分发其“贡献”,不论修改与否。

  1. 授予专利许可

每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定 撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡 献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软 件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“ 关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或 其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权 行动之日终止。

  1. 无商标许可

“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定 的声明义务而必须使用除外。

  1. 分发限制

您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“ 本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。

  1. 免责声明与责任限制

“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对 任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于 何种法律理论,即使其曾被建议有此种损失的可能性。

  1. 语言

“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文 版为准。

条款结束

如何将木兰宽松许可证,第2版,应用到您的软件

如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:

1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;

2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;

3, 请将如下声明文本放入每个源文件的头部注释中。

Copyright (c) [Year] [name of copyright holder] [Software Name] is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.

Mulan Permissive Software License,Version 2

Mulan Permissive Software License,Version 2 (Mulan PSL v2)

January 2020 http://license.coscl.org.cn/MulanPSL2

Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:

  1. Definition

Software means the program and related documents which are licensed under this License and comprise all Contribution(s).

Contribution means the copyrightable work licensed by a particular Contributor under this License.

Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.

Legal Entity means the entity making a Contribution and all its Affiliates.

Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.

  1. Grant of Copyright License

Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.

  1. Grant of Patent License

Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.

  1. No Trademark License

No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.

  1. Distribution Restriction

You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.

  1. Disclaimer of Warranty and Limitation of Liability

THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

  1. Language

THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.

END OF THE TERMS AND CONDITIONS

How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software

To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:

i. Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;

ii. Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;

iii. Attach the statement to the appropriate annotated syntax at the beginning of each source file.

Copyright (c) [Year] [name of copyright holder] [Software Name] is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问