Commit 7210b752 by 胡悦

提交

1 parent f98bab1d
...@@ -3,7 +3,8 @@ import router from './router/index.js' ...@@ -3,7 +3,8 @@ import router from './router/index.js'
import util from './utils/util.js' import util from './utils/util.js'
import './utils/Track' import './utils/Track'
import { import {
ssoApi ssoApi,
wechantApi
} from './api/api' } from './api/api'
App({ App({
onLaunch: function () { onLaunch: function () {
...@@ -33,27 +34,27 @@ App({ ...@@ -33,27 +34,27 @@ App({
appId: _this.globalData.appId appId: _this.globalData.appId
}).then(res => { }).then(res => {
wx.$authStatus = res.code != 0 wx.$authStatus = res.code != 0
if (returnResponse) { util.setSessionId(res.data.sessionId)
console.log(res,' ====') const openId = res.data.openId
resolve(res) wechantApi.getUserInfo({
} else { openId
util.setSessionId(res.data.sessionId) }).then(result => {
const openId = res.data.openId if (returnResponse) {
if(openId) { console.log(res,' ====')
// ... resolve(res)
// wx.$util.setUserInfo(data) } else {
// return if (res.code != -1) {
} if (res.code == 0) {
if (res.code != -1) { util.setUserInfo(res.data)
if (res.code == 0) { // util.setSessionId(res.data.sessionId)
util.setUserInfo(res.data) } else {
// util.setSessionId(res.data.sessionId) util.showToast(res.message || '网络异常')
} else { }
util.showToast(res.message || '网络异常')
} }
resolve(res)
} }
resolve(res) })
}
}).catch(() => { }).catch(() => {
wx.$authStatus = true wx.$authStatus = true
reject() reject()
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
<image class="user-bg" webp src="{{IMGURL}}home/user-bg.png" /> <image class="user-bg" webp src="{{IMGURL}}home/user-bg.png" />
</view> </view>
<view class="btn-group"> <view class="btn-group">
<view class="phone-btn"> <view class="phone-btn" bindtap="callPhone">
<image class="icon-dial" webp src="{{IMGURL}}home/icon-dial.png"></image> <image class="icon-dial" webp src="{{IMGURL}}home/icon-dial.png"></image>
<view class="phone-text" bindtap="callPhone">拨打电话</view> <view class="phone-text">拨打电话</view>
</view> </view>
<button class="btn-plain btn" bindtap="addPhone">保存名片</button> <button class="btn-plain btn" bindtap="addPhone">保存名片</button>
<button class="btn-primary btn" open-type="share">分享名片</button> <button class="btn-primary btn" open-type="share">分享名片</button>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.25.4", "libVersion": "2.25.4",
"appid": "wxc0e73a3d0afbcb06", "appid": "wx5d1208f9c8712943",
"projectname": "%E5%B9%BF%E8%81%94%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%A8%A1%E7%89%88", "projectname": "%E5%B9%BF%E8%81%94%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%A8%A1%E7%89%88",
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!