优化小程序 绑定问题

This commit is contained in:
java110 2020-06-07 22:43:02 +08:00
parent bd9e1a13fa
commit 02cacb9729
8 changed files with 26 additions and 18 deletions

View File

@ -41,7 +41,7 @@
"window": { "window": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#00AA00", "navigationBarBackgroundColor": "#00AA00",
"navigationBarTitleText": "HC智慧小区" "navigationBarTitleText": "融生活智慧社区"
}, },
"tabBar": { "tabBar": {
"color": "#272636", "color": "#272636",

View File

@ -7,9 +7,9 @@
// 服务器域名 // 服务器域名
const baseUrl = 'https://app.demo.winqi.cn/'; const baseUrl = 'https://xq.rshenstar.com/';
//const baseUrl = 'http://hc.demo.winqi.cn:8012/'; //const baseUrl = 'http://hc.demo.winqi.cn:8012/';
const hcBaseUrl = 'https://hc.demo.winqi.cn'; const hcBaseUrl = 'https://xq.rshenstar.com';
//获取环境 //获取环境
const getEnv = baseUrl + 'app/env/getEnv'; const getEnv = baseUrl + 'app/env/getEnv';

View File

@ -14,18 +14,18 @@ const factory = require('../factory/index.js');
* 获取请后台服务时的头信息 * 获取请后台服务时的头信息
*/ */
const getHeaders = function() { const getHeaders = function() {
let _userInfo = getUserInfo(); //let _userInfo = getUserInfo();
let userId = '-1'; let userId = '-1';
if (_userInfo != null || _userInfo != undefined){ //if (_userInfo != null || _userInfo != undefined){
userId = _userInfo.userId; // userId = _userInfo.userId;
} //}
return { return {
app_id: constant.app.appId, 'app-id': constant.app.appId,
transaction_id: util.core.wxuuid(), 'transaction-id': util.core.wxuuid(),
req_time: util.date.getDateYYYYMMDDHHMISS(), 'req-time': util.date.getDateYYYYMMDDHHMISS(),
sign: '1234567', 'sign': '1234567',
user_id: userId, 'user-id': userId,
cookie: '_java110_token_=' + wx.getStorageSync('token') 'cookie': '_java110_token_=' + wx.getStorageSync('token')
} }
} }
/** /**

View File

@ -77,7 +77,7 @@ class LoginFactory {
url: constant.url.loginUrl, url: constant.url.loginUrl,
method: 'post', method: 'post',
header: { header: {
APP_ID: constant.app.appId 'APP-ID': constant.app.appId
}, },
data: { data: {
code: loginRes.code, // 临时登录凭证 code: loginRes.code, // 临时登录凭证

View File

@ -207,9 +207,17 @@ Page({
wx.showLoading({ wx.showLoading({
title: '绑定中', title: '绑定中',
}); });
let _userInfo = context.getUserInfo();
let userId = '-1';
if (_userInfo != null && _userInfo != undefined) {
userId = _userInfo.userId;
}
let _header = context.getHeaders();
_header['user-id'] = userId;
context.request({ context.request({
url: constant.url.appUserBindingOwner, url: constant.url.appUserBindingOwner,
header: context.getHeaders(), header: _header,
method: "POST", method: "POST",
data: obj, //动态数据 data: obj, //动态数据
success: function(res) { success: function(res) {

View File

@ -1,5 +1,5 @@
{ {
"navigationBarTitleText": "HC智慧家园", "navigationBarTitleText": "融生活智慧社区",
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"usingComponents": {} "usingComponents": {}
} }

View File

@ -3,7 +3,7 @@
<view> <view>
<van-notice-bar <van-notice-bar
left-icon="volume-o" left-icon="volume-o"
text="HC智慧家园是免费开源的HC小区管理系统的分支项目欢迎访问官网http://homecommunity.cn了解" text="融生活智慧社区欢迎您"
speed="30" speed="30"
/> />
</view> </view>

View File

@ -29,7 +29,7 @@
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.9.4", "libVersion": "2.9.4",
"isGameTourist": false, "isGameTourist": false,
"appid": "wxf83d66b0e9f5964d", "appid": "wxfecd955f5ce1bb20",
"projectname": "WechatOwnerService", "projectname": "WechatOwnerService",
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},