Commit eb26f476 by LJM

js

parent 0f39f6a6
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="home-index"> <view class="home-index">
<view class="head"> <view class="head">
<!-- 未登录 --> <!-- 未登录 -->
<navigator class="row verCenter box" v-if="!is_login" url="/pages/mine/login" hover-class="none"> <navigator class="row verCenter box" v-if="!is_login" url="/pages/mine/auth" hover-class="none">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing"></text> <text class="iconfont icon-juxing"></text>
<text class="t1">未登录</text> <text class="t1">未登录</text>
......
...@@ -26,22 +26,42 @@ export default { ...@@ -26,22 +26,42 @@ export default {
methods: { methods: {
getCode() { getCode() {
var self = this; var self = this;
uni.login({ const sinfo = uni.getSystemInfoSync();
scopes: 'auth_user', if (sinfo.environment == 'wxwork') {
success: function(res) { //企业微信端
if (res.code) { wx.qy.login({
self.code = res.code; scopes: 'auth_user',
console.log(res.code); success: function(res) {
if (res.code) {
self.code = res.code;
}
},
fail: function(res) {
uni.showToast({
title: '授权失败',
icon: 'none',
duration: 2000
});
} }
}, });
fail: function(res) { } else {
uni.showToast({ //微信端逻辑处理
title: '授权失败', uni.login({
icon: 'none', scopes: 'auth_user',
duration: 2000 success: function(res) {
}); if (res.code) {
} self.code = res.code;
}); }
},
fail: function(res) {
uni.showToast({
title: '授权失败',
icon: 'none',
duration: 2000
});
}
});
}
}, },
getUserProfileChange() { getUserProfileChange() {
let self = this; let self = this;
......
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
}, },
toUrl() { toUrl() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/mine/login' url: '/pages/mine/auth'
}); });
}, },
exit() { exit() {
......
//const API_BASE = 'https://api.ichunt.com'; const API_BASE = 'https://api.ichunt.com';
const API_BASE = 'http://api.liexin.com'; //const API_BASE = 'http://api.liexin.com';
const API = { const API = {
/** /**
* 上传数据 * 上传数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment