From ba1a5ef6c8f962d5b5dbd502c2f784d1c4aa0c36 Mon Sep 17 00:00:00 2001 From: 123456 Date: Fri, 27 Sep 2024 17:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- androidPrivacy.json | 28 +++++++++++ api/index.js | 45 +++++++++++++++++ api/request.js | 52 +++++++++++++++++++ manifest.json | 20 +++++++- pages/login/index.vue | 112 ++++++++++++++++++++++++++++++++++++++--- 新建文本文档.txt | 1 + 6 files changed, 250 insertions(+), 8 deletions(-) create mode 100644 androidPrivacy.json create mode 100644 api/index.js create mode 100644 api/request.js create mode 100644 新建文本文档.txt diff --git a/androidPrivacy.json b/androidPrivacy.json new file mode 100644 index 0000000..45634f3 --- /dev/null +++ b/androidPrivacy.json @@ -0,0 +1,28 @@ +{ + "version" : "1", + "prompt" : "template", + "title" : "服务协议与隐私政策", + "message" : "\t请务必审慎阅读、充分理解“服务协议与 隐私政策”各条款,包括但不限于:为了 向你提供即时通讯、内容分享等服务,我 们需要收集你的设备信息、操作日志等个 人信息。你可以在“设置”中查看、变更、删除个人信息并管理你的授权。
\r\r +\t你可以阅读 《用户协议》《隐私政策》了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。", + "buttonAccept" : "同意并接受", + "buttonRefuse" : "暂不同意", + "second" : { + "title" : "确认提示", + "message" : "进入应用前,你需先同意《用户协议》《隐私政策》,否则将退出应用。", + "buttonAccept" : "同意并继续", + "buttonRefuse" : "退出应用" + }, + "styles" : { + "backgroundColor" : "#fff", + "borderRadius" : "5px", + "title" : { + "color" : "#000" + }, + "buttonAccept" : { + "color" : "#fff" + }, + "buttonRefuse" : { + "color" : "#ccc" + } + } +} diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..7e5e830 --- /dev/null +++ b/api/index.js @@ -0,0 +1,45 @@ +import { request } from './request' +const api = { + + //发送验证码 + sendMsm(data) { + return request({ + url: 'api/sendSmsCode', + method: 'post', + data + }) + }, + //登录 + toLogin(data) { + return request({ + url: 'api/loginByCode', + method: 'post', + data + }) + }, + //授权登录 + mnpLogin(data) { + return request({ + url: 'api/Login/mnpLogin', + method: 'post', + data + }) + }, + //修改用户信息 + editMember(data) { + return request({ + url: 'api/user/profile', + method: 'post', + data + }) + }, + //用户信息 + getMemberInfo(data) { + return request({ + url: 'api/user/getinfo', + method: 'post', + data + }) + } +} +export default api \ No newline at end of file diff --git a/api/request.js b/api/request.js new file mode 100644 index 0000000..a1b63ae --- /dev/null +++ b/api/request.js @@ -0,0 +1,52 @@ +import Vue from 'vue' +let baseUrl = 'https://zhengxin.njrenzhou.cn'; +Vue.prototype.$baseUrl = baseUrl; + +export function request(prams) { + return new Promise((resolve, reject) => { + let url; + url = baseUrl+"/"+prams.url; + console.log(url) + uni.request({ + url: url, + data: prams.data, + method: prams.method, + header: { + "token": uni.getStorageSync('token'), + "Content-type": "application/x-www-form-urlencoded" + }, + success: (res) => { + if (res.data.code == 1 ){ + resolve(res.data); + }else if(res.data.code == 401){ + uni.showModal({ + title: "温馨提示", + content: "当前账号已过期,是否重新登录", + confirmColor: "#05754D", + success(res) { + uni.removeStorageSync("userInfo") + uni.removeStorageSync("token") + uni.navigateTo({ + url: "/pages/login/login" + }) + } + }) + } else { + reject(res.data); + uni.showToast({ + icon: "none", + title: res.data.msg, + duration: 3000 + }); + } + + }, + fail: (err) => { + reject(err); + }, + complete: () => { + //console.log('请求完成') + } + }); + }) +} diff --git a/manifest.json b/manifest.json index 81ab1da..d309d91 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,10 @@ "delay" : 0 }, /* 模块配置 */ - "modules" : {}, + "modules" : { + "Geolocation" : {}, + "OAuth" : {} + }, /* 应用发布信息 */ "distribute" : { /* android打包配置 */ @@ -43,7 +46,20 @@ /* ios打包配置 */ "ios" : {}, /* SDK配置 */ - "sdkConfigs" : {} + "sdkConfigs" : { + "geolocation" : { + "amap" : { + "name" : "amap_17321661234Ay6qpQnkC", + "__platform__" : [ "ios", "android" ], + "appkey_ios" : "49e860f8b39479b15db1110fb3e62286", + "appkey_android" : "d2e40f882c2fde0f3724791cb82cbd9c" + } + }, + "oauth" : {} + }, + "splashscreen" : { + "useOriginalMsgbox" : true + } } }, /* 快应用特有相关 */ diff --git a/pages/login/index.vue b/pages/login/index.vue index cfc1861..0f8738a 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -3,16 +3,16 @@ 注册账号 - + - - 获取验证码 + + {{count == 60?'获取验证码': count+'s'}} - + - 登录 + 登录 新用户注册 {{isShow?'密码登录':'验证码登录'}} @@ -31,11 +31,17 @@