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,12 +26,31 @@ export default { ...@@ -26,12 +26,31 @@ export default {
methods: { methods: {
getCode() { getCode() {
var self = this; var self = this;
const sinfo = uni.getSystemInfoSync();
if (sinfo.environment == 'wxwork') {
//企业微信端
wx.qy.login({
scopes: 'auth_user',
success: function(res) {
if (res.code) {
self.code = res.code;
}
},
fail: function(res) {
uni.showToast({
title: '授权失败',
icon: 'none',
duration: 2000
});
}
});
} else {
//微信端逻辑处理
uni.login({ uni.login({
scopes: 'auth_user', scopes: 'auth_user',
success: function(res) { success: function(res) {
if (res.code) { if (res.code) {
self.code = res.code; self.code = res.code;
console.log(res.code);
} }
}, },
fail: function(res) { fail: function(res) {
...@@ -42,6 +61,7 @@ export default { ...@@ -42,6 +61,7 @@ export default {
}); });
} }
}); });
}
}, },
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