优化代码

This commit is contained in:
java110 2021-11-03 23:56:41 +08:00
parent 9715b2a317
commit 6ec55159da
3 changed files with 29 additions and 11 deletions

View File

@ -24,9 +24,17 @@ export function getCurOwner() {
if (_ownerInfo) {
resolve(_ownerInfo);
} else {
//查询用户信息
let _userInfo = wx.getStorageSync(mapping.USER_INFO);
if(!_userInfo){
reject();
return ;
}
request({
url: url.queryAppUserBindingOwner,
data: {},
data: {
openId:JSON.parse(_userInfo).openId
},
success: function(res) {
let _json = res.data;
if (_json.code == 0) {

View File

@ -11,7 +11,7 @@ class AppConstant {
* 应用信息主要是用来和后端服务交互时的时候用
*/
// #ifdef MP-WEIXIN
static appId = "992020061452450002";
static appId = "992019111758490006";
static appSecurity = "";
// #endif

View File

@ -65,14 +65,22 @@
//app
const app = getApp().globalData;
import conf from '../../conf/config.js';
import {getHcCode} from '../../api/webView/webViewApi.js'
import {encodeUrl} from '../../utils/UrlUtil.js'
import {getCurCommunity} from '../../api/community/communityApi.js'
import {setStorageSync} from '../../utils/StorageUtil.js'
import {
getHcCode
} from '../../api/webView/webViewApi.js'
import {
encodeUrl
} from '../../utils/UrlUtil.js'
import {
getCurCommunity
} from '../../api/community/communityApi.js'
import {
setStorageSync
} from '../../utils/StorageUtil.js'
import mapping from '../../constant/MappingConstant.js'
export default {
data() {
@ -148,6 +156,8 @@
showLongModel: function() {
this.vc.navigateTo({
url: '../login/login'
}, () => {
this.refreshPageLoginInfo();
});
},
ckeckUserInfo: function() {
@ -184,7 +194,7 @@
});
},
//
myServices: function(){
myServices: function() {
if (!this.ckeckUserInfo()) {
this.vc.navigateTo({
url: '../showlogin/showlogin'