diff --git a/yudao-ui-app/api/user.js b/yudao-ui-app/api/user.js index 4a4c187b3..952e7788f 100644 --- a/yudao-ui-app/api/user.js +++ b/yudao-ui-app/api/user.js @@ -2,7 +2,7 @@ import request from "@/utils/request.js"; import Cache from "@/utils/cache.js" /** * 获取用户信息 - * + * */ export function getUserInfo(){ return request.get('user'); @@ -10,7 +10,7 @@ export function getUserInfo(){ /** * 设置用户分享 - * + * */ export function userShare(){ return request.post('user/share'); @@ -21,7 +21,7 @@ export function userShare(){ * @param data object 用户账号密码 */ export function loginH5(data) { - return request.post("login", data, { noAuth : true }); + return request.post("member/auth/login", data, { noAuth : true }); } /** @@ -29,7 +29,7 @@ export function loginH5(data) { * @param data object 用户手机号 也只能 */ export function loginMobile(data) { - return request.post("login/mobile", data, { noAuth : true }); + return request.post("member/auth/sms-login", data, { noAuth : true }); } /** @@ -44,7 +44,7 @@ export function getCodeApi() { * @param data object 用户手机号 */ export function registerVerify(phone){ - return request.post('sendCode', { phone: phone },{noAuth:true},1) + return request.post('member/auth/send-sms-code', { mobile: phone, scene: 4 },{noAuth:true},1) } /** @@ -52,7 +52,7 @@ export function registerVerify(phone){ * @param data object 用户手机号 验证码 密码 */ export function register(data) { - return request.post("register", data, { noAuth : true }); + return request.post("member/auth/register", data, { noAuth : true }); } /** @@ -80,7 +80,7 @@ export function postSignUser(sign) { /** * 获取签到配置 - * + * */ export function getSignConfig(){ return request.get('user/sign/config') @@ -104,7 +104,7 @@ export function setSignIntegral(){ /** * 签到列表(年月) * @param object data - * + * */ export function getSignMonthList(data){ return request.get('user/sign/month',data) @@ -112,7 +112,7 @@ export function getSignMonthList(data){ /** * 活动状态 - * + * */ export function userActivity(){ return request.get('user/activity'); @@ -133,7 +133,7 @@ export function getRecordApi(q) { } /* - * 提现总金额 + * 提现总金额 * */ export function getCountApi() { return request.get("extract/totalMoney"); @@ -148,7 +148,7 @@ export function getIntegralList(q) { /** * 获取分销海报图片 - * + * */ export function spreadBanner(data){ return request.get('user/spread/banner',data); @@ -164,7 +164,7 @@ export function spreadPeople(data){ } /** - * + * * 推广佣金/提现总和 * @param int type */ @@ -181,7 +181,7 @@ export function getSpreadInfo() { /** - * + * * 推广订单 * @param object data */ @@ -213,7 +213,7 @@ export function extractCash(data){ /** * 提现银行/提现最低金额 - * + * */ export function extractBank(){ return request.get('extract/bank'); @@ -221,7 +221,7 @@ export function extractBank(){ /** * 会员等级列表 - * + * */ export function userLevelGrade(){ return request.get('user/level/grade'); @@ -237,14 +237,14 @@ export function userLevelTask(id){ /** * 检查用户是否可以成为会员 - * + * */ export function userLevelDetection(){ return request.get('user/level/detection'); } /** - * + * * 地址列表 * @param object data */ @@ -271,7 +271,7 @@ export function editAddress(data){ /** * 删除地址 * @param int id - * + * */ export function delAddress(id){ return request.post('address/del',{id:id}) @@ -279,7 +279,7 @@ export function delAddress(id){ /** * 获取单个地址 - * @param int id + * @param int id */ export function getAddressDetail(id){ return request.get('address/detail/'+id); @@ -301,7 +301,7 @@ export function getLogout() { } /** * 小程序充值 - * + * */ export function rechargeRoutine(data){ return request.post('recharge/routine',data) @@ -329,7 +329,7 @@ export function transferIn(data) { /** * 获取默认地址 - * + * */ export function getAddressDefault(){ return request.get('address/default'); @@ -374,7 +374,7 @@ export function spread(puid) /** * 当前用户在佣金排行第几名 - * + * */ export function brokerageRankNumber(data) { @@ -383,7 +383,7 @@ export function brokerageRankNumber(data) /** * 会员等级经验值; - * + * */ export function getlevelInfo() { @@ -392,7 +392,7 @@ export function getlevelInfo() /** * 经验值明细; - * + * */ export function getlevelExpList(data) { @@ -401,7 +401,7 @@ export function getlevelExpList(data) /** * 经验值明细; - * + * */ export function getuserDalance() { @@ -411,7 +411,7 @@ export function getuserDalance() /** * 账单记录; - * + * */ export function getBillList(data) { @@ -457,4 +457,4 @@ export function computeUser(){ dataType:'json', success: (res) => {} }); -} \ No newline at end of file +} diff --git a/yudao-ui-app/config/app.js b/yudao-ui-app/config/app.js index 3091c9549..bfe2ed9c4 100644 --- a/yudao-ui-app/config/app.js +++ b/yudao-ui-app/config/app.js @@ -13,9 +13,9 @@ module.exports = { // http://api.java.crmeb.net:20001 HTTP_REQUEST_URL:domain, // #endif - + HEADER:{ - 'content-type': 'application/json' + 'content-type': 'application/json', }, HEADERPARAMS:{ 'content-type': 'application/x-www-form-urlencoded' diff --git a/yudao-ui-app/pages.json b/yudao-ui-app/pages.json index 50af35ee4..f7ff0d994 100644 --- a/yudao-ui-app/pages.json +++ b/yudao-ui-app/pages.json @@ -386,7 +386,14 @@ "navigationBarTitleText": "绑定手机号", "navigationStyle": "custom" } - } + }, + { + "path": "register/index", + "style": { + "navigationBarTitleText": "注册", + "navigationStyle": "custom" + } + } ] }, { diff --git a/yudao-ui-app/pages/users/login/index.vue b/yudao-ui-app/pages/users/login/index.vue index 7b2753ebd..fefa2b9e2 100644 --- a/yudao-ui-app/pages/users/login/index.vue +++ b/yudao-ui-app/pages/users/login/index.vue @@ -11,7 +11,7 @@
- +
@@ -26,7 +26,7 @@
- +
@@ -49,6 +49,7 @@
登录
登录
+
注册账号
快速登录
账号登录
@@ -91,7 +92,7 @@ return { navList: ["快速登录", "账号登录"], current: 1, - account: "", + mobile: "", password: "", captcha: "", formItem: 1, @@ -136,7 +137,7 @@ // 苹果登录 appleLogin() { let self = this - this.account = '' + this.mobile = '' this.captcha = '' uni.showLoading({ title: '登录中' @@ -200,7 +201,7 @@ // App微信登录 wxLogin() { let self = this - this.account = '' + this.mobile = '' this.captcha = '' uni.showLoading({ title: '登录中' @@ -278,10 +279,10 @@ }, async loginMobile() { let that = this; - if (!that.account) return that.$util.Tips({ + if (!that.mobile) return that.$util.Tips({ title: '请填写手机号码' }); - if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({ + if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.mobile)) return that.$util.Tips({ title: '请输入正确的手机号码' }); if (!that.captcha) return that.$util.Tips({ @@ -291,8 +292,8 @@ title: '请输入正确的验证码' }); loginMobile({ - phone: that.account, - captcha: that.captcha, + mobile: that.mobile, + code: that.captcha, spread_spid: that.$Cache.get("spread") }) .then(res => { @@ -310,11 +311,12 @@ }); }, async register() { + let that = this; - if (!that.account) return that.$util.Tips({ + if (!that.mobile) return that.$util.Tips({ title: '请填写手机号码' }); - if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({ + if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.mobile)) return that.$util.Tips({ title: '请输入正确的手机号码' }); if (!that.captcha) return that.$util.Tips({ @@ -330,7 +332,7 @@ title: '您输入的密码过于简单' }); register({ - account: that.account, + mobile: that.mobile, captcha: that.captcha, password: that.password, spread: that.$Cache.get("spread") @@ -347,16 +349,21 @@ }); }); }, + jumpRegister(){ + uni.navigateTo({ + url: '/pages/users/register/index' + }) + }, async code() { let that = this; - if (!that.account) return that.$util.Tips({ + if (!that.mobile) return that.$util.Tips({ title: '请填写手机号码' }); - if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({ + if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.mobile)) return that.$util.Tips({ title: '请输入正确的手机号码' }); if (that.formItem == 2) that.type = "register"; - await registerVerify(that.account) + await registerVerify(that.mobile) .then(res => { that.$util.Tips({title:res.message}); that.sendCode(); @@ -372,17 +379,17 @@ }, async submit() { let that = this; - if (!that.account) return that.$util.Tips({ + if (!that.mobile) return that.$util.Tips({ title: '请填写账号' }); - if (!/^[\w\d]{5,16}$/i.test(that.account)) return that.$util.Tips({ + if (!/^[\w\d]{5,16}$/i.test(that.mobile)) return that.$util.Tips({ title: '请输入正确的账号' }); if (!that.password) return that.$util.Tips({ title: '请填写密码' }); loginH5({ - account: that.account, + mobile: that.mobile, password: that.password, spread: that.$Cache.get("spread") }) @@ -392,7 +399,7 @@ this.$store.commit("LOGIN", { 'token': data.token }); - that.getUserInfo(data); + that.getUserInfo(data); }) .catch(e => { that.$util.Tips({ @@ -422,31 +429,31 @@ } .appLogin { margin-top: 60rpx; - + .hds { display: flex; justify-content: center; align-items: center; font-size: 24rpx; color: #B4B4B4; - + .line { width: 68rpx; height: 1rpx; background: #CCCCCC; } - + p { margin: 0 20rpx; } } - + .btn-wrapper { display: flex; align-items: center; justify-content: center; margin-top: 30rpx; - + .btn { display: flex; align-items: center; @@ -455,7 +462,7 @@ height: 68rpx; border-radius: 50%; } - + .apple-btn { display: flex; align-items: center; @@ -464,85 +471,85 @@ background: #000; border-radius: 34rpx; font-size: 40rpx; - + .icon-s-pingguo { color: #fff; font-size: 40rpx; } } - + .iconfont { font-size: 40rpx; color: #fff; } - + .wx { margin-right: 30rpx; background-color: #61C64F; } - + .mima { background-color: #28B3E9; } - + .yanzheng { background-color: #F89C23; } - + } } - + .code img { width: 100%; height: 100%; } - + .acea-row.row-middle { input { margin-left: 20rpx; display: block; } } - + .login-wrapper { padding: 30rpx; - + .shading { display: flex; align-items: center; justify-content: center; width: 100%; - + /* #ifdef APP-VUE */ margin-top: 50rpx; /* #endif */ /* #ifndef APP-VUE */ - + margin-top: 200rpx; /* #endif */ - - + + image { width: 180rpx; height: 180rpx; } } - + .whiteBg { margin-top: 100rpx; - + .list { border-radius: 16rpx; overflow: hidden; - + .item { border-bottom: 1px solid #F0F0F0; background: #fff; - + .row-middle { position: relative; padding: 16rpx 45rpx; - + .texts{ flex: 1; font-size: 28rpx; @@ -552,7 +559,7 @@ justify-content: center; align-items: center; } - + input { flex: 1; font-size: 28rpx; @@ -562,7 +569,7 @@ justify-content: center; align-items: center; } - + .code { position: absolute; right: 30rpx; @@ -574,7 +581,7 @@ } } } - + .logon { display: flex; align-items: center; @@ -587,7 +594,7 @@ color: #FFFFFF; font-size: 30rpx; } - + .tips { margin: 30rpx; text-align: center; @@ -596,3 +603,4 @@ } } + diff --git a/yudao-ui-app/pages/users/register/index.vue b/yudao-ui-app/pages/users/register/index.vue new file mode 100644 index 000000000..393ed9547 --- /dev/null +++ b/yudao-ui-app/pages/users/register/index.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/yudao-ui-app/utils/request.js b/yudao-ui-app/utils/request.js index dd0ab3532..7442ce60f 100644 --- a/yudao-ui-app/utils/request.js +++ b/yudao-ui-app/utils/request.js @@ -19,9 +19,10 @@ function baseRequest(url, method, data, { noVerify = false }, params) { let Url = HTTP_REQUEST_URL,header = HEADER - if (params != undefined) { - header = HEADERPARAMS; - } + // if (params != undefined) { + // header = HEADERPARAMS; + // } + header['tenant-id'] = 1 if (!noAuth) { //登录过期自动登录 if (!store.state.app.token && !checkLogin()) { @@ -34,20 +35,20 @@ function baseRequest(url, method, data, { if (store.state.app.token) header[TOKENNAME] = store.state.app.token; return new Promise((reslove, reject) => { uni.request({ - url: Url + '/api/front/' + url, + url: Url + '/app-api/' + url, method: method || 'GET', header: header, data: data || {}, success: (res) => { if (noVerify) reslove(res.data, res); - else if (res.data.code == 200) + else if (res.data.code == 0) reslove(res.data, res); else if ([410000, 410001, 410002, 401].indexOf(res.data.code) !== -1) { toLogin(); reject(res.data); } else - reject(res.data.message || '系统错误'); + reject(res.data.msg || '系统错误'); }, fail: (msg) => { reject('请求失败');