提交 285236c9 编写于 作者: DCloud_JSON's avatar DCloud_JSON

- 修复微信小程序绑定手机号失败的问题

上级 0ceaaaa4
## 1.2.7(2022-08-10)
- 修复微信小程序绑定手机号失败的问题
## 1.2.6(2022-06-29) ## 1.2.6(2022-06-29)
- 支持 ios 安全区 - 支持 ios 安全区
## 1.2.5(2022-05-29) ## 1.2.5(2022-05-29)
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
}, },
bindMobileByMpWeixin(e) { bindMobileByMpWeixin(e) {
console.log(e.detail); console.log(e.detail);
if(e.errMsg == "getPhoneNumber:ok"){ if(e.detail.errMsg == "getPhoneNumber:ok"){
uniCloud.callFunction({ uniCloud.callFunction({
name: "uni-id-cf", name: "uni-id-cf",
data: { data: {
......
{ {
"name" : "uni-starter", "name": "uni-starter",
"appid" : "__UNI__EC87F46", "appid": "请点击重新获取",
"description" : "", "description": "",
"versionName" : "1.0.0", "versionName": "1.0.0",
"versionCode" : "100", "versionCode": "100",
"transformPx" : false, "transformPx": false,
/* 5+App特有相关 */ "app-plus": {
"app-plus" : { "usingComponents": true,
"usingComponents" : true, "nvueStyleCompiler": "uni-app",
"nvueStyleCompiler" : "uni-app", "compilerVersion": 3,
"compilerVersion" : 3, "splashscreen": {
"splashscreen" : { "alwaysShowBeforeRender": true,
"alwaysShowBeforeRender" : true, "waiting": true,
"waiting" : true, "autoclose": true,
"autoclose" : true, "delay": 0
"delay" : 0
}, },
/* 模块配置 */ "modules": {
"modules" : {}, },
/* 应用发布信息 */ "distribute": {
"distribute" : { "android": {
/* android打包配置 */ "permissions": [
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
...@@ -40,33 +37,38 @@ ...@@ -40,33 +37,38 @@
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ]
}, },
/* ios打包配置 */ "ios": {
"ios" : {}, },
/* SDK配置 */ "sdkConfigs": {
"sdkConfigs" : {} }
} }
}, },
/* 快应用特有相关 */ "quickapp": {
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
}, },
"usingComponents" : true "mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false
},
"usingComponents": true,
"permission": {
"scope.userLocation": {
"desc": "用于提供应用算法支持"
}
}
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true "usingComponents": true
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true "usingComponents": true
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true "usingComponents": true
}, },
"uniStatistics" : { "uniStatistics": {
"enable" : false "enable": false
}, },
"vueVersion" : "2" "vueVersion": "2",
"_spaceID": ""
} }
\ No newline at end of file
{ {
"id": "uni-starter", "id": "uni-starter",
"displayName": "uni-starter", "displayName": "uni-starter",
"version": "1.2.6", "version": "1.2.7",
"description": "云端一体应用快速开发基本项目模版", "description": "云端一体应用快速开发基本项目模版",
"keywords": [ "keywords": [
"login", "login",
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
"HBuilderX": "^3.2.6" "HBuilderX": "^3.2.6"
}, },
"dcloudext": { "dcloudext": {
"category": [
"uniCloud",
"云端一体项目模板"
],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -35,7 +31,8 @@ ...@@ -35,7 +31,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "" "npmurl": "",
"type": "unicloud-template-project"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [ "dependencies": [
......
// "文件路径" : {"键名":"改成什么"} // "文件路径" : {"键名":"改成什么"}
{ {
"/manifest.json": { "/manifest.json": {
"appid": "请点击重新获取" ,//清空appid "appid": "请点击重新获取",
"mp-weixin" : { "mp-weixin" : {
"appid" : "" "appid" : ""
}, },
......
//脚本文件目录 __dirname //脚本文件目录 __dirname
//运行脚本的目录,即:项目的目录 process.cwd() //运行脚本的目录,即:项目的目录 process.cwd()
//配置文件 //配置文件
const fs = require('fs'), const fs = require('fs'),
Hjson = require('hjson'), Hjson = require('hjson'),
config = Hjson.rt.parse(fs.readFileSync(__dirname+'/config.js', 'utf-8')) config = Hjson.rt.parse(fs.readFileSync(__dirname+'/config.js', 'utf-8'))
const change_after = require('./change_after')
const change_after = require('./change_after')
if(process.argv[2] == 'change'){ if(process.argv[2] == 'change'){
change(config,()=>{ change(config,()=>{
console.log('脚本change已经执行成功'); console.log('脚本change已经执行成功');
...@@ -26,7 +26,7 @@ function change(config,callback){ ...@@ -26,7 +26,7 @@ function change(config,callback){
//保持原文件名先备份一份到/uni_modules_tools/copy目录下,然后再覆盖 //保持原文件名先备份一份到/uni_modules_tools/copy目录下,然后再覆盖
writeFileRecursive(copyPath, fileText, function(err) { //创建目录并写入文件 writeFileRecursive(copyPath, fileText, function(err) { //创建目录并写入文件
if (err) { if (err) {
return console.log(err); return console.log({err});
} }
//改写 //改写
let HfileObj = Hjson.rt.parse(fileText) let HfileObj = Hjson.rt.parse(fileText)
...@@ -56,11 +56,9 @@ function change(config,callback){ ...@@ -56,11 +56,9 @@ function change(config,callback){
function recovery(){ function recovery(){
let paths = Object.keys(config) let paths = Object.keys(config)
console.log(paths);
paths.forEach(path=>{ paths.forEach(path=>{
console.log(__dirname + '/copy' + path); console.log(__dirname + '/copy' + path);
let oldFile = fs.readFileSync(__dirname + '/copy' + path) let oldFile = fs.readFileSync(__dirname + '/copy' + path)
console.log(process.cwd() + path);
fs.writeFile(process.cwd() + path, oldFile, function(err) { fs.writeFile(process.cwd() + path, oldFile, function(err) {
if (err) { if (err) {
console.log(err); console.log(err);
...@@ -94,9 +92,15 @@ function writeFileRecursive(path, buffer, callback) { ...@@ -94,9 +92,15 @@ function writeFileRecursive(path, buffer, callback) {
function mergeJSON(minor, main) { function mergeJSON(minor, main) {
for (var key in main) { for (var key in main) {
if (typeof(main[key]) != 'object' ) { if (typeof(main[key]) != 'object' ) {
console.log({key,main});
minor[key] = main[key]; minor[key] = main[key];
}else{ }else{
console.log(9999,{minor,key,main});
if(minor){
mergeJSON(minor[key], main[key]); mergeJSON(minor[key], main[key]);
}else{
console.log(minor,'不存在:'+key);
}
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册