Commit 3ded0136 sunneyouyang

update

1 个父辈 a79091bf
......@@ -2,8 +2,8 @@
"name" : "金球体育",
"appid" : "__UNI__E81960F",
"description" : "金球体育",
"versionName" : "1.0.0",
"versionCode" : "100",
"versionName" : "1.0.2",
"versionCode" : 102,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......@@ -17,7 +17,9 @@
"delay" : 0
},
/* 模块配置 */
"modules" : {},
"modules" : {
"OAuth" : {}
},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
......@@ -41,9 +43,48 @@
]
},
/* ios打包配置 */
"ios" : {},
"ios" : {
"dSYMs" : false
},
/* SDK配置 */
"sdkConfigs" : {}
"sdkConfigs" : {
"ad" : {},
"oauth" : {
"apple" : {}
}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
}
},
/* 快应用特有相关 */
......
......@@ -106,6 +106,15 @@
}
}
,{
"path" : "pages/login_apple/login_apple",
"style" :
{
"navigationBarTitleText": "登陆/注册",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",
......
<template>
<div class="container">
<h3>登陆</h3>
<button @click="appleLogin">使用苹果账号登陆</button>
</div>
</template>
<script>
import {
transformImageCodeToUri
} from "@/utils/image_utils.js";
import {
default as http
} from "@/utils/http.js";
import loginHelper from "../../utils/loginHelper.js";
export default {
methods: {
async appleLogin() {
console.info(`begin appleLogin`);
uni.login({
provider: 'apple',
success: async function(loginRes) {
// 登录成功
uni.getUserInfo({
provider: 'apple',
success:async function(info) {
// 获取用户信息成功, info.authResult中保存登录认证数据
console.info(`get user info success:`, info);
// 登陆成功,发送token给服务端进行验证
// this.$http.post('/api/apple-login', {
// token: response.token
// }).then((response) => {
// // 处理服务端返回的登陆信息
// })
try{
let query_data = `mutation{
ydn_apple_login(open_id:${JSON.stringify(info.userInfo.openId)},token:${JSON.stringify(info.userInfo.identityToken)},authorization_code:${JSON.stringify(info.userInfo.authorizationCode)})
}`;
console.info(`begin query data:`,query_data);
let result = await http.gql({
query: query_data
})
this.loginBtnLoading = false;
console.info(`ydn_apple_login result `,result);
if (result && result.data && result.data.ydn_apple_login) {
if (!result.data.ydn_apple_login.Error) {
result.data.ydn_apple_login.Result.FaceImageCode = transformImageCodeToUri(result.data.ydn_apple_login
.Result
.FaceImageCode);
loginHelper.login(result.data.ydn_apple_login.Result , result.data.ydn_apple_login.AppToken)
console.log("login")
uni.navigateBack();
return
} else {
uni.showToast({
icon: "none",
title: result.data.ydn_apple_login.Error,
});
}
} else {
uni.showToast({
icon: "none",
title: "登录异常",
});
return;
}
}catch(e){
console.info(e);
}
}
})
},
fail: function(err) {
// 登录授权失败
// err.code错误码参考`授权失败错误码(code)说明`
console.info(`get user info error:`, err);
}
});
}
}
}
</script>
<style lang="scss" scoped>
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
</style>
\ No newline at end of file
<template>
<view style="background-color: #F5F7FC; justify-content: center; height: 100vh; align-items: center;">
<view class="qh-u-header">
<view>
<text class="qh-u-title">我的</text>
<text >设置</text>
<view class="qh-u-header">
<view>
<text class="qh-u-title">我的</text>
<text >设置</text>
</view>
<view
......@@ -25,7 +25,7 @@
</view>
</view>
</view>
</view>
</view>
......@@ -37,14 +37,14 @@
import loginHelper from "../../utils/loginHelper.js"
import {
default as app_config
} from '../../utils/app.js';
} from '../../utils/app.js';
export default {
data() {
return {
common,
hasLogin : false ,
userName : "",
common,
hasLogin : false ,
userName : "",
headIcon : loginHelper.defaultHeadIcon ,
buttonRect: {},
weixin: "ydnkf002"
......@@ -53,9 +53,17 @@
methods: {
async bindLogin() {
if (!loginHelper.hasLogin()) {
uni.navigateTo({
url: "/pages/login_pwd/login_pwd",
});
let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'ios') {
// 在iOS操作系统中
uni.navigateTo({
url: "/pages/login_apple/login_apple",
});
}else{
uni.navigateTo({
url: "/pages/login_pwd/login_pwd",
});
}
}
},
async gotoSuggest() {
......@@ -150,16 +158,16 @@
},
onShow: function() {
var userInfo = loginHelper.getUserInfo()
if (userInfo) {
this.headIcon = userInfo.FaceImageCode
if (userInfo) {
this.headIcon = userInfo.FaceImageCode
this.userName = userInfo.NickName
} else {
} else {
this.headIcon = loginHelper.getDefaultHeadIcon()
loginHelper.logout();
}
this.hasLogin = loginHelper.hasLogin()
if(common.info_config && common.info_config.me_help_note) {
this.weixin = common.info_config.me_help_note.weixin
}
this.hasLogin = loginHelper.hasLogin()
if(common.info_config && common.info_config.me_help_note) {
this.weixin = common.info_config.me_help_note.weixin
}
console.log("onShow:" + this.weixin + "-" + JSON.stringify(userInfo))
}
......@@ -215,4 +223,4 @@
font-size: 25rpx;
color: blue;
}
</style>
</style>
......@@ -8,7 +8,8 @@ export default {
ppolicy_app : 'http://www.qianhaiyilan.cn/ppolicy_jqty.html' ,// 隐私政策
ppolicy_user : 'http://www.qianhaiyilan.cn/ppolicy_jqty.html' , // 用户协议
server_url: {
app_host: "http://81.71.82.24/",
// app_host: "http://192.168.2.146:3000/",
app_host: "https://m.caiminbao.com/",
// 192.168.1.97
//app_host:"http://192.168.1.97:4000/",
},
......
......@@ -14,6 +14,7 @@ const http = {
if(!token){
delete header.Cookie;
}
console.info(`http grqphql post: ${app_config.server_url.app_host}graphql`);
uni.request({
url: `${app_config.server_url.app_host}graphql`,
method:"POST",
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!