Commit eb26f476 by LJM

js

parent 0f39f6a6
......@@ -2,7 +2,7 @@
<view class="home-index">
<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">
<text class="iconfont icon-juxing"></text>
<text class="t1">未登录</text>
......
......@@ -26,22 +26,42 @@ export default {
methods: {
getCode() {
var self = this;
uni.login({
scopes: 'auth_user',
success: function(res) {
if (res.code) {
self.code = res.code;
console.log(res.code);
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
});
}
},
fail: function(res) {
uni.showToast({
title: '授权失败',
icon: 'none',
duration: 2000
});
}
});
});
} else {
//微信端逻辑处理
uni.login({
scopes: 'auth_user',
success: function(res) {
if (res.code) {
self.code = res.code;
}
},
fail: function(res) {
uni.showToast({
title: '授权失败',
icon: 'none',
duration: 2000
});
}
});
}
},
getUserProfileChange() {
let self = this;
......
......@@ -49,7 +49,7 @@ export default {
},
toUrl() {
uni.navigateTo({
url: '/pages/mine/login'
url: '/pages/mine/auth'
});
},
exit() {
......
//const API_BASE = 'https://api.ichunt.com';
const API_BASE = 'http://api.liexin.com';
const API_BASE = 'https://api.ichunt.com';
//const API_BASE = 'http://api.liexin.com';
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