diff --git a/App.vue b/App.vue index 07e285c..768bbd2 100644 --- a/App.vue +++ b/App.vue @@ -19,7 +19,7 @@ this.globalData.$i18n = this.$i18n this.globalData.$t = str => this.$t(str) initApp(); - uniIdPageInit() + uniIdPageInit() // #ifdef APP-PLUS //checkIsAgree(); APP端暂时先用原生默认生成的。目前,自定义方式启动vue界面时,原生层已经请求了部分权限这并不符合国家的法规 diff --git a/common/appInit.js b/common/appInit.js index b62d38c..4a0f3e0 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -47,17 +47,17 @@ export default async function() { methodName, // 云对象的方法名称 params // 参数列表 }) { - // console.log('interceptObject',{ - // objectName, // 云对象名称 - // methodName, // 云对象的方法名称 - // params // 参数列表 - // }); + console.log('interceptObject',{ + objectName, // 云对象名称 + methodName, // 云对象的方法名称 + params // 参数列表 + }); if(objectName == "uni-id-co" && (methodName.includes('loginBy') || ['login','registerUser'].includes(methodName) )){ console.log('执行登录相关云对象'); - params[0].inviteCode = await new Promise((callBack) => { + params[0].inviteCode = await new Promise((callBack) => { uni.getClipboardData({ success: function(res) { - console.log('剪切板内容:'+res.data); + console.log('剪切板内容:'+JSON.stringify(res)); if (res.data.slice(0, 18) == 'uniInvitationCode:') { let uniInvitationCode = res.data.slice(18, 38) console.log('当前用户是其他用户推荐下载的,推荐者的code是:' + uniInvitationCode); diff --git a/env.js b/env.js new file mode 100644 index 0000000..3e966c3 --- /dev/null +++ b/env.js @@ -0,0 +1,33 @@ +// 参考文档: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/#envjs +module.exports = { + "is-custom-runtime": false, + "UNI_TEST_CUSTOM_ENV": {}, + "compile": true, + "h5": { + "options": { + "headless": true + }, + "executablePath": "" + }, + "mp-weixin": { + "port": 9420, + "account": "", + "args": "", + "cwd": "", + "launch": true, + "teardown": "disconnect", + "remote": false, + "executablePath": "" + }, + "app-plus": { + "android": { + "id": "", + "executablePath": "" + }, + "version": "", + "ios": { + "id": "", + "executablePath": "" + } + } +} diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..a54d98a --- /dev/null +++ b/jest.config.js @@ -0,0 +1,11 @@ +module.exports = { + testTimeout: 10000, + reporters: [ + 'default' + ], + watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'], + moduleFileExtensions: ['js', 'json'], + rootDir: __dirname, + testMatch: ["/pages/**/*test.[jt]s?(x)"], + testPathIgnorePatterns: ['/node_modules/'] +} diff --git a/pages-config/pages-all.json b/pages-config/pages-all.json index 39620ad..240d441 100644 --- a/pages-config/pages-all.json +++ b/pages-config/pages-all.json @@ -1,43 +1,36 @@ /* /// Pages-Tool: 该文件是pages-tool插件的配置文件,根据pages-config.json的配置,本文件的内容可能合并到pages.json*/ { - "pages": [ - // { - // "path": "pages/grid/login", - // "style": { - // "navigationStyle": "custom" - // } - // } - // , - - { - "path": "pages/grid/grid", + "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "pages/index/index", "style": { - "navigationStyle": "custom" - } - },{ - "path": "pages/ucenter", - "style": { - "navigationStyle": "custom" + "navigationBarTitleText": "主页" } }, { - "path": "pages/list/list", + "path": "pages/cal/cal", "style": { - "navigationStyle": "custom" + "navigationBarTitleText": "计算" } }, { - "path": "pages/list/detail", + "path": "pages/info/info", "style": { - "navigationStyle": "custom" + "navigationBarTitleText": "资料" + } + }, + { + "path": "pages/ucenter/ucenter", + "style": { + "navigationBarTitleText": "我的" } } - // #ifdef APP-PLUS - ,{ + , + { "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup", "style": { "disableScroll": true, diff --git a/pages-config/tabBar.json b/pages-config/tabBar.json index bd786b9..56091a0 100644 --- a/pages-config/tabBar.json +++ b/pages-config/tabBar.json @@ -1,4 +1,3 @@ -/* /// Pages-Tool: 该文件是pages-tool插件的配置文件,根据pages-config.json的配置,本文件的内容可能合并到pages.json*/ { "tabBar": { "color": "#7A7E83", @@ -6,23 +5,28 @@ "borderStyle": "black", "backgroundColor": "#FFFFFF", "list": [{ - "pagePath": "pages/grid/grid", + "pagePath": "pages/index/index", "iconPath": "static/tabbar/list.png", "selectedIconPath": "static/tabbar/list_active.png", "text": "首页" + }, { + "pagePath": "pages/cal/cal", + "iconPath": "static/tabbar/cal.png", + "selectedIconPath": "static/tabbar/cal_active.png", + "text": "计算" + }, { + "pagePath": "pages/info/info", + "iconPath": "static/tabbar/info.png", + "selectedIconPath": "static/tabbar/info_active.png", + "text": "资料" } - // , { - // "pagePath": "pages/list/list", - // "iconPath": "static/tabbar/grid.png", - // "selectedIconPath": "static/tabbar/grid_active.png", - // "text": "常用资料" - // } + , { - "pagePath": "pages/ucenter", + "pagePath": "pages/ucenter/ucenter", "iconPath": "static/tabbar/me.png", "selectedIconPath": "static/tabbar/me_active.png", "text": "我的" } ] } -} \ No newline at end of file +}s \ No newline at end of file diff --git a/pages.json b/pages.json index c8a00fd..888b49d 100644 --- a/pages.json +++ b/pages.json @@ -1,42 +1,35 @@ { - "pages": [ - // { - // "path": "pages/grid/login", - // "style": { - // "navigationStyle": "custom" - // } - // } - // , - - { - "path": "pages/grid/grid", + "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "pages/index/index", "style": { - "navigationStyle": "custom" - } - },{ - "path": "pages/ucenter", - "style": { - "navigationStyle": "custom" + "navigationBarTitleText": "主页" } }, { - "path": "pages/list/list", + "path": "pages/cal/cal", "style": { - "navigationStyle": "custom" + "navigationBarTitleText": "计算" } }, { - "path": "pages/list/detail", + "path": "pages/info/info", "style": { - "navigationStyle": "custom" + "navigationBarTitleText": "资料" + } + }, + { + "path": "pages/ucenter/ucenter", + "style": { + "navigationBarTitleText": "我的" } } - // #ifdef APP-PLUS - ,{ + , + { "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup", "style": { "disableScroll": true, @@ -648,19 +641,24 @@ "borderStyle": "black", "backgroundColor": "#FFFFFF", "list": [{ - "pagePath": "pages/grid/grid", + "pagePath": "pages/index/index", "iconPath": "static/tabbar/list.png", "selectedIconPath": "static/tabbar/list_active.png", "text": "首页" + }, { + "pagePath": "pages/cal/cal", + "iconPath": "static/tabbar/cal.png", + "selectedIconPath": "static/tabbar/cal_active.png", + "text": "计算" + }, { + "pagePath": "pages/info/info", + "iconPath": "static/tabbar/info.png", + "selectedIconPath": "static/tabbar/info_active.png", + "text": "资料" } - // , { - // "pagePath": "pages/list/list", - // "iconPath": "static/tabbar/grid.png", - // "selectedIconPath": "static/tabbar/grid_active.png", - // "text": "常用资料" - // } + , { - "pagePath": "pages/ucenter", + "pagePath": "pages/ucenter/ucenter", "iconPath": "static/tabbar/me.png", "selectedIconPath": "static/tabbar/me_active.png", "text": "我的" diff --git a/pages/cal/cal.vue b/pages/cal/cal.vue new file mode 100644 index 0000000..cfd5ffd --- /dev/null +++ b/pages/cal/cal.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/pages/grid/grid.vue b/pages/grid/grid.vue deleted file mode 100644 index f9de758..0000000 --- a/pages/grid/grid.vue +++ /dev/null @@ -1,399 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/grid/login.vue b/pages/grid/login.vue deleted file mode 100644 index 629e443..0000000 --- a/pages/grid/login.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..ec0ec26 --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/pages/info/info.vue b/pages/info/info.vue new file mode 100644 index 0000000..96689d5 --- /dev/null +++ b/pages/info/info.vue @@ -0,0 +1,9 @@ + + + + + diff --git a/pages/list/detail.vue b/pages/list/detail.vue deleted file mode 100644 index 5bbef34..0000000 --- a/pages/list/detail.vue +++ /dev/null @@ -1,373 +0,0 @@ - - - - - diff --git a/pages/list/list.nvue b/pages/list/list.nvue deleted file mode 100644 index a4a0e46..0000000 --- a/pages/list/list.nvue +++ /dev/null @@ -1,206 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/ucenter.vue b/pages/ucenter.vue deleted file mode 100644 index 8512bc1..0000000 --- a/pages/ucenter.vue +++ /dev/null @@ -1,505 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue new file mode 100644 index 0000000..1e52aa4 --- /dev/null +++ b/pages/ucenter/ucenter.vue @@ -0,0 +1,508 @@ + + + + + diff --git a/static/logo.png b/static/logo.png new file mode 100644 index 0000000..b5771e2 Binary files /dev/null and b/static/logo.png differ diff --git a/static/tabbar/cal.png b/static/tabbar/cal.png new file mode 100644 index 0000000..ff9cbb4 Binary files /dev/null and b/static/tabbar/cal.png differ diff --git a/static/tabbar/cal_active.png b/static/tabbar/cal_active.png new file mode 100644 index 0000000..25c5bb6 Binary files /dev/null and b/static/tabbar/cal_active.png differ diff --git a/static/tabbar/grid.png b/static/tabbar/grid.png deleted file mode 100644 index 938b821..0000000 Binary files a/static/tabbar/grid.png and /dev/null differ diff --git a/static/tabbar/grid_active.png b/static/tabbar/grid_active.png deleted file mode 100644 index 807d9c7..0000000 Binary files a/static/tabbar/grid_active.png and /dev/null differ diff --git a/static/tabbar/info.png b/static/tabbar/info.png new file mode 100644 index 0000000..982c160 Binary files /dev/null and b/static/tabbar/info.png differ diff --git a/static/tabbar/info_active.png b/static/tabbar/info_active.png new file mode 100644 index 0000000..c5a79b4 Binary files /dev/null and b/static/tabbar/info_active.png differ diff --git a/uniCloud-aliyun/database/ngTools_Dict.schema.json b/uniCloud-aliyun/database/ngTools_Dict.schema.json index db31dca..54614fd 100644 --- a/uniCloud-aliyun/database/ngTools_Dict.schema.json +++ b/uniCloud-aliyun/database/ngTools_Dict.schema.json @@ -1 +1,63 @@ -{"bsonType":"object","required":[],"permission":{"read":true,"create":true,"update":true,"delete":true},"properties":{"_id":{"description":"ID,系统自动生成"},"dictName":{"description":"字典名称","bsonType":"string","title":"字典名称","trim":"both"},"dictCode":{"description":"字典编码","bsonType":"string","title":"字典编码","trim":"both"},"description":{"description":"描述","bsonType":"string","title":"描述","trim":"both"},"delFlag":{"description":"删除状态","bsonType":"int","title":"删除状态","trim":"both"},"createTime":{"description":"创建时间","bsonType":"string","title":"创建时间","trim":"both"},"createBy":{"description":"创建人","bsonType":"string","title":"创建人","trim":"both"},"updateTime":{"description":"更新时间","bsonType":"datetime","title":"更新时间","trim":"both"},"updateBy":{"description":"更新人","bsonType":"string","title":"更新人","trim":"both"}}} \ No newline at end of file +{ + "bsonType": "object", + "required": [], + "permission": { + "read": true, + "create": true, + "update": true, + "delete": true + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "dictName": { + "description": "字典名称", + "bsonType": "string", + "title": "字典名称", + "trim": "both" + }, + "dictCode": { + "description": "字典编码", + "bsonType": "string", + "title": "字典编码", + "trim": "both" + }, + "description": { + "description": "描述", + "bsonType": "string", + "title": "描述", + "trim": "both" + }, + "delFlag": { + "description": "删除状态", + "bsonType": "int", + "title": "删除状态", + "trim": "both" + }, + "createTime": { + "description": "创建时间", + "bsonType": "string", + "title": "创建时间", + "trim": "both" + }, + "createBy": { + "description": "创建人", + "bsonType": "string", + "title": "创建人", + "trim": "both" + }, + "updateTime": { + "description": "更新时间", + "bsonType": "datetime", + "title": "更新时间", + "trim": "both" + }, + "updateBy": { + "description": "更新人", + "bsonType": "string", + "title": "更新人", + "trim": "both" + } + } +} \ No newline at end of file diff --git a/uniCloud-aliyun/database/ngTools_DictItem.schema.json b/uniCloud-aliyun/database/ngTools_DictItem.schema.json index b3e2069..2ad4b1b 100644 --- a/uniCloud-aliyun/database/ngTools_DictItem.schema.json +++ b/uniCloud-aliyun/database/ngTools_DictItem.schema.json @@ -1 +1,82 @@ -{"bsonType":"object","required":[],"permission":{"read":true,"create":true,"update":true,"delete":true},"properties":{"_id":{"description":"ID,系统自动生成"},"dictID":{"description":"字典ID","bsonType":"string","title":"字典ID","trim":"both"},"itemValue":{"description":"字典项值","bsonType":"string","title":"字典项值","trim":"both","length":"1024"},"itemText":{"description":"字典项文本","bsonType":"string","title":"字典项文本","trim":"both"},"itemColor":{"description":"字典项颜色","bsonType":"string","title":"字典项颜色","trim":"both"},"description":{"description":"描述","bsonType":"string","title":"描述","trim":"both"},"sortOrder":{"description":"排序","bsonType":"string","title":"排序","trim":"both"},"status":{"description":"状态","bsonType":"int","title":"状态","trim":"both"},"createTime":{"description":"创建时间","bsonType":"datetime","title":"创建时间","trim":"both"},"createBy":{"description":"创建人","bsonType":"string","title":"创建人","trim":"both"},"updateTime":{"description":"更新时间","bsonType":"datetime","title":"更新时间","trim":"both"},"updateBy":{"description":"更新人","bsonType":"string","title":"更新人","trim":"both"}}} \ No newline at end of file +{ + "bsonType": "object", + "required": [], + "permission": { + "read": true, + "create": true, + "update": true, + "delete": true + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "dictID": { + "description": "字典ID", + "bsonType": "string", + "title": "字典ID", + "trim": "both" + }, + "itemValue": { + "description": "字典项值", + "bsonType": "string", + "title": "字典项值", + "trim": "both", + "length": "1024" + }, + "itemText": { + "description": "字典项文本", + "bsonType": "string", + "title": "字典项文本", + "trim": "both" + }, + "itemColor": { + "description": "字典项颜色", + "bsonType": "string", + "title": "字典项颜色", + "trim": "both" + }, + "description": { + "description": "描述", + "bsonType": "string", + "title": "描述", + "trim": "both" + }, + "sortOrder": { + "description": "排序", + "bsonType": "string", + "title": "排序", + "trim": "both" + }, + "status": { + "description": "状态", + "bsonType": "int", + "title": "状态", + "trim": "both" + }, + "createTime": { + "description": "创建时间", + "bsonType": "datetime", + "title": "创建时间", + "trim": "both" + }, + "createBy": { + "description": "创建人", + "bsonType": "string", + "title": "创建人", + "trim": "both" + }, + "updateTime": { + "description": "更新时间", + "bsonType": "datetime", + "title": "更新时间", + "trim": "both" + }, + "updateBy": { + "description": "更新人", + "bsonType": "string", + "title": "更新人", + "trim": "both" + } + } +} \ No newline at end of file diff --git a/uniCloud-aliyun/database/ngTools_MeterPar.schema.json b/uniCloud-aliyun/database/ngTools_MeterPar.schema.json index faebca6..1b4ea2e 100644 --- a/uniCloud-aliyun/database/ngTools_MeterPar.schema.json +++ b/uniCloud-aliyun/database/ngTools_MeterPar.schema.json @@ -1 +1,351 @@ -{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"},"createTime":{"description":"创建时间","bsonType":"datetime","title":"创建时间","trim":"both"},"createBy":{"description":"创建人","bsonType":"string","title":"创建人","trim":"both"},"updateTime":{"description":"更新时间","bsonType":"datetime","title":"更新时间","trim":"both"},"updateBy":{"description":"更新人","bsonType":"string","title":"更新人","trim":"both"},"meterID":{"description":"计量点编号","bsonType":"string","title":"计量点编号","trim":"both"},"dFlowCalbz":{"description":"流量计算标准","bsonType":"string","title":"流量计算标准","trim":"both"},"dZcalbz":{"description":"压缩因子计算标准","bsonType":"string","title":"压缩因子计算标准","trim":"both"},"dCbtj":{"description":"计量参比条件","bsonType":"string","title":"计量参比条件","trim":"both"},"dRsCbtj":{"description":"燃烧参比条件","bsonType":"string","title":"燃烧参比条件","trim":"both"},"dPb_M":{"description":"计量参比条件压力","bsonType":"string","title":"计量参比条件压力","trim":"both"},"dTb_M":{"description":"计量参比条件温度","bsonType":"string","title":"计量参比条件温度","trim":"both"},"dPb_E":{"description":"燃烧参比条件压力","bsonType":"string","title":"燃烧参比条件压力","trim":"both"},"dTb_E":{"description":"燃烧参比条件温度","bsonType":"string","title":"燃烧参比条件温度","trim":"both"},"dPatm":{"description":"当地大气压","bsonType":"string","title":"当地大气压","trim":"both"},"dPatmUnit":{"description":"当地大气压单位","bsonType":"string","title":"当地大气压单位","trim":"both"},"dNG_Compents":{"description":"天然气组分","bsonType":"string","title":"天然气组分","trim":"both"},"dMeterType":{"description":"流量计类别","bsonType":"string","title":"流量计类别","trim":"both"},"dCoreType":{"description":"节流装置类型","bsonType":"string","title":"节流装置类型","trim":"both"},"dPtmode":{"description":"取压方式","bsonType":"string","title":"取压方式","trim":"both"},"dPipeType":{"description":"管道类型","bsonType":"string","title":"管道类型","trim":"both"},"dPipeD":{"description":"管道内径","bsonType":"string","title":"管道内径","trim":"both"},"dLenUnit":{"description":"长度单位","bsonType":"string","title":"长度单位","trim":"both"},"dPipeDtemp":{"description":"管道内径参考温度","bsonType":"string","title":"管道内径参考温度","trim":"both"},"dPileDtempU":{"description":"温度单位","bsonType":"string","title":"温度单位","trim":"both"},"dPipeMaterial":{"description":"管道材料","bsonType":"string","title":"管道材料","trim":"both"},"dOrificeD":{"description":"孔板孔径","bsonType":"string","title":"孔板孔径","trim":"both"},"dOrificeUnit":{"description":"长度单位","bsonType":"string","title":"长度单位","trim":"both"},"dOrificeDtemp":{"description":"孔板内径参考温度","bsonType":"string","title":"孔板内径参考温度","trim":"both"},"dOrificeDtempUnit":{"description":"温度单位","bsonType":"string","title":"温度单位","trim":"both"},"dOrificeMaterial":{"description":"孔板材料","bsonType":"string","title":"孔板材料","trim":"both"},"dOrificeSharpness":{"description":"锐利度系数计算方法","bsonType":"string","title":"锐利度系数计算方法","trim":"both"},"dOrificeRk":{"description":"孔板入口圆弧半径","bsonType":"string","title":"孔板入口圆弧半径","trim":"both"},"dOrificeRkLenU":{"description":"长度单位","bsonType":"string","title":"长度单位","trim":"both"},"dPf":{"description":"输入压力","bsonType":"string","title":"输入压力","trim":"both"},"dPfUnit":{"description":"压力单位","bsonType":"string","title":"压力单位","trim":"both"},"dPfType":{"description":"压力类型","bsonType":"string","title":"压力类型","trim":"both"},"dTf":{"description":"输入温度","bsonType":"string","title":"输入温度","trim":"both"},"dTfUnit":{"description":"温度单位","bsonType":"string","title":"温度单位","trim":"both"},"dDp":{"description":"输入差压","bsonType":"string","title":"输入差压","trim":"both"},"dDpUnit":{"description":"压力单位","bsonType":"string","title":"压力单位","trim":"both"},"dVFlowUnit":{"description":"体积流量单位","bsonType":"string","title":"体积流量单位","trim":"both"},"dMFlowUnit":{"description":"质量流量单位","bsonType":"string","title":"质量流量单位","trim":"both"},"dEFlowUnit":{"description":"能量流量单位","bsonType":"string","title":"能量流量单位","trim":"both"},"dCdCalMethod":{"description":"流出系数计算方法","bsonType":"string","title":"流出系数计算方法","trim":"both"},"dMeterFactor":{"description":"仪表系数","bsonType":"string","title":"仪表系数","trim":"both"},"dPulseNum":{"description":"脉冲数","bsonType":"string","title":"脉冲数","trim":"both"},"dVFlowMax":{"description":"最大体积流量","bsonType":"string","title":"最大体积流量","trim":"both"},"dVFlowMin":{"description":"最小体积流量","bsonType":"string","title":"最小体积流量","trim":"both"},"dVFlowCon":{"description":"常用流量","bsonType":"string","title":"常用流量","trim":"both"},"dPfRangeMin":{"description":"压力量程","bsonType":"string","title":"压力量程","trim":"both"},"dPfRangeMax":{"description":"压力量程","bsonType":"string","title":"压力量程","trim":"both"},"dDpRangeMin":{"description":"差压量程","bsonType":"string","title":"差压量程","trim":"both"},"dDpRangeMax":{"description":"差压量程","bsonType":"string","title":"差压量程","trim":"both"},"dTfRangeMin":{"description":"温度计量程","bsonType":"string","title":"温度计量程","trim":"both"},"dTfRangeMax":{"description":"温度计量程","bsonType":"string","title":"温度计量程","trim":"both"},"dVGsc":{"description":"管束车水容积","bsonType":"string","title":"管束车水容积","trim":"both"}}} \ No newline at end of file +{ + "bsonType": "object", + "required": [], + "permission": { + "read": false, + "create": false, + "update": false, + "delete": false + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "createTime": { + "description": "创建时间", + "bsonType": "datetime", + "title": "创建时间", + "trim": "both" + }, + "createBy": { + "description": "创建人", + "bsonType": "string", + "title": "创建人", + "trim": "both" + }, + "updateTime": { + "description": "更新时间", + "bsonType": "datetime", + "title": "更新时间", + "trim": "both" + }, + "updateBy": { + "description": "更新人", + "bsonType": "string", + "title": "更新人", + "trim": "both" + }, + "meterID": { + "description": "计量点编号", + "bsonType": "string", + "title": "计量点编号", + "trim": "both" + }, + "dFlowCalbz": { + "description": "流量计算标准", + "bsonType": "string", + "title": "流量计算标准", + "trim": "both" + }, + "dZcalbz": { + "description": "压缩因子计算标准", + "bsonType": "string", + "title": "压缩因子计算标准", + "trim": "both" + }, + "dCbtj": { + "description": "计量参比条件", + "bsonType": "string", + "title": "计量参比条件", + "trim": "both" + }, + "dRsCbtj": { + "description": "燃烧参比条件", + "bsonType": "string", + "title": "燃烧参比条件", + "trim": "both" + }, + "dPb_M": { + "description": "计量参比条件压力", + "bsonType": "string", + "title": "计量参比条件压力", + "trim": "both" + }, + "dTb_M": { + "description": "计量参比条件温度", + "bsonType": "string", + "title": "计量参比条件温度", + "trim": "both" + }, + "dPb_E": { + "description": "燃烧参比条件压力", + "bsonType": "string", + "title": "燃烧参比条件压力", + "trim": "both" + }, + "dTb_E": { + "description": "燃烧参比条件温度", + "bsonType": "string", + "title": "燃烧参比条件温度", + "trim": "both" + }, + "dPatm": { + "description": "当地大气压", + "bsonType": "string", + "title": "当地大气压", + "trim": "both" + }, + "dPatmUnit": { + "description": "当地大气压单位", + "bsonType": "string", + "title": "当地大气压单位", + "trim": "both" + }, + "dNG_Compents": { + "description": "天然气组分", + "bsonType": "string", + "title": "天然气组分", + "trim": "both" + }, + "dMeterType": { + "description": "流量计类别", + "bsonType": "string", + "title": "流量计类别", + "trim": "both" + }, + "dCoreType": { + "description": "节流装置类型", + "bsonType": "string", + "title": "节流装置类型", + "trim": "both" + }, + "dPtmode": { + "description": "取压方式", + "bsonType": "string", + "title": "取压方式", + "trim": "both" + }, + "dPipeType": { + "description": "管道类型", + "bsonType": "string", + "title": "管道类型", + "trim": "both" + }, + "dPipeD": { + "description": "管道内径", + "bsonType": "string", + "title": "管道内径", + "trim": "both" + }, + "dLenUnit": { + "description": "长度单位", + "bsonType": "string", + "title": "长度单位", + "trim": "both" + }, + "dPipeDtemp": { + "description": "管道内径参考温度", + "bsonType": "string", + "title": "管道内径参考温度", + "trim": "both" + }, + "dPileDtempU": { + "description": "温度单位", + "bsonType": "string", + "title": "温度单位", + "trim": "both" + }, + "dPipeMaterial": { + "description": "管道材料", + "bsonType": "string", + "title": "管道材料", + "trim": "both" + }, + "dOrificeD": { + "description": "孔板孔径", + "bsonType": "string", + "title": "孔板孔径", + "trim": "both" + }, + "dOrificeUnit": { + "description": "长度单位", + "bsonType": "string", + "title": "长度单位", + "trim": "both" + }, + "dOrificeDtemp": { + "description": "孔板内径参考温度", + "bsonType": "string", + "title": "孔板内径参考温度", + "trim": "both" + }, + "dOrificeDtempUnit": { + "description": "温度单位", + "bsonType": "string", + "title": "温度单位", + "trim": "both" + }, + "dOrificeMaterial": { + "description": "孔板材料", + "bsonType": "string", + "title": "孔板材料", + "trim": "both" + }, + "dOrificeSharpness": { + "description": "锐利度系数计算方法", + "bsonType": "string", + "title": "锐利度系数计算方法", + "trim": "both" + }, + "dOrificeRk": { + "description": "孔板入口圆弧半径", + "bsonType": "string", + "title": "孔板入口圆弧半径", + "trim": "both" + }, + "dOrificeRkLenU": { + "description": "长度单位", + "bsonType": "string", + "title": "长度单位", + "trim": "both" + }, + "dPf": { + "description": "输入压力", + "bsonType": "string", + "title": "输入压力", + "trim": "both" + }, + "dPfUnit": { + "description": "压力单位", + "bsonType": "string", + "title": "压力单位", + "trim": "both" + }, + "dPfType": { + "description": "压力类型", + "bsonType": "string", + "title": "压力类型", + "trim": "both" + }, + "dTf": { + "description": "输入温度", + "bsonType": "string", + "title": "输入温度", + "trim": "both" + }, + "dTfUnit": { + "description": "温度单位", + "bsonType": "string", + "title": "温度单位", + "trim": "both" + }, + "dDp": { + "description": "输入差压", + "bsonType": "string", + "title": "输入差压", + "trim": "both" + }, + "dDpUnit": { + "description": "压力单位", + "bsonType": "string", + "title": "压力单位", + "trim": "both" + }, + "dVFlowUnit": { + "description": "体积流量单位", + "bsonType": "string", + "title": "体积流量单位", + "trim": "both" + }, + "dMFlowUnit": { + "description": "质量流量单位", + "bsonType": "string", + "title": "质量流量单位", + "trim": "both" + }, + "dEFlowUnit": { + "description": "能量流量单位", + "bsonType": "string", + "title": "能量流量单位", + "trim": "both" + }, + "dCdCalMethod": { + "description": "流出系数计算方法", + "bsonType": "string", + "title": "流出系数计算方法", + "trim": "both" + }, + "dMeterFactor": { + "description": "仪表系数", + "bsonType": "string", + "title": "仪表系数", + "trim": "both" + }, + "dPulseNum": { + "description": "脉冲数", + "bsonType": "string", + "title": "脉冲数", + "trim": "both" + }, + "dVFlowMax": { + "description": "最大体积流量", + "bsonType": "string", + "title": "最大体积流量", + "trim": "both" + }, + "dVFlowMin": { + "description": "最小体积流量", + "bsonType": "string", + "title": "最小体积流量", + "trim": "both" + }, + "dVFlowCon": { + "description": "常用流量", + "bsonType": "string", + "title": "常用流量", + "trim": "both" + }, + "dPfRangeMin": { + "description": "压力量程", + "bsonType": "string", + "title": "压力量程", + "trim": "both" + }, + "dPfRangeMax": { + "description": "压力量程", + "bsonType": "string", + "title": "压力量程", + "trim": "both" + }, + "dDpRangeMin": { + "description": "差压量程", + "bsonType": "string", + "title": "差压量程", + "trim": "both" + }, + "dDpRangeMax": { + "description": "差压量程", + "bsonType": "string", + "title": "差压量程", + "trim": "both" + }, + "dTfRangeMin": { + "description": "温度计量程", + "bsonType": "string", + "title": "温度计量程", + "trim": "both" + }, + "dTfRangeMax": { + "description": "温度计量程", + "bsonType": "string", + "title": "温度计量程", + "trim": "both" + }, + "dVGsc": { + "description": "管束车水容积", + "bsonType": "string", + "title": "管束车水容积", + "trim": "both" + } + } +} \ No newline at end of file diff --git a/uniCloud-aliyun/database/uni-id-users.schema.json b/uniCloud-aliyun/database/uni-id-users.schema.json index 9c848e1..cae65e9 100644 --- a/uniCloud-aliyun/database/uni-id-users.schema.json +++ b/uniCloud-aliyun/database/uni-id-users.schema.json @@ -1 +1,442 @@ -{"bsonType":"object","required":[],"permission":{"read":true,"create":true,"update":true,"delete":true},"properties":{"_id":{"description":"存储文档 ID(用户 ID),系统自动生成"},"username":{"bsonType":"string","title":"用户名","description":"用户名,不允许重复","trim":"both"},"password":{"bsonType":"password","title":"密码","description":"密码,加密存储","trim":"both"},"password_secret_version":{"bsonType":"int","title":"passwordSecret","description":"密码使用的passwordSecret版本"},"nickname":{"bsonType":"string","title":"昵称","description":"用户昵称","trim":"both"},"gender":{"bsonType":"int","title":"性别","description":"用户性别:0 未知 1 男性 2 女性","defaultValue":0,"enum":[{"text":"未知","value":0},{"text":"男","value":1},{"text":"女","value":2}]},"status":{"bsonType":"int","description":"用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝","title":"用户状态","defaultValue":0,"enum":[{"text":"正常","value":0},{"text":"禁用","value":1},{"text":"审核中","value":2},{"text":"审核拒绝","value":3}]},"mobile":{"bsonType":"string","title":"手机号码","description":"手机号码","pattern":"^\\+?[0-9-]{3,20}$","trim":"both"},"mobile_confirmed":{"bsonType":"int","description":"手机号验证状态:0 未验证 1 已验证","title":"手机号验证状态","defaultValue":0,"enum":[{"text":"未验证","value":0},{"text":"已验证","value":1}]},"email":{"bsonType":"string","format":"email","title":"邮箱","description":"邮箱地址","trim":"both"},"email_confirmed":{"bsonType":"int","description":"邮箱验证状态:0 未验证 1 已验证","title":"邮箱验证状态","defaultValue":0,"enum":[{"text":"未验证","value":0},{"text":"已验证","value":1}]},"avatar":{"bsonType":"string","title":"头像地址","description":"头像地址","trim":"both"},"avatar_file":{"bsonType":"file","title":"头像文件","description":"用file类型方便使用uni-file-picker组件"},"d_ids":{"bsonType":"array","description":"部门ID","title":"部门","foreignKey":"opendb-department._id","enumType":"tree","enum":{"collection":"opendb-department","orderby":"name asc","field":"_id as value, name as text"}},"e_ids":{"bsonType":"array","description":"企业ID","title":"企业"},"role":{"bsonType":"array","title":"角色","description":"用户角色","enum":{"collection":"uni-id-roles","field":"role_id as value, role_name as text"},"foreignKey":"uni-id-roles.role_id","permission":{"write":false}},"wx_unionid":{"bsonType":"string","description":"微信unionid"},"wx_openid":{"bsonType":"object","description":"微信各个平台openid","properties":{"app":{"bsonType":"string","description":"app平台微信openid"},"mp":{"bsonType":"string","description":"微信小程序平台openid"},"h5":{"bsonType":"string","description":"微信公众号平台openid"},"web":{"bsonType":"string","description":"微信网页登录openid"}}},"ali_openid":{"bsonType":"string","description":"支付宝平台openid"},"apple_openid":{"bsonType":"string","description":"苹果登录openid"},"dcloud_appid":{"bsonType":"array","description":"允许登录的客户端的appid列表","foreignKey":"opendb-app-list.appid"},"comment":{"bsonType":"string","title":"备注","description":"备注","trim":"both"},"third_party":{"bsonType":"object","description":"缓存用户在三方平台的token等信息","properties":{"mp_weixin":{"bsonType":"object","description":"微信小程序相关信息","properties":{"session_key":{"bsonType":"string","description":"微信小程序session key"}}},"app_weixin":{"bsonType":"object","description":"app平台微信相关信息","properties":{"access_token":{"bsonType":"string","description":"app平台微信access token"},"access_token_expired":{"bsonType":"string","description":"app平台微信access token过期时间"},"refresh_token":{"bsonType":"string","description":"app平台微信refresh token"}}},"h5_weixin":{"bsonType":"object","description":"微信公众号平台微信相关信息","properties":{"access_token":{"bsonType":"string","description":"微信公众号平台access token"},"access_token_expired":{"bsonType":"string","description":"微信公众号平台access token过期时间"},"refresh_token":{"bsonType":"string","description":"微信公众号平台refresh token"}}},"web_weixin":{"bsonType":"object","description":"web平台微信相关信息","properties":{"access_token":{"bsonType":"string","description":"web平台微信access token"},"access_token_expired":{"bsonType":"string","description":"web平台微信access token过期时间"},"refresh_token":{"bsonType":"string","description":"web平台微信refresh token"}}},"mp_qq":{"bsonType":"object","description":"QQ小程序相关信息","properties":{"session_key":{"bsonType":"string","description":"QQ小程序session key"}}},"app_qq":{"bsonType":"object","description":"app平台QQ相关信息","properties":{"access_token":{"bsonType":"string","description":"app平台QQ access token"},"access_token_expired":{"bsonType":"string","description":"app平台QQ access token过期时间"}}}}},"register_env":{"bsonType":"object","description":"注册环境信息","properties":{"appid":{"bsonType":"string","description":"注册时的应用AppId"},"uni_platform":{"bsonType":"string","description":"注册时的应用平台,app、h5等"},"os_name":{"bsonType":"string","description":"注册时的客户端系统类型,ios、android、windows、mac、linux"},"app_name":{"bsonType":"string","description":"注册时的应用名称"},"app_version":{"bsonType":"string","description":"注册时的应用版本名称"},"app_version_code":{"bsonType":"string","description":"注册时的应用版本号码"},"channel":{"bsonType":"string","description":"注册时的应用渠道或小程序启动场景"},"client_ip":{"bsonType":"string","description":"注册时的客户端ip"}}},"realname_auth":{"bsonType":"object","description":"实名认证信息","required":["type","auth_status"],"properties":{"type":{"bsonType":"int","minimum":0,"maximum":1,"description":"用户类型:0 个人用户 1 企业用户"},"auth_status":{"bsonType":"int","minimum":0,"maximum":3,"description":"认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败"},"auth_date":{"bsonType":"timestamp","description":"认证通过时间"},"real_name":{"bsonType":"string","description":"真实姓名\/企业名称"},"identity":{"bsonType":"string","description":"身份证号码\/营业执照号码"},"id_card_front":{"bsonType":"string","description":"身份证正面照 URL"},"id_card_back":{"bsonType":"string","description":"身份证反面照 URL"},"in_hand":{"bsonType":"string","description":"手持身份证照片 URL"},"license":{"bsonType":"string","description":"营业执照 URL"},"contact_person":{"bsonType":"string","description":"联系人姓名"},"contact_mobile":{"bsonType":"string","description":"联系人手机号码"},"contact_email":{"bsonType":"string","description":"联系人邮箱"}}},"score":{"bsonType":"int","description":"用户积分,积分变更记录可参考:uni-id-scores表定义"},"register_date":{"bsonType":"timestamp","description":"注册时间","forceDefaultValue":{"$env":"now"}},"register_ip":{"bsonType":"string","description":"注册时 IP 地址","forceDefaultValue":{"$env":"clientIP"}},"last_login_date":{"bsonType":"timestamp","description":"最后登录时间"},"last_login_ip":{"bsonType":"string","description":"最后登录时 IP 地址"},"token":{"bsonType":"array","description":"用户token"},"inviter_uid":{"bsonType":"array","description":"用户全部上级邀请者","trim":"both"},"invite_time":{"bsonType":"timestamp","description":"受邀时间"},"my_invite_code":{"bsonType":"string","description":"用户自身邀请码"},"identities":{"bsonType":"array","description":"三方平台身份信息;一个对象代表一个身份,参数支持: provider 身份源, userInfo 三方用户信息, openid 三方openid, unionid 三方unionid, uid 三方uid","permission":{"read":"'READ_UNI_ID_USERS' in auth.permission","write":"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"}}},"version":"1.0.3"} \ No newline at end of file +{ + "bsonType": "object", + "required": [], + "permission": { + "read": true, + "create": true, + "update": true, + "delete": true + }, + "properties": { + "_id": { + "description": "存储文档 ID(用户 ID),系统自动生成" + }, + "username": { + "bsonType": "string", + "title": "用户名", + "description": "用户名,不允许重复", + "trim": "both" + }, + "password": { + "bsonType": "password", + "title": "密码", + "description": "密码,加密存储", + "trim": "both" + }, + "password_secret_version": { + "bsonType": "int", + "title": "passwordSecret", + "description": "密码使用的passwordSecret版本" + }, + "nickname": { + "bsonType": "string", + "title": "昵称", + "description": "用户昵称", + "trim": "both" + }, + "gender": { + "bsonType": "int", + "title": "性别", + "description": "用户性别:0 未知 1 男性 2 女性", + "defaultValue": 0, + "enum": [{ + "text": "未知", + "value": 0 + }, { + "text": "男", + "value": 1 + }, { + "text": "女", + "value": 2 + }] + }, + "status": { + "bsonType": "int", + "description": "用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝", + "title": "用户状态", + "defaultValue": 0, + "enum": [{ + "text": "正常", + "value": 0 + }, { + "text": "禁用", + "value": 1 + }, { + "text": "审核中", + "value": 2 + }, { + "text": "审核拒绝", + "value": 3 + }] + }, + "mobile": { + "bsonType": "string", + "title": "手机号码", + "description": "手机号码", + "pattern": "^\\+?[0-9-]{3,20}$", + "trim": "both" + }, + "mobile_confirmed": { + "bsonType": "int", + "description": "手机号验证状态:0 未验证 1 已验证", + "title": "手机号验证状态", + "defaultValue": 0, + "enum": [{ + "text": "未验证", + "value": 0 + }, { + "text": "已验证", + "value": 1 + }] + }, + "email": { + "bsonType": "string", + "format": "email", + "title": "邮箱", + "description": "邮箱地址", + "trim": "both" + }, + "email_confirmed": { + "bsonType": "int", + "description": "邮箱验证状态:0 未验证 1 已验证", + "title": "邮箱验证状态", + "defaultValue": 0, + "enum": [{ + "text": "未验证", + "value": 0 + }, { + "text": "已验证", + "value": 1 + }] + }, + "avatar": { + "bsonType": "string", + "title": "头像地址", + "description": "头像地址", + "trim": "both" + }, + "avatar_file": { + "bsonType": "file", + "title": "头像文件", + "description": "用file类型方便使用uni-file-picker组件" + }, + "d_ids": { + "bsonType": "array", + "description": "部门ID", + "title": "部门", + "foreignKey": "opendb-department._id", + "enumType": "tree", + "enum": { + "collection": "opendb-department", + "orderby": "name asc", + "field": "_id as value, name as text" + } + }, + "e_ids": { + "bsonType": "array", + "description": "企业ID", + "title": "企业" + }, + "role": { + "bsonType": "array", + "title": "角色", + "description": "用户角色", + "enum": { + "collection": "uni-id-roles", + "field": "role_id as value, role_name as text" + }, + "foreignKey": "uni-id-roles.role_id", + "permission": { + "write": false + } + }, + "wx_unionid": { + "bsonType": "string", + "description": "微信unionid" + }, + "wx_openid": { + "bsonType": "object", + "description": "微信各个平台openid", + "properties": { + "app": { + "bsonType": "string", + "description": "app平台微信openid" + }, + "mp": { + "bsonType": "string", + "description": "微信小程序平台openid" + }, + "h5": { + "bsonType": "string", + "description": "微信公众号平台openid" + }, + "web": { + "bsonType": "string", + "description": "微信网页登录openid" + } + } + }, + "ali_openid": { + "bsonType": "string", + "description": "支付宝平台openid" + }, + "apple_openid": { + "bsonType": "string", + "description": "苹果登录openid" + }, + "dcloud_appid": { + "bsonType": "array", + "description": "允许登录的客户端的appid列表", + "foreignKey": "opendb-app-list.appid" + }, + "comment": { + "bsonType": "string", + "title": "备注", + "description": "备注", + "trim": "both" + }, + "third_party": { + "bsonType": "object", + "description": "缓存用户在三方平台的token等信息", + "properties": { + "mp_weixin": { + "bsonType": "object", + "description": "微信小程序相关信息", + "properties": { + "session_key": { + "bsonType": "string", + "description": "微信小程序session key" + } + } + }, + "app_weixin": { + "bsonType": "object", + "description": "app平台微信相关信息", + "properties": { + "access_token": { + "bsonType": "string", + "description": "app平台微信access token" + }, + "access_token_expired": { + "bsonType": "string", + "description": "app平台微信access token过期时间" + }, + "refresh_token": { + "bsonType": "string", + "description": "app平台微信refresh token" + } + } + }, + "h5_weixin": { + "bsonType": "object", + "description": "微信公众号平台微信相关信息", + "properties": { + "access_token": { + "bsonType": "string", + "description": "微信公众号平台access token" + }, + "access_token_expired": { + "bsonType": "string", + "description": "微信公众号平台access token过期时间" + }, + "refresh_token": { + "bsonType": "string", + "description": "微信公众号平台refresh token" + } + } + }, + "web_weixin": { + "bsonType": "object", + "description": "web平台微信相关信息", + "properties": { + "access_token": { + "bsonType": "string", + "description": "web平台微信access token" + }, + "access_token_expired": { + "bsonType": "string", + "description": "web平台微信access token过期时间" + }, + "refresh_token": { + "bsonType": "string", + "description": "web平台微信refresh token" + } + } + }, + "mp_qq": { + "bsonType": "object", + "description": "QQ小程序相关信息", + "properties": { + "session_key": { + "bsonType": "string", + "description": "QQ小程序session key" + } + } + }, + "app_qq": { + "bsonType": "object", + "description": "app平台QQ相关信息", + "properties": { + "access_token": { + "bsonType": "string", + "description": "app平台QQ access token" + }, + "access_token_expired": { + "bsonType": "string", + "description": "app平台QQ access token过期时间" + } + } + } + } + }, + "register_env": { + "bsonType": "object", + "description": "注册环境信息", + "properties": { + "appid": { + "bsonType": "string", + "description": "注册时的应用AppId" + }, + "uni_platform": { + "bsonType": "string", + "description": "注册时的应用平台,app、h5等" + }, + "os_name": { + "bsonType": "string", + "description": "注册时的客户端系统类型,ios、android、windows、mac、linux" + }, + "app_name": { + "bsonType": "string", + "description": "注册时的应用名称" + }, + "app_version": { + "bsonType": "string", + "description": "注册时的应用版本名称" + }, + "app_version_code": { + "bsonType": "string", + "description": "注册时的应用版本号码" + }, + "channel": { + "bsonType": "string", + "description": "注册时的应用渠道或小程序启动场景" + }, + "client_ip": { + "bsonType": "string", + "description": "注册时的客户端ip" + } + } + }, + "realname_auth": { + "bsonType": "object", + "description": "实名认证信息", + "required": ["type", "auth_status"], + "properties": { + "type": { + "bsonType": "int", + "minimum": 0, + "maximum": 1, + "description": "用户类型:0 个人用户 1 企业用户" + }, + "auth_status": { + "bsonType": "int", + "minimum": 0, + "maximum": 3, + "description": "认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败" + }, + "auth_date": { + "bsonType": "timestamp", + "description": "认证通过时间" + }, + "real_name": { + "bsonType": "string", + "description": "真实姓名\/企业名称" + }, + "identity": { + "bsonType": "string", + "description": "身份证号码\/营业执照号码" + }, + "id_card_front": { + "bsonType": "string", + "description": "身份证正面照 URL" + }, + "id_card_back": { + "bsonType": "string", + "description": "身份证反面照 URL" + }, + "in_hand": { + "bsonType": "string", + "description": "手持身份证照片 URL" + }, + "license": { + "bsonType": "string", + "description": "营业执照 URL" + }, + "contact_person": { + "bsonType": "string", + "description": "联系人姓名" + }, + "contact_mobile": { + "bsonType": "string", + "description": "联系人手机号码" + }, + "contact_email": { + "bsonType": "string", + "description": "联系人邮箱" + } + } + }, + "score": { + "bsonType": "int", + "description": "用户积分,积分变更记录可参考:uni-id-scores表定义" + }, + "register_date": { + "bsonType": "timestamp", + "description": "注册时间", + "forceDefaultValue": { + "$env": "now" + } + }, + "register_ip": { + "bsonType": "string", + "description": "注册时 IP 地址", + "forceDefaultValue": { + "$env": "clientIP" + } + }, + "last_login_date": { + "bsonType": "timestamp", + "description": "最后登录时间" + }, + "last_login_ip": { + "bsonType": "string", + "description": "最后登录时 IP 地址" + }, + "token": { + "bsonType": "array", + "description": "用户token" + }, + "inviter_uid": { + "bsonType": "array", + "description": "用户全部上级邀请者", + "trim": "both" + }, + "invite_time": { + "bsonType": "timestamp", + "description": "受邀时间" + }, + "my_invite_code": { + "bsonType": "string", + "description": "用户自身邀请码" + }, + "identities": { + "bsonType": "array", + "description": "三方平台身份信息;一个对象代表一个身份,参数支持: provider 身份源, userInfo 三方用户信息, openid 三方openid, unionid 三方unionid, uid 三方uid", + "permission": { + "read": "'READ_UNI_ID_USERS' in auth.permission", + "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" + } + } + }, + "version": "1.0.3" +} \ No newline at end of file diff --git a/uniCloud-aliyun/database/uni-stat-error-logs.schema.json b/uniCloud-aliyun/database/uni-stat-error-logs.schema.json index 2a22612..61ae1f6 100644 --- a/uniCloud-aliyun/database/uni-stat-error-logs.schema.json +++ b/uniCloud-aliyun/database/uni-stat-error-logs.schema.json @@ -1 +1,102 @@ -{"bsonType":"object","description":"记录上报的应用运行错误日志","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"},"appid":{"bsonType":"string","description":"用户端上报的应用ID"},"version":{"bsonType":"string","description":"用户端上报的应用版本号"},"platform":{"bsonType":"string","description":"用户端上报的平台code"},"channel":{"bsonType":"string","description":"用户端上报的渠道code\/场景值"},"error_type":{"bsonType":"int","description":"错误类型","defaultValue":0,"enum":[{"text":"未知","value":0},{"text":"表示webview页面js异常(uni-app项目对应vue页面)","value":2},{"text":"表示uni框架js异常(仅uni-app项目)","value":4},{"text":"表示控制页js异常(仅uni-app项目)","value":5},{"text":"表示nvue页面js异常(仅uni-app项目)","value":6}]},"device_id":{"bsonType":"string","description":"客户端携带的设备标识"},"uid":{"bsonType":"string","description":"用户编号, 对应uni-id-users._id"},"os":{"bsonType":"string","description":"客户端操作系统"},"ua":{"bsonType":"string","description":"客户端user-agent信息"},"space_id":{"bsonType":"string","description":"服务空间编号"},"space_provider":{"bsonType":"string","description":"服务空间提供商"},"sdk_version":{"bsonType":"string","description":"小程序基础库版本号"},"platform_version":{"bsonType":"string","description":"微信、支付宝宿主App的版本号"},"error_msg":{"bsonType":"string","description":"错误信息"},"error_hash":{"bsonType":"string","description":"错误hash码"},"page_url":{"bsonType":"string","description":"页面url"},"create_time":{"bsonType":"timestamp","description":"创建时间"}},"version":"0.0.2"} \ No newline at end of file +{ + "bsonType": "object", + "description": "记录上报的应用运行错误日志", + "required": [], + "permission": { + "read": false, + "create": false, + "update": false, + "delete": false + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "appid": { + "bsonType": "string", + "description": "用户端上报的应用ID" + }, + "version": { + "bsonType": "string", + "description": "用户端上报的应用版本号" + }, + "platform": { + "bsonType": "string", + "description": "用户端上报的平台code" + }, + "channel": { + "bsonType": "string", + "description": "用户端上报的渠道code\/场景值" + }, + "error_type": { + "bsonType": "int", + "description": "错误类型", + "defaultValue": 0, + "enum": [{ + "text": "未知", + "value": 0 + }, { + "text": "表示webview页面js异常(uni-app项目对应vue页面)", + "value": 2 + }, { + "text": "表示uni框架js异常(仅uni-app项目)", + "value": 4 + }, { + "text": "表示控制页js异常(仅uni-app项目)", + "value": 5 + }, { + "text": "表示nvue页面js异常(仅uni-app项目)", + "value": 6 + }] + }, + "device_id": { + "bsonType": "string", + "description": "客户端携带的设备标识" + }, + "uid": { + "bsonType": "string", + "description": "用户编号, 对应uni-id-users._id" + }, + "os": { + "bsonType": "string", + "description": "客户端操作系统" + }, + "ua": { + "bsonType": "string", + "description": "客户端user-agent信息" + }, + "space_id": { + "bsonType": "string", + "description": "服务空间编号" + }, + "space_provider": { + "bsonType": "string", + "description": "服务空间提供商" + }, + "sdk_version": { + "bsonType": "string", + "description": "小程序基础库版本号" + }, + "platform_version": { + "bsonType": "string", + "description": "微信、支付宝宿主App的版本号" + }, + "error_msg": { + "bsonType": "string", + "description": "错误信息" + }, + "error_hash": { + "bsonType": "string", + "description": "错误hash码" + }, + "page_url": { + "bsonType": "string", + "description": "页面url" + }, + "create_time": { + "bsonType": "timestamp", + "description": "创建时间" + } + }, + "version": "0.0.2" +} \ No newline at end of file diff --git a/uniCloud-aliyun/database/uni-stat-error-result.schema.json b/uniCloud-aliyun/database/uni-stat-error-result.schema.json index d13451d..ea9a2ea 100644 --- a/uniCloud-aliyun/database/uni-stat-error-result.schema.json +++ b/uniCloud-aliyun/database/uni-stat-error-result.schema.json @@ -1 +1,96 @@ -{"bsonType":"object","description":"存储汇总的错误日志的数据","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"},"appid":{"bsonType":"string","description":"应用ID"},"platform_id":{"bsonType":"string","description":"应用平台ID,对应uni-stat-app-platforms._id","foreignKey":"uni-stat-app-platforms._id"},"channel_id":{"bsonType":"string","description":"渠道\/场景值ID,对应uni-stat-app-channels._id","foreignKey":"uni-stat-app-channels._id"},"version_id":{"bsonType":"string","description":"应用版本ID,对应opendb-app-versions._id","foreignKey":"opendb-app-versions._id"},"type":{"bsonType":"string","description":"错误类型","enum":[{"text":"前端js错误","value":"js"},{"text":"原生应用崩溃错误","value":"crash"}]},"hash":{"bsonType":"string","description":"错误hash码"},"msg":{"bsonType":"string","description":"错误信息"},"count":{"bsonType":"int","description":"报错次数"},"app_launch_count":{"bsonType":"int","description":"本时间段App启动或从后台切到前台的次数"},"last_time":{"bsonType":"timestamp","description":"最近一次报错事件"},"dimension":{"bsonType":"string","description":"统计范围 day:按天统计,hour:按小时统计","enum":[{"text":"月","value":"month"},{"text":"周","value":"week"},{"text":"天","value":"day"},{"text":"小时","value":"hour"}]},"stat_date":{"bsonType":"int","description":"统计日期,格式yyyymmdd,例:20211201"},"start_time":{"bsonType":"timestamp","description":"开始时间"},"end_time":{"bsonType":"timestamp","description":"结束时间"}},"version":"0.0.2"} \ No newline at end of file +{ + "bsonType": "object", + "description": "存储汇总的错误日志的数据", + "required": [], + "permission": { + "read": false, + "create": false, + "update": false, + "delete": false + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "appid": { + "bsonType": "string", + "description": "应用ID" + }, + "platform_id": { + "bsonType": "string", + "description": "应用平台ID,对应uni-stat-app-platforms._id", + "foreignKey": "uni-stat-app-platforms._id" + }, + "channel_id": { + "bsonType": "string", + "description": "渠道\/场景值ID,对应uni-stat-app-channels._id", + "foreignKey": "uni-stat-app-channels._id" + }, + "version_id": { + "bsonType": "string", + "description": "应用版本ID,对应opendb-app-versions._id", + "foreignKey": "opendb-app-versions._id" + }, + "type": { + "bsonType": "string", + "description": "错误类型", + "enum": [{ + "text": "前端js错误", + "value": "js" + }, { + "text": "原生应用崩溃错误", + "value": "crash" + }] + }, + "hash": { + "bsonType": "string", + "description": "错误hash码" + }, + "msg": { + "bsonType": "string", + "description": "错误信息" + }, + "count": { + "bsonType": "int", + "description": "报错次数" + }, + "app_launch_count": { + "bsonType": "int", + "description": "本时间段App启动或从后台切到前台的次数" + }, + "last_time": { + "bsonType": "timestamp", + "description": "最近一次报错事件" + }, + "dimension": { + "bsonType": "string", + "description": "统计范围 day:按天统计,hour:按小时统计", + "enum": [{ + "text": "月", + "value": "month" + }, { + "text": "周", + "value": "week" + }, { + "text": "天", + "value": "day" + }, { + "text": "小时", + "value": "hour" + }] + }, + "stat_date": { + "bsonType": "int", + "description": "统计日期,格式yyyymmdd,例:20211201" + }, + "start_time": { + "bsonType": "timestamp", + "description": "开始时间" + }, + "end_time": { + "bsonType": "timestamp", + "description": "结束时间" + } + }, + "version": "0.0.2" +} \ No newline at end of file diff --git a/uni_modules/next-tree/components/next-tree/next-tree.vue b/uni_modules/next-tree/components/next-tree/next-tree.vue new file mode 100644 index 0000000..5e47118 --- /dev/null +++ b/uni_modules/next-tree/components/next-tree/next-tree.vue @@ -0,0 +1,1034 @@ + + + + + diff --git a/uni_modules/next-tree/components/next-tree/style.css b/uni_modules/next-tree/components/next-tree/style.css new file mode 100644 index 0000000..76c987f --- /dev/null +++ b/uni_modules/next-tree/components/next-tree/style.css @@ -0,0 +1,269 @@ +@font-face { + font-family: 'iconfont'; + src: url('//at.alicdn.com/t/c/font_4110624_qs48wckazsh.ttf?t=1712479573821') format('truetype'); +} +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +.iconfont { + font-family: iconfont; + font-style: normal; +} +.iconfont-loading { + font-family: iconfont; + display: inline-block; + font-style: normal; + animation: spin 1s linear infinite; +} +.next-tree-mask { + position: fixed; + top: 0rpx; + right: 0rpx; + bottom: 0rpx; + left: 0rpx; + z-index: 997; + background-color: rgba(0, 0, 0, 0.6); + opacity: 0; + transition: all 0.3s ease; + visibility: hidden; +} +.next-tree-mask.show { + visibility: visible; + opacity: 1; +} +.next-tree-cnt { + position: fixed; + top: 0rpx; + right: 0rpx; + bottom: 0rpx; + left: 0rpx; + z-index: 997; + top: 360rpx; + transition: all 0.3s ease; + transform: translateY(100%); +} +.next-tree-cnt.next-tree-cnt-page { + transition: none; +} +.next-tree-cnt.show { + transform: translateY(0); +} +.next-tree-bar { + background-color: #fff; + height: 72rpx; + padding-left: 20rpx; + padding-right: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + box-sizing: border-box; + border-bottom-width: 1rpx !important; + border-bottom-style: solid; + border-bottom-color: #f5f5f5; + font-size: 32rpx; + color: #757575; + line-height: 1; +} +.next-tree-bar-btns { + display: inline-block; + display: flex; + flex-direction: row; +} +.btn-divid { + display: inline-block; + width: 1px; + margin: 0 10px; + background-color: #ccc; +} +.next-tree-bar-confirm { + color: #f9ae3d; +} +.next-tree-view { + position: absolute; + top: 0rpx; + right: 0rpx; + bottom: 0rpx; + left: 0rpx; + top: 72rpx; + background-color: #fff; + padding-top: 20rpx; + padding-right: 20rpx; + padding-bottom: 20rpx; + padding-left: 20rpx; +} +.next-tree-view-sc { + height: 100%; + overflow: hidden; +} +.next-tree-view-sc .empty { + text-align: center; + color: #757575; + padding: 30rpx; +} +.next-tree-item-block { + +} +.next-tree-item { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 26rpx; + color: #757575; + line-height: 1; + height: 0; + opacity: 0; + transition: 0.2s; + position: relative; + overflow: hidden; +} +.next-tree-item .icon-btn { + font-size: 30rpx; + margin-right: 20rpx; +} +.next-tree-item .left-line { + position: relative; + width: 1rpx; + height: 100%; + box-sizing: border-box; +} +.next-tree-item .left-line::before { + position: absolute; + content: ""; + width: 1rpx; + height: 100%; + background-color: rgba(204,204,204,0.9); + box-sizing: border-box; + + left: -18rpx; +} +.next-tree-item .parent-horizontal-line { + width: 1rpx; + height: 100%; + position: absolute; + top: 0; + left: 0rpx; + box-sizing: border-box; + background-color: rgba(204,204,204,0.9); +} +.next-tree-item .left-line .horizontal-line { + width: 20rpx; + height: 1rpx; + position: absolute; + top: 40rpx; + left: 0rpx; + background-color: rgba(204,204,204,0.9); + box-sizing: border-box; +} + +.next-tree-item.show { + height: 80rpx; + opacity: 1; +} +.next-tree-item.showchild:before { + transform: rotate(90deg); +} +.next-tree-item.border { + border-bottom: 1rpx solid rgba(204,204,204,0.2); +} +.next-tree-item.last:before { + opacity: 0; +} +.next-tree-item.disabled { + color: #ccc!important; +} + +.next-tree-icon { + width: 26rpx; + height: 26rpx; + margin-right: 8rpx; +} +.next-tree-label { + flex: 1; + display: flex; + align-items: center; + height: 100%; + line-height: 1.2; +} +.next-tree-label .label-input { + border: 1rpx solid #f0f0f0; + border-radius: 10rpx; + width: 100%; + padding: 12rpx 18rpx; + margin-right: 30rpx; +} +.next-tree-check { + width: 40px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; +} +.next-tree-check-yes, +.next-tree-check-no { + width: 20px; + height: 20px; + border-top-left-radius: 20%; + border-top-right-radius: 20%; + border-bottom-right-radius: 20%; + border-bottom-left-radius: 20%; + border-top-width: 1rpx; + border-left-width: 1rpx; + border-bottom-width: 1rpx; + border-right-width: 1rpx; + border-style: solid; + border-color: #f9ae3d; + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; +} +.next-tree-check-yes-b { + border-top-left-radius: 20%; + border-top-right-radius: 20%; + border-bottom-right-radius: 20%; + border-bottom-left-radius: 20%; + background-color: #f9ae3d; + color: #fff; +} +.next-tree-check-yes-b .icon-text { + font-size: 14px; + font-weight: normal; + font-family: uicon-iconfont; + display: flex; + flex-direction: row; + align-items: center; +} +.next-tree-check .radio { + border-top-left-radius: 50%; + border-top-right-radius: 50%; + border-bottom-right-radius: 50%; + border-bottom-left-radius: 50%; +} +.next-tree-check .radio .next-tree-check-yes-b { + border-top-left-radius: 50%; + border-top-right-radius: 50%; + border-bottom-right-radius: 50%; + border-bottom-left-radius: 50%; +} + +.next-tree-item.disabled .next-tree-check-no { + color: #ccc!important; +} +.next-tree-item.disabled .next-tree-check-yes-b { + background-color: #ccc!important; +} +.hover-c { + opacity: 0.6; +} + +.fixed-bottom-bar { + position: fixed; + bottom: 0rpx; + left: 0rpx; + right: 0rpx; + z-index: 998; +} + + diff --git a/uni_modules/next-tree/package.json b/uni_modules/next-tree/package.json new file mode 100644 index 0000000..6eb8ba2 --- /dev/null +++ b/uni_modules/next-tree/package.json @@ -0,0 +1,84 @@ +{ + "id": "next-tree", + "displayName": "next-tree(超强树选择器、树组件、树插件、无限级联树、单选树、多选树、自定义样式树、树形选择器)", + "version": "1.8.7", + "description": "next-tree 弹窗树形选择器,支持多选,支持大数据, 无限级联,单选,父子级级联,远程/ajax加载,子节点增量/异步渲染,自定义样式定制,具名插槽等;支持h5/小程序/APP,全端通用", + "keywords": [ + "树选择", + "tree", + "弹窗树选择器", + "多选树", + "单选树" +], +"engines": { + }, +"dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "修改版本说明", + "permissions": "无" + }, + "npmurl": "", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": ["next-search-more"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y", + "alipay": "n" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "u" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "n", + "Edge": "y", + "Firefox": "y", + "Safari": "u" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "u", + "QQ": "y", + "钉钉": "y", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json b/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json index d0d7282..6dd37a7 100644 --- a/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json +++ b/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json @@ -1,15 +1,17 @@ { - "passwordSecret": "passwordSecret-demo", - "tokenSecret": "tokenSecret-demo", + "passwordSecret": "test-passwordSecret", + "tokenSecret": "test-tokenSecret", "tokenExpiresIn": 7200, "tokenExpiresThreshold": 600, "passwordErrorLimit": 6, "bindTokenToDevice": false, "passwordErrorRetryTime": 3600, - "autoSetInviteCode": false, + "autoSetInviteCode": true, "forceInviteCode": false, + "preferedAppPlatform": "app", + "requestAuthSecret": "testSecret", "app": { - "tokenExpiresIn": 2592000, + "tokenExpiresIn": 2592000, "oauth": { "weixin": { "appid": "wx97a8f7019d175ced", @@ -20,6 +22,18 @@ } } }, + "web": { + "oauth": { + "weixin-h5": { + "appid": "微信浏览器内微信登录,所用的微信公众号appid", + "appsecret": "微信公众号后台获取的appsecret" + }, + "weixin-web": { + "appid": "手机微信扫码登录,所用的微信开放平台(https://open.weixin.qq.com/)-网站应用的appid", + "appsecret": "微信开放平台-网站应用的appsecret" + } + } + }, "mp-weixin": { "oauth": { "weixin": { @@ -31,26 +45,22 @@ "mp-alipay": { "oauth": { "alipay": { - "appid": "alipay appid", - "privateKey": "alipay privateKey" + "appid": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr", + "privateKey": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr" } } }, "service": { "sms": { "name": "应用名称,对应短信模版的name", - "codeExpiresIn": 180, - "smsKey": "短信密钥key,开通短信服务处可以看到", - "smsSecret": "短信密钥secret,开通短信服务处可以看到", - "scene": { - "bind-mobile-by-sms": { - "templateId": "绑定手机号使用的短信验证码模板", - "codeExpiresIn": 240 - } - } + "codeExpiresIn": 300, + "smsKey": "ec5fba39363dc30af7f21bbb5ac6e857", + "smsSecret": "09abff426ab62fd2e104c3be794b84c7" }, "univerify": { - "appid": "当前应用的appid,使用云函数URL化,此项必须配置" + "appid": "当前应用的appid,使用云函数URL化,此项必须配置", + "apiKey": "apiKey 和 apiSecret 在开发者中心获取,开发者中心:https://dev.dcloud.net.cn/uniLogin/index?type=0,文档:https://ask.dcloud.net.cn/article/37965", + "apiSecret": "" } } -} +} \ No newline at end of file diff --git a/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/package.json b/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/package.json new file mode 100644 index 0000000..2b8132e --- /dev/null +++ b/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/package.json @@ -0,0 +1,4 @@ +{ + "name": "uni-id", + "dependencies": {} +} \ No newline at end of file diff --git a/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js b/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js index a8b99d0..6fcc68c 100644 --- a/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js +++ b/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js @@ -1 +1,576 @@ -"use strict";var e,t=(e=require("crypto"))&&"object"==typeof e&&"default"in e?e.default:e;const n={TOKEN_EXPIRED:"uni-id-token-expired",CHECK_TOKEN_FAILED:"uni-id-check-token-failed",PARAM_REQUIRED:"uni-id-param-required",ACCOUNT_EXISTS:"uni-id-account-exists",ACCOUNT_NOT_EXISTS:"uni-id-account-not-exists",ACCOUNT_CONFLICT:"uni-id-account-conflict",ACCOUNT_BANNED:"uni-id-account-banned",ACCOUNT_AUDITING:"uni-id-account-auditing",ACCOUNT_AUDIT_FAILED:"uni-id-account-audit-failed",ACCOUNT_CLOSED:"uni-id-account-closed"};function i(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}function r(e){if(!e)return;const t=e.match(/^(\d+).(\d+).(\d+)/);return t?t.slice(1,4).map(e=>parseInt(e)):void 0}function o(e,t){const n=r(e),i=r(t);return n?i?function(e,t){const n=Math.max(e.length,t.length);for(let i=0;ir)return 1;if(n=e)throw new Error("Config error, tokenExpiresThreshold should be less than tokenExpiresIn");t>e/2&&console.warn(`Please check whether the tokenExpiresThreshold configuration is set too large, tokenExpiresThreshold: ${t}, tokenExpiresIn: ${e}`)}get customToken(){return this.uniId.interceptorMap.get("customToken")}isTokenInDb(e){return o(e,"1.0.10")>=0}async getUserRecord(){if(this.userRecord)return this.userRecord;const e=await C.doc(this.uid).get();if(this.userRecord=e.data[0],!this.userRecord)throw{errCode:n.ACCOUNT_NOT_EXISTS};switch(this.userRecord.status){case void 0:case 0:break;case 1:throw{errCode:n.ACCOUNT_BANNED};case 2:throw{errCode:n.ACCOUNT_AUDITING};case 3:throw{errCode:n.ACCOUNT_AUDIT_FAILED};case 4:throw{errCode:n.ACCOUNT_CLOSED}}if(this.oldTokenPayload){if(this.isTokenInDb(this.oldTokenPayload.uniIdVersion)){if(-1===(this.userRecord.token||[]).indexOf(this.oldToken))throw{errCode:n.CHECK_TOKEN_FAILED}}if(this.userRecord.valid_token_date&&this.userRecord.valid_token_date>1e3*this.oldTokenPayload.iat)throw{errCode:n.TOKEN_EXPIRED}}return this.userRecord}async updateUserRecord(e){await C.doc(this.uid).update(e)}async getUserPermission(){if(this.userPermission)return this.userPermission;const e=(await this.getUserRecord()).role||[];if(0===e.length)return this.userPermission={role:[],permission:[]},this.userPermission;if(e.includes("admin"))return this.userPermission={role:e,permission:[]},this.userPermission;const t=await T.where({role_id:I.in(e)}).get(),n=(i=t.data.reduce((e,t)=>(t.permission&&e.push(...t.permission),e),[]),Array.from(new Set(i)));var i;return this.userPermission={role:e,permission:n},this.userPermission}async _createToken({uid:e,role:t,permission:i}={}){if(!t||!i){const e=await this.getUserPermission();t=e.role,i=e.permission}let r={uid:e,role:t,permission:i};if(this.uniId.interceptorMap.has("customToken")){const n=this.uniId.interceptorMap.get("customToken");if("function"!=typeof n)throw new Error("Invalid custom token file");r=await n({uid:e,role:t,permission:i})}const o=Date.now(),{tokenSecret:s,tokenExpiresIn:c,maxTokenLength:a=10}=this.config,u=g({...r,uniIdVersion:"1.0.18"},s,{expiresIn:c}),d=await this.getUserRecord(),l=(d.token||[]).filter(e=>{try{const t=this._checkToken(e);if(d.valid_token_date&&d.valid_token_date>1e3*t.iat)return!1}catch(e){if(e.errCode===n.TOKEN_EXPIRED)return!1}return!0});return l.push(u),l.length>a&&l.splice(0,l.length-a),await this.updateUserRecord({last_login_ip:this.clientInfo.clientIP,last_login_date:o,token:l}),{token:u,tokenExpired:o+1e3*c}}async createToken({uid:e,role:t,permission:i}={}){if(!e)throw{errCode:n.PARAM_REQUIRED,errMsgValue:{param:"uid"}};this.uid=e;const{token:r,tokenExpired:o}=await this._createToken({uid:e,role:t,permission:i});return{errCode:0,token:r,tokenExpired:o}}async refreshToken({token:e}={}){if(!e)throw{errCode:n.PARAM_REQUIRED,errMsgValue:{param:"token"}};this.oldToken=e;const t=this._checkToken(e);this.uid=t.uid,this.oldTokenPayload=t;const{uid:i}=t,{role:r,permission:o}=await this.getUserPermission(),{token:s,tokenExpired:c}=await this._createToken({uid:i,role:r,permission:o});return{errCode:0,token:s,tokenExpired:c}}_checkToken(e){const{tokenSecret:t}=this.config;let i;try{i=k(e,t)}catch(e){if("TokenExpiredError"===e.name)throw{errCode:n.TOKEN_EXPIRED};throw{errCode:n.CHECK_TOKEN_FAILED}}return i}async checkToken(e,{autoRefresh:t=!0}={}){if(!e)throw{errCode:n.CHECK_TOKEN_FAILED};this.oldToken=e;const i=this._checkToken(e);this.uid=i.uid,this.oldTokenPayload=i;const{tokenExpiresThreshold:r}=this.config,{uid:o,role:s,permission:c}=i,a={role:s,permission:c};if(!s&&!c){const{role:e,permission:t}=await this.getUserPermission();a.role=e,a.permission=t}if(!r||!t){const e={code:0,errCode:0,...i,...a};return delete e.uniIdVersion,e}const u=Date.now();let d={};1e3*i.exp-u<1e3*r&&(d=await this._createToken({uid:o}));const l={code:0,errCode:0,...i,...a,...d};return delete l.uniIdVersion,l}}var m=Object.freeze({__proto__:null,checkToken:async function(e,{autoRefresh:t=!0}={}){return new E({uniId:this}).checkToken(e,{autoRefresh:t})},createToken:async function({uid:e,role:t,permission:n}={}){return new E({uniId:this}).createToken({uid:e,role:t,permission:n})},refreshToken:async function({token:e}={}){return new E({uniId:this}).refreshToken({token:e})}});const w=require("uni-config-center")({pluginId:"uni-id"});class x{constructor({context:e,clientInfo:t,config:n}={}){this._clientInfo=e?function(e){return{appId:e.APPID,platform:e.PLATFORM,locale:e.LOCALE,clientIP:e.CLIENTIP,deviceId:e.DEVICEID}}(e):t,this._config=n,this.config=this._getOriginConfig(),this.interceptorMap=new Map,w.hasFile("custom-token.js")&&this.setInterceptor("customToken",require(w.resolve("custom-token.js")));this._i18n=uniCloud.initI18n({locale:this._clientInfo.locale,fallbackLocale:"zh-Hans",messages:JSON.parse(JSON.stringify(d))}),d[this._i18n.locale]||this._i18n.setLocale("zh-Hans")}setInterceptor(e,t){this.interceptorMap.set(e,t)}_t(...e){return this._i18n.t(...e)}_parseOriginConfig(e){return Array.isArray(e)?e:e[0]?Object.values(e):e}_getOriginConfig(){if(this._config)return this._config;if(w.hasFile("config.json")){let e;try{e=w.config()}catch(e){throw new Error("Invalid uni-id config file\n"+e.message)}return this._parseOriginConfig(e)}try{return this._parseOriginConfig(require("uni-id/config.json"))}catch(e){throw new Error("Invalid uni-id config file")}}_getAppConfig(){const e=this._getOriginConfig();return Array.isArray(e)?e.find(e=>e.dcloudAppid===this._clientInfo.appId)||e.find(e=>e.isDefaultConfig):e}_getPlatformConfig(){const e=this._getAppConfig();if(!e)throw new Error(`Config for current app (${this._clientInfo.appId}) was not found, please check your config file or client appId`);let t;switch(["app-plus","app-android","app-ios"].indexOf(this._clientInfo.platform)>-1&&(this._clientInfo.platform="app"),"h5"===this._clientInfo.platform&&(this._clientInfo.platform="web"),this._clientInfo.platform){case"web":t="h5";break;case"app":t="app-plus"}const n=[{tokenExpiresIn:7200,tokenExpiresThreshold:1200,passwordErrorLimit:6,passwordErrorRetryTime:3600},e];t&&e[t]&&n.push(e[t]),n.push(e[this._clientInfo.platform]);const i=Object.assign(...n);return["tokenSecret","tokenExpiresIn"].forEach(e=>{if(!i||!i[e])throw new Error(`Config parameter missing, ${e} is required`)}),i}_getConfig(){return this._getPlatformConfig()}}for(const e in m)x.prototype[e]=m[e];function y(e){const t=new x(e);return new Proxy(t,{get(e,t){if(t in e&&0!==t.indexOf("_")){if("function"==typeof e[t])return(n=e[t],function(){let e;try{e=n.apply(this,arguments)}catch(e){if(a(e))return c.call(this,e),e;throw e}return i(e)?e.then(e=>(a(e)&&c.call(this,e),e),e=>{if(a(e))return c.call(this,e),e;throw e}):(a(e)&&c.call(this,e),e)}).bind(e);if("context"!==t&&"config"!==t)return e[t]}var n}})}x.prototype.createInstance=y;const O={createInstance:y};module.exports=O; +"use strict"; +var e, t = (e = require("crypto")) && "object" == typeof e && "default" in e ? e.default : e; +const n = { + TOKEN_EXPIRED: "uni-id-token-expired", + CHECK_TOKEN_FAILED: "uni-id-check-token-failed", + PARAM_REQUIRED: "uni-id-param-required", + ACCOUNT_EXISTS: "uni-id-account-exists", + ACCOUNT_NOT_EXISTS: "uni-id-account-not-exists", + ACCOUNT_CONFLICT: "uni-id-account-conflict", + ACCOUNT_BANNED: "uni-id-account-banned", + ACCOUNT_AUDITING: "uni-id-account-auditing", + ACCOUNT_AUDIT_FAILED: "uni-id-account-audit-failed", + ACCOUNT_CLOSED: "uni-id-account-closed" +}; + +function i(e) { + return !!e && ("object" == typeof e || "function" == typeof e) && "function" == typeof e.then +} + +function r(e) { + if (!e) return; + const t = e.match(/^(\d+).(\d+).(\d+)/); + return t ? t.slice(1, 4).map(e => parseInt(e)) : void 0 +} + +function o(e, t) { + const n = r(e), + i = r(t); + return n ? i ? function(e, t) { + const n = Math.max(e.length, t.length); + for (let i = 0; i < n; i++) { + const n = e[i], + r = t[i]; + if (n > r) return 1; + if (n < r) return -1 + } + return 0 + }(n, i) : 1 : i ? -1 : 0 +} +const s = { + "uni-id-token-expired": 30203, + "uni-id-check-token-failed": 30202 +}; + +function c(e) { + const { + errCode: t, + errMsgValue: n + } = e; + e.errMsg = this._t(t, n), t in s && (e.code = s[t]), delete e.errMsgValue +} + +function a(e) { + return "object" === (i = e, Object.prototype.toString.call(i).slice(8, -1).toLowerCase()) && e.errCode && (t = e + .errCode, Object.values(n).includes(t)) && !!e.errCode; + var t, i +} +let u = { + "zh-Hans": { + "uni-id-token-expired": "登录状态失效,token已过期", + "uni-id-check-token-failed": "token校验未通过", + "uni-id-param-required": "缺少参数: {param}", + "uni-id-account-exists": "此账号已注册", + "uni-id-account-not-exists": "此账号未注册", + "uni-id-account-conflict": "用户账号冲突", + "uni-id-account-banned": "从账号已封禁", + "uni-id-account-auditing": "此账号正在审核中", + "uni-id-account-audit-failed": "此账号审核失败", + "uni-id-account-closed": "此账号已注销" + }, + en: { + "uni-id-token-expired": "The login status is invalid, token has expired", + "uni-id-check-token-failed": "Check token failed", + "uni-id-param-required": "Parameter required: {param}", + "uni-id-account-exists": "Account exists", + "uni-id-account-not-exists": "Account does not exists", + "uni-id-account-conflict": "User account conflict", + "uni-id-account-banned": "Account has been banned", + "uni-id-account-auditing": "Account audit in progress", + "uni-id-account-audit-failed": "Account audit failed", + "uni-id-account-closed": "Account has been closed" + } +}; +try { + const e = require.resolve("uni-config-center/uni-id/lang/index.js"); + u = function(e, t) { + const n = Object.keys(e); + n.push(...Object.keys(t)); + const i = {}; + for (let r = 0; r < n.length; r++) { + const o = n[r]; + i[o] = Object.assign({}, e[o], t[o]) + } + return i + }(u, require(e)) +} catch (e) {} +var d = u; + +function l(e) { + return e.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_") +} + +function h(e) { + return JSON.parse((t = function(e) { + var t = 4 - (e = e.toString()).length % 4; + if (4 !== t) + for (var n = 0; n < t; ++n) e += "="; + return e.replace(/-/g, "+").replace(/_/g, "/") + }(e), Buffer.from(t, "base64").toString("utf-8"))); + var t +} + +function f(e) { + return l((t = JSON.stringify(e), Buffer.from(t, "utf-8").toString("base64"))); + var t +} + +function p(e, n) { + return l(t.createHmac("sha256", n).update(e).digest("base64")) +} +const k = function(e, t) { + if ("string" != typeof e) throw new Error("Invalid token"); + const n = e.split("."); + if (3 !== n.length) throw new Error("Invalid token"); + const [i, r, o] = n; + if (p(i + "." + r, t) !== o) throw new Error("Invalid token"); + const s = h(i); + if ("HS256" !== s.alg || "JWT" !== s.typ) throw new Error("Invalid token"); + const c = h(r); + if (1e3 * c.exp < Date.now()) { + const e = new Error("Token expired"); + throw e.name = "TokenExpiredError", e + } + return c + }, + g = function(e, t, n = {}) { + const { + expiresIn: i + } = n; + if (!i) throw new Error("expiresIn is required"); + const r = parseInt(Date.now() / 1e3), + o = { + ...e, + iat: r, + exp: r + n.expiresIn + }, + s = f({ + alg: "HS256", + typ: "JWT" + }) + "." + f(o); + return s + "." + p(s, t) + }, + _ = uniCloud.database(), + I = _.command, + C = _.collection("uni-id-users"), + T = _.collection("uni-id-roles"); +class E { + constructor({ + uniId: e + } = {}) { + this.uid = null, this.userRecord = null, this.userPermission = null, this.oldToken = null, this + .oldTokenPayload = null, this.uniId = e, this.config = this.uniId._getConfig(), this.clientInfo = this + .uniId._clientInfo, this.checkConfig() + } + checkConfig() { + const { + tokenExpiresIn: e, + tokenExpiresThreshold: t + } = this.config; + if (t >= e) throw new Error("Config error, tokenExpiresThreshold should be less than tokenExpiresIn"); + t > e / 2 && console.warn( + `Please check whether the tokenExpiresThreshold configuration is set too large, tokenExpiresThreshold: ${t}, tokenExpiresIn: ${e}` + ) + } + get customToken() { + return this.uniId.interceptorMap.get("customToken") + } + isTokenInDb(e) { + return o(e, "1.0.10") >= 0 + } + async getUserRecord() { + if (this.userRecord) return this.userRecord; + const e = await C.doc(this.uid).get(); + if (this.userRecord = e.data[0], !this.userRecord) throw { + errCode: n.ACCOUNT_NOT_EXISTS + }; + switch (this.userRecord.status) { + case void 0: + case 0: + break; + case 1: + throw { + errCode: n.ACCOUNT_BANNED + }; + case 2: + throw { + errCode: n.ACCOUNT_AUDITING + }; + case 3: + throw { + errCode: n.ACCOUNT_AUDIT_FAILED + }; + case 4: + throw { + errCode: n.ACCOUNT_CLOSED + } + } + if (this.oldTokenPayload) { + if (this.isTokenInDb(this.oldTokenPayload.uniIdVersion)) { + if (-1 === (this.userRecord.token || []).indexOf(this.oldToken)) throw { + errCode: n.CHECK_TOKEN_FAILED + } + } + if (this.userRecord.valid_token_date && this.userRecord.valid_token_date > 1e3 * this.oldTokenPayload + .iat) throw { + errCode: n.TOKEN_EXPIRED + } + } + return this.userRecord + } + async updateUserRecord(e) { + await C.doc(this.uid).update(e) + } + async getUserPermission() { + if (this.userPermission) return this.userPermission; + const e = (await this.getUserRecord()).role || []; + if (0 === e.length) return this.userPermission = { + role: [], + permission: [] + }, this.userPermission; + if (e.includes("admin")) return this.userPermission = { + role: e, + permission: [] + }, this.userPermission; + const t = await T.where({ + role_id: I.in(e) + }).get(), + n = (i = t.data.reduce((e, t) => (t.permission && e.push(...t.permission), e), []), Array.from(new Set( + i))); + var i; + return this.userPermission = { + role: e, + permission: n + }, this.userPermission + } + async _createToken({ + uid: e, + role: t, + permission: i + } = {}) { + if (!t || !i) { + const e = await this.getUserPermission(); + t = e.role, i = e.permission + } + let r = { + uid: e, + role: t, + permission: i + }; + if (this.uniId.interceptorMap.has("customToken")) { + const n = this.uniId.interceptorMap.get("customToken"); + if ("function" != typeof n) throw new Error("Invalid custom token file"); + r = await n({ + uid: e, + role: t, + permission: i + }) + } + const o = Date.now(), + { + tokenSecret: s, + tokenExpiresIn: c, + maxTokenLength: a = 10 + } = this.config, + u = g({ + ...r, + uniIdVersion: "1.0.18" + }, s, { + expiresIn: c + }), + d = await this.getUserRecord(), + l = (d.token || []).filter(e => { + try { + const t = this._checkToken(e); + if (d.valid_token_date && d.valid_token_date > 1e3 * t.iat) return !1 + } catch (e) { + if (e.errCode === n.TOKEN_EXPIRED) return !1 + } + return !0 + }); + return l.push(u), l.length > a && l.splice(0, l.length - a), await this.updateUserRecord({ + last_login_ip: this.clientInfo.clientIP, + last_login_date: o, + token: l + }), { + token: u, + tokenExpired: o + 1e3 * c + } + } + async createToken({ + uid: e, + role: t, + permission: i + } = {}) { + if (!e) throw { + errCode: n.PARAM_REQUIRED, + errMsgValue: { + param: "uid" + } + }; + this.uid = e; + const { + token: r, + tokenExpired: o + } = await this._createToken({ + uid: e, + role: t, + permission: i + }); + return { + errCode: 0, + token: r, + tokenExpired: o + } + } + async refreshToken({ + token: e + } = {}) { + if (!e) throw { + errCode: n.PARAM_REQUIRED, + errMsgValue: { + param: "token" + } + }; + this.oldToken = e; + const t = this._checkToken(e); + this.uid = t.uid, this.oldTokenPayload = t; + const { + uid: i + } = t, { + role: r, + permission: o + } = await this.getUserPermission(), { + token: s, + tokenExpired: c + } = await this._createToken({ + uid: i, + role: r, + permission: o + }); + return { + errCode: 0, + token: s, + tokenExpired: c + } + } + _checkToken(e) { + const { + tokenSecret: t + } = this.config; + let i; + try { + i = k(e, t) + } catch (e) { + if ("TokenExpiredError" === e.name) throw { + errCode: n.TOKEN_EXPIRED + }; + throw { + errCode: n.CHECK_TOKEN_FAILED + } + } + return i + } + async checkToken(e, { + autoRefresh: t = !0 + } = {}) { + if (!e) throw { + errCode: n.CHECK_TOKEN_FAILED + }; + this.oldToken = e; + const i = this._checkToken(e); + this.uid = i.uid, this.oldTokenPayload = i; + const { + tokenExpiresThreshold: r + } = this.config, { + uid: o, + role: s, + permission: c + } = i, a = { + role: s, + permission: c + }; + if (!s && !c) { + const { + role: e, + permission: t + } = await this.getUserPermission(); + a.role = e, a.permission = t + } + if (!r || !t) { + const e = { + code: 0, + errCode: 0, + ...i, + ...a + }; + return delete e.uniIdVersion, e + } + const u = Date.now(); + let d = {}; + 1e3 * i.exp - u < 1e3 * r && (d = await this._createToken({ + uid: o + })); + const l = { + code: 0, + errCode: 0, + ...i, + ...a, + ...d + }; + return delete l.uniIdVersion, l + } +} +var m = Object.freeze({ + __proto__: null, + checkToken: async function(e, { + autoRefresh: t = !0 + } = {}) { + return new E({ + uniId: this + }).checkToken(e, { + autoRefresh: t + }) + }, + createToken: async function({ + uid: e, + role: t, + permission: n + } = {}) { + return new E({ + uniId: this + }).createToken({ + uid: e, + role: t, + permission: n + }) + }, + refreshToken: async function({ + token: e + } = {}) { + return new E({ + uniId: this + }).refreshToken({ + token: e + }) + } +}); +const w = require("uni-config-center")({ + pluginId: "uni-id" +}); +class x { + constructor({ + context: e, + clientInfo: t, + config: n + } = {}) { + this._clientInfo = e ? function(e) { + return { + appId: e.APPID, + platform: e.PLATFORM, + locale: e.LOCALE, + clientIP: e.CLIENTIP, + deviceId: e.DEVICEID + } + }(e) : t, this._config = n, this.config = this._getOriginConfig(), this.interceptorMap = new Map, w + .hasFile("custom-token.js") && this.setInterceptor("customToken", require(w.resolve( + "custom-token.js"))); + this._i18n = uniCloud.initI18n({ + locale: this._clientInfo.locale, + fallbackLocale: "zh-Hans", + messages: JSON.parse(JSON.stringify(d)) + }), d[this._i18n.locale] || this._i18n.setLocale("zh-Hans") + } + setInterceptor(e, t) { + this.interceptorMap.set(e, t) + } + _t(...e) { + return this._i18n.t(...e) + } + _parseOriginConfig(e) { + return Array.isArray(e) ? e : e[0] ? Object.values(e) : e + } + _getOriginConfig() { + if (this._config) return this._config; + if (w.hasFile("config.json")) { + let e; + try { + e = w.config() + } catch (e) { + throw new Error("Invalid uni-id config file\n" + e.message) + } + return this._parseOriginConfig(e) + } + try { + return this._parseOriginConfig(require("uni-id/config.json")) + } catch (e) { + throw new Error("Invalid uni-id config file") + } + } + _getAppConfig() { + const e = this._getOriginConfig(); + return Array.isArray(e) ? e.find(e => e.dcloudAppid === this._clientInfo.appId) || e.find(e => e + .isDefaultConfig) : e + } + _getPlatformConfig() { + const e = this._getAppConfig(); + if (!e) throw new Error( + `Config for current app (${this._clientInfo.appId}) was not found, please check your config file or client appId` + ); + let t; + switch (["app-plus", "app-android", "app-ios"].indexOf(this._clientInfo.platform) > -1 && (this._clientInfo + .platform = "app"), "h5" === this._clientInfo.platform && (this._clientInfo.platform = "web"), this + ._clientInfo.platform) { + case "web": + t = "h5"; + break; + case "app": + t = "app-plus" + } + const n = [{ + tokenExpiresIn: 7200, + tokenExpiresThreshold: 1200, + passwordErrorLimit: 6, + passwordErrorRetryTime: 3600 + }, e]; + t && e[t] && n.push(e[t]), n.push(e[this._clientInfo.platform]); + const i = Object.assign(...n); + return ["tokenSecret", "tokenExpiresIn"].forEach(e => { + if (!i || !i[e]) throw new Error(`Config parameter missing, ${e} is required`) + }), i + } + _getConfig() { + return this._getPlatformConfig() + } +} +for (const e in m) x.prototype[e] = m[e]; + +function y(e) { + const t = new x(e); + return new Proxy(t, { + get(e, t) { + if (t in e && 0 !== t.indexOf("_")) { + if ("function" == typeof e[t]) return (n = e[t], function() { + let e; + try { + e = n.apply(this, arguments) + } catch (e) { + if (a(e)) return c.call(this, e), e; + throw e + } + return i(e) ? e.then(e => (a(e) && c.call(this, e), e), e => { + if (a(e)) return c.call(this, e), e; + throw e + }) : (a(e) && c.call(this, e), e) + }).bind(e); + if ("context" !== t && "config" !== t) return e[t] + } + var n + } + }) +} +x.prototype.createInstance = y; +const O = { + createInstance: y +}; +module.exports = O; \ No newline at end of file diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue b/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue index 9688abf..d456953 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue @@ -1,568 +1,565 @@ diff --git a/uni_modules/uni-id-pages/config.js b/uni_modules/uni-id-pages/config.js index 618bcf7..f5ab36a 100644 --- a/uni_modules/uni-id-pages/config.js +++ b/uni_modules/uni-id-pages/config.js @@ -39,7 +39,7 @@ export default { appid: { weixin: { // 微信公众号的appid,来源:登录微信公众号(https://mp.weixin.qq.com)-> 设置与开发 -> 基本配置 -> 公众号开发信息 -> AppID - h5: 'xxxxxx', + h5: 'wx9f9b7d747d261686', // 微信开放平台的appid,来源:登录微信开放平台(https://open.weixin.qq.com) -> 管理中心 -> 网站应用 -> 选择对应的应用名称,点击查看 -> AppID web: 'xxxxxx' } diff --git a/uni_modules/uts-openSchema/changelog.md b/uni_modules/uts-openSchema/changelog.md deleted file mode 100644 index cb0bf4d..0000000 --- a/uni_modules/uts-openSchema/changelog.md +++ /dev/null @@ -1,2 +0,0 @@ -## 1.0.0(2024-04-25) -- 更新 在 Android 和 iOS 上打开链接的 UTS API diff --git a/uni_modules/uts-openSchema/package.json b/uni_modules/uts-openSchema/package.json deleted file mode 100644 index 78c3ee3..0000000 --- a/uni_modules/uts-openSchema/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "id": "uts-openSchema", - "displayName": "uts-openSchema", - "version": "1.0.0", - "description": "在 Android 和 iOS 上打开链接的 UTS API", - "keywords": [ - "uts-openSchema" -], - "repository": "", - "engines": { - "HBuilderX": "^4.0" - }, - "dcloudext": { - "type": "uts", - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "y" - }, - "client": { - "Vue": { - "vue2": "n", - "vue3": "y" - }, - "App": { - "app-android": "y", - "app-ios": "y" - }, - "H5-mobile": { - "Safari": "n", - "Android Browser": "n", - "微信浏览器(Android)": "n", - "QQ浏览器(Android)": "n" - }, - "H5-pc": { - "Chrome": "n", - "IE": "n", - "Edge": "n", - "Firefox": "n", - "Safari": "n" - }, - "小程序": { - "微信": "n", - "阿里": "n", - "百度": "n", - "字节跳动": "n", - "QQ": "n", - "钉钉": "n", - "快手": "n", - "飞书": "n", - "京东": "n" - }, - "快应用": { - "华为": "n", - "联盟": "n" - } - } - } - } -} \ No newline at end of file diff --git a/uni_modules/uts-openSchema/readme.md b/uni_modules/uts-openSchema/readme.md deleted file mode 100644 index 7bda602..0000000 --- a/uni_modules/uts-openSchema/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -# uts-openSchema -### 开发文档 -[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html) -[UTS API插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html) -[UTS 组件插件](https://uniapp.dcloud.net.cn/plugin/uts-component.html) -[Hello UTS](https://gitcode.net/dcloud/hello-uts) \ No newline at end of file diff --git a/uni_modules/uts-openSchema/utssdk/app-android/config.json b/uni_modules/uts-openSchema/utssdk/app-android/config.json deleted file mode 100644 index bf95925..0000000 --- a/uni_modules/uts-openSchema/utssdk/app-android/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "minSdkVersion": "21" -} \ No newline at end of file diff --git a/uni_modules/uts-openSchema/utssdk/app-android/index.uts b/uni_modules/uts-openSchema/utssdk/app-android/index.uts deleted file mode 100644 index 660c99e..0000000 --- a/uni_modules/uts-openSchema/utssdk/app-android/index.uts +++ /dev/null @@ -1,15 +0,0 @@ -import Intent from 'android.content.Intent' -import Uri from 'android.net.Uri' -import { OpenSchema } from '../interface.uts' - -export const openSchema: OpenSchema = function (url: string) { - if (typeof url === 'string' && url.length > 0) { - const context = UTSAndroid.getUniActivity()! - const uri = Uri.parse(url) - const intent = new Intent(Intent.ACTION_VIEW, uri) - intent.setData(uri) - context.startActivity(intent) - } else { - console.error('url param ERROR:', JSON.stringify(url)) - } -} diff --git a/uni_modules/uts-openSchema/utssdk/app-ios/config.json b/uni_modules/uts-openSchema/utssdk/app-ios/config.json deleted file mode 100644 index f272043..0000000 --- a/uni_modules/uts-openSchema/utssdk/app-ios/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "deploymentTarget": "12.0" -} \ No newline at end of file diff --git a/uni_modules/uts-openSchema/utssdk/app-ios/index.uts b/uni_modules/uts-openSchema/utssdk/app-ios/index.uts deleted file mode 100644 index 6483e4f..0000000 --- a/uni_modules/uts-openSchema/utssdk/app-ios/index.uts +++ /dev/null @@ -1,14 +0,0 @@ -import { OpenSchema } from '../interface.uts' - -export const openSchema: OpenSchema = function(url: string): void { - if (typeof url == 'string' && url.length > 0) { - let uri = new URL(string = url) - if (uri != null && UIApplication.shared.canOpenURL(uri!)) { - UIApplication.shared.open(uri!, options = new Map(), completionHandler = null) - }else { - console.error('url param Error: ', url) - } - }else { - console.error('url param Error: ', url) - } -} \ No newline at end of file diff --git a/uni_modules/uts-openSchema/utssdk/interface.uts b/uni_modules/uts-openSchema/utssdk/interface.uts deleted file mode 100644 index e790e61..0000000 --- a/uni_modules/uts-openSchema/utssdk/interface.uts +++ /dev/null @@ -1 +0,0 @@ -export type OpenSchema = (url: string) => void