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,17 +34,15 @@ App({ ...@@ -33,17 +34,15 @@ App({
appId: _this.globalData.appId appId: _this.globalData.appId
}).then(res => { }).then(res => {
wx.$authStatus = res.code != 0 wx.$authStatus = res.code != 0
util.setSessionId(res.data.sessionId)
const openId = res.data.openId
wechantApi.getUserInfo({
openId
}).then(result => {
if (returnResponse) { if (returnResponse) {
console.log(res,' ====') console.log(res,' ====')
resolve(res) resolve(res)
} else { } else {
util.setSessionId(res.data.sessionId)
const openId = res.data.openId
if(openId) {
// ...
// wx.$util.setUserInfo(data)
// return
}
if (res.code != -1) { if (res.code != -1) {
if (res.code == 0) { if (res.code == 0) {
util.setUserInfo(res.data) util.setUserInfo(res.data)
...@@ -54,6 +53,8 @@ App({ ...@@ -54,6 +53,8 @@ App({
} }
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!