注册,物流
This commit is contained in:
parent
7eebc286e4
commit
9224c8a09a
|
|
@ -104,6 +104,13 @@ namespace CoreCms.Net.IServices
|
||||||
Task<WebApiCallBack> SmsLogin(FMWxAccountCreate entity,
|
Task<WebApiCallBack> SmsLogin(FMWxAccountCreate entity,
|
||||||
int loginType = (int) GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = 1);
|
int loginType = (int) GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = 1);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手机号密码登录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity">登录实体</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<WebApiCallBack> PasswordLogin(FMPasswordLogin entity);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据条件查询分页数据
|
/// 根据条件查询分页数据
|
||||||
|
|
|
||||||
|
|
@ -30,4 +30,20 @@ namespace CoreCms.Net.Model.FromBody
|
||||||
public string password { get; set; }
|
public string password { get; set; }
|
||||||
public string repassword { get; set; }
|
public string repassword { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手机号密码登录实体
|
||||||
|
/// </summary>
|
||||||
|
public class FMPasswordLogin
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 手机号码
|
||||||
|
/// </summary>
|
||||||
|
public string mobile { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 密码
|
||||||
|
/// </summary>
|
||||||
|
public string password { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using CoreCms.Net.Configuration;
|
using CoreCms.Net.Configuration;
|
||||||
using CoreCms.Net.IRepository;
|
using CoreCms.Net.IRepository;
|
||||||
using CoreCms.Net.IRepository.UnitOfWork;
|
using CoreCms.Net.IRepository.UnitOfWork;
|
||||||
|
|
@ -21,8 +22,11 @@ using CoreCms.Net.Model.Entities;
|
||||||
using CoreCms.Net.Model.ViewModels.Api;
|
using CoreCms.Net.Model.ViewModels.Api;
|
||||||
using CoreCms.Net.Model.ViewModels.UI;
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
using CoreCms.Net.Utility.Helper;
|
using CoreCms.Net.Utility.Helper;
|
||||||
|
|
||||||
using Flurl.Http;
|
using Flurl.Http;
|
||||||
|
|
||||||
|
using Qiniu.Util;
|
||||||
|
|
||||||
|
|
||||||
namespace CoreCms.Net.Services
|
namespace CoreCms.Net.Services
|
||||||
{
|
{
|
||||||
|
|
@ -173,17 +177,23 @@ namespace CoreCms.Net.Services
|
||||||
|
|
||||||
|
|
||||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||||
var showApiAppid = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowApiAppid);
|
|
||||||
var showApiSecret = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowApiSecret);
|
var showApiSecret = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowApiSecret);
|
||||||
|
|
||||||
var showApiTimesTamp = DateTime.Now.ToString("yyyyMMddHHmmss");
|
var url = $"https://route.showapi.com/64-19?appKey={showApiSecret}";
|
||||||
|
if (phone.Length > 4)
|
||||||
|
{
|
||||||
|
phone = phone.Substring(phone.Length - 4, 4);
|
||||||
|
}
|
||||||
|
// 构建POST请求参数
|
||||||
|
var postData = new
|
||||||
|
{
|
||||||
|
com = "auto", // 固定值
|
||||||
|
nu = number, // 订单号
|
||||||
|
phone = phone // 手机尾号
|
||||||
|
};
|
||||||
|
|
||||||
var signStr = "com" + com + "nu" + number + "phone" + phone + "showapi_appid" + showApiAppid + "showapi_timestamp" + showApiTimesTamp + showApiSecret;
|
var result = await url.PostUrlEncodedAsync(postData).ReceiveJson<ShowApiGetExpressPollResult>();
|
||||||
var md5Sign = CommonHelper.Md5For32(signStr).ToLower();
|
|
||||||
|
|
||||||
var url = "https://route.showapi.com/64-19?com=" + com + "&nu=" + number + "&phone=" + phone + "&showapi_appid=" + showApiAppid +
|
|
||||||
"&showapi_timestamp=" + showApiTimesTamp + "&showapi_sign=" + md5Sign;
|
|
||||||
var result = await url.GetJsonAsync<ShowApiGetExpressPollResult>();
|
|
||||||
|
|
||||||
if (result.showapi_res_code != 0)
|
if (result.showapi_res_code != 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -641,6 +641,90 @@ namespace CoreCms.Net.Services
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 手机号密码登录
|
||||||
|
/// <summary>
|
||||||
|
/// 手机号密码登录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity">登录实体</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<WebApiCallBack> PasswordLogin(FMPasswordLogin entity)
|
||||||
|
{
|
||||||
|
var jm = new WebApiCallBack();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(entity.mobile))
|
||||||
|
{
|
||||||
|
jm.msg = "请输入手机号码";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(entity.password))
|
||||||
|
{
|
||||||
|
jm.msg = "请输入密码";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CommonHelper.IsMobile(entity.mobile))
|
||||||
|
{
|
||||||
|
jm.msg = "请输入合法的手机号码";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询用户是否存在
|
||||||
|
var userInfo = await _dal.QueryByClauseAsync(p => p.mobile == entity.mobile);
|
||||||
|
if (userInfo == null)
|
||||||
|
{
|
||||||
|
jm.msg = "用户不存在";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查用户状态
|
||||||
|
if (userInfo.status != (int)GlobalEnumVars.UserStatus.正常)
|
||||||
|
{
|
||||||
|
jm.msg = "用户账户已被禁用";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查用户是否设置了密码
|
||||||
|
if (string.IsNullOrEmpty(userInfo.passWord))
|
||||||
|
{
|
||||||
|
jm.msg = "该账户未设置密码,请使用其他方式登录";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证密码
|
||||||
|
var encryptedPassword = CommonHelper.EnPassword(entity.password, userInfo.createTime);
|
||||||
|
if (userInfo.passWord != encryptedPassword)
|
||||||
|
{
|
||||||
|
jm.msg = "密码错误";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 登录成功,生成JWT Token
|
||||||
|
var claims = new List<Claim> {
|
||||||
|
new Claim(ClaimTypes.Name, userInfo.nickName),
|
||||||
|
new Claim(JwtRegisteredClaimNames.Jti, userInfo.id.ToString()),
|
||||||
|
new Claim(ClaimTypes.Expiration, DateTime.Now.AddSeconds(_permissionRequirement.Expiration.TotalSeconds).ToString()) };
|
||||||
|
|
||||||
|
//用户标识
|
||||||
|
var identity = new ClaimsIdentity(JwtBearerDefaults.AuthenticationScheme);
|
||||||
|
identity.AddClaims(claims);
|
||||||
|
jm.status = true;
|
||||||
|
jm.msg = "登录成功";
|
||||||
|
jm.data = JwtToken.BuildJwtToken(claims.ToArray(), _permissionRequirement);
|
||||||
|
|
||||||
|
//录入登录日志
|
||||||
|
var log = new CoreCmsUserLog();
|
||||||
|
log.userId = userInfo.id;
|
||||||
|
log.state = (int)GlobalEnumVars.UserLogTypes.登录;
|
||||||
|
log.ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ?
|
||||||
|
_httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1";
|
||||||
|
log.createTime = DateTime.Now;
|
||||||
|
log.parameters = GlobalEnumVars.UserLogTypes.登录.ToString();
|
||||||
|
await _userLogServices.InsertAsync(log);
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据条件查询分页数据
|
/// 根据条件查询分页数据
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,9 @@ const install = (Vue, vm) => {
|
||||||
let syncWeChatInfo = (params = {}) => vm.$u.post('/Api/User/SyncWeChatInfo', params, { method: 'user.SyncWeChatInfo', needToken: true });
|
let syncWeChatInfo = (params = {}) => vm.$u.post('/Api/User/SyncWeChatInfo', params, { method: 'user.SyncWeChatInfo', needToken: true });
|
||||||
//小程序手机授权(拉取手机号码)
|
//小程序手机授权(拉取手机号码)
|
||||||
let loginByGetPhoneNumber = (params = {}) => vm.$u.post('/Api/User/DecryptPhoneNumber', params, { method: 'user.wxapploginByGetPhoneNumber', needToken: false });
|
let loginByGetPhoneNumber = (params = {}) => vm.$u.post('/Api/User/DecryptPhoneNumber', params, { method: 'user.wxapploginByGetPhoneNumber', needToken: false });
|
||||||
|
//账号密码登录
|
||||||
|
let loginByPassword = (params = {}) => vm.$u.post('/Api/User/PasswordLogin', params, { method: 'user.wxapploginByPassword', needToken: false });
|
||||||
|
|
||||||
//取下级地址列表
|
//取下级地址列表
|
||||||
let getAreaList = (params = {}) => vm.$u.post('/Api/Common/GetAreas', params, { method: 'user.getarealist', needToken: false });
|
let getAreaList = (params = {}) => vm.$u.post('/Api/Common/GetAreas', params, { method: 'user.getarealist', needToken: false });
|
||||||
//取搜索页推荐关键字
|
//取搜索页推荐关键字
|
||||||
|
|
@ -490,6 +493,7 @@ const install = (Vue, vm) => {
|
||||||
loginByDecodeEncryptedData,
|
loginByDecodeEncryptedData,
|
||||||
syncWeChatInfo,
|
syncWeChatInfo,
|
||||||
loginByGetPhoneNumber,
|
loginByGetPhoneNumber,
|
||||||
|
loginByPassword,
|
||||||
getAreaList,
|
getAreaList,
|
||||||
getRecommendKeys,
|
getRecommendKeys,
|
||||||
myInvite,
|
myInvite,
|
||||||
|
|
|
||||||
|
|
@ -10,20 +10,27 @@
|
||||||
<u-image width="48rpx" height="48rpx" :src="shopLogo"></u-image>
|
<u-image width="48rpx" height="48rpx" :src="shopLogo"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text class="shopName">
|
<text class="shopName">
|
||||||
{{shopName||'登录授权'}}
|
{{ shopName || '用户登录' }}
|
||||||
</text>
|
|
||||||
<text class="get">
|
|
||||||
申请
|
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="title3">获取以下权限为您提供服务</view>
|
<view class="title3">请输入您的账号密码</view>
|
||||||
<view class="desc">
|
|
||||||
1、获取你的手机号提供更好的账户安全,物流,订单状态提醒等服务(在接下来微信授权手机号的弹窗中选择“允许”)<br />
|
<!-- 登录表单 -->
|
||||||
2、使用我们的相关服务,需要将您的手机号授权给我们。
|
<view class="login-form">
|
||||||
|
<view class="form-item">
|
||||||
|
<u-input v-model="loginForm.mobile" placeholder="请输入手机号" type="number" maxlength="11"
|
||||||
|
:clearable="true" @input="onInputChange" />
|
||||||
</view>
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<u-input v-model="loginForm.password" placeholder="请输入密码" type="password"
|
||||||
|
:clearable="true" @input="onInputChange" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!--服务协议-->
|
<!--服务协议-->
|
||||||
<view class="u-margin-top-30 u-margin-bottom-30 agreement-checked-view">
|
<view class="u-margin-top-30 u-margin-bottom-30 agreement-checked-view">
|
||||||
<u-checkbox v-model="agreement" @change="checkboxChange" size="30" active-color="#19be6b"></u-checkbox>
|
<u-checkbox v-model="agreement" @change="checkboxChange" size="30"
|
||||||
|
active-color="#19be6b"></u-checkbox>
|
||||||
<view class="coreshop-text-black-view">
|
<view class="coreshop-text-black-view">
|
||||||
<text class="coreshop-text-black">同意</text>
|
<text class="coreshop-text-black">同意</text>
|
||||||
<text class="text-blue" @tap="goUserAgreementPage">《服务协议》</text>
|
<text class="text-blue" @tap="goUserAgreementPage">《服务协议》</text>
|
||||||
|
|
@ -33,9 +40,10 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-between u-padding-left-30 u-padding-right-30">
|
<view class="u-flex u-row-between u-padding-left-30 u-padding-right-30">
|
||||||
<u-button @click="closeAuth">暂不授权</u-button>
|
<u-button @click="closeAuth">取消</u-button>
|
||||||
<u-button type="success" :disabled="isDisabled" v-if="isDisabled">确定授权</u-button>
|
<u-button type="success" :disabled="isDisabled" @click="handleLogin"
|
||||||
<u-button type="success" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-else>确定授权</u-button>
|
v-if="isDisabled">登录</u-button>
|
||||||
|
<u-button type="success" @click="handleLogin" v-else>登录</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -59,6 +67,10 @@
|
||||||
return {
|
return {
|
||||||
agreement: false,
|
agreement: false,
|
||||||
isDisabled: true,
|
isDisabled: true,
|
||||||
|
loginForm: {
|
||||||
|
mobile: '',
|
||||||
|
password: ''
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -98,16 +110,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const _this = this
|
// 初始化时清空表单
|
||||||
// #ifdef MP-WEIXIN
|
this.loginForm = {
|
||||||
var userInfo = this.$store.state.userInfo;
|
mobile: '',
|
||||||
//var token = this.$db.get('userToken');
|
password: ''
|
||||||
if (Object.keys(userInfo).length != 0) {
|
};
|
||||||
console.log("获取到store.state用户数据");
|
|
||||||
} else {
|
|
||||||
_this.doToken();
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
//watch: {
|
//watch: {
|
||||||
// 'hasLogin': {
|
// 'hasLogin': {
|
||||||
|
|
@ -151,132 +158,212 @@
|
||||||
// 勾选版权协议
|
// 勾选版权协议
|
||||||
checkboxChange(e) {
|
checkboxChange(e) {
|
||||||
this.agreement = e.value;
|
this.agreement = e.value;
|
||||||
if (e.value == true) {
|
this.checkFormValid();
|
||||||
this.isDisabled = false;
|
},
|
||||||
} else {
|
|
||||||
this.isDisabled = true;
|
// 输入框内容变化时触发
|
||||||
}
|
onInputChange() {
|
||||||
console.log(this.agreement);
|
this.checkFormValid();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 检查表单是否有效
|
||||||
|
checkFormValid() {
|
||||||
|
const isValid = this.agreement &&
|
||||||
|
this.loginForm.mobile.length === 11 &&
|
||||||
|
this.loginForm.password.length >= 6;
|
||||||
|
this.isDisabled = !isValid;
|
||||||
|
return isValid;
|
||||||
},
|
},
|
||||||
// 隐藏登录弹窗
|
// 隐藏登录弹窗
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.showLogin = false;
|
this.showLogin = false;
|
||||||
},
|
},
|
||||||
// 小程序,取消登录
|
// 取消登录
|
||||||
closeAuth() {
|
closeAuth() {
|
||||||
this.showLogin = false;
|
this.showLogin = false;
|
||||||
this.$u.toast('您已取消授权')
|
this.resetForm();
|
||||||
},
|
},
|
||||||
getCode: function (callback) {
|
|
||||||
let _this = this
|
// 重置表单
|
||||||
uni.login({
|
resetForm() {
|
||||||
// #ifdef MP-ALIPAY
|
this.loginForm = {
|
||||||
scopes: 'auth_user',
|
mobile: '',
|
||||||
// #endif
|
password: ''
|
||||||
success: function (res) {
|
};
|
||||||
console.log(res);
|
this.agreement = false;
|
||||||
if (res.code) {
|
this.isDisabled = true;
|
||||||
return callback(res.code)
|
},
|
||||||
} else {
|
|
||||||
//login成功,但是没有取到code
|
// 处理登录
|
||||||
_this.$refs.uToast.show({ title: '未取得code,请重试', type: 'error', })
|
handleLogin() {
|
||||||
|
if (!this.checkFormValid()) {
|
||||||
|
this.$u.toast('请完善登录信息');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
fail: function (res) {
|
// 验证手机号格式
|
||||||
console.log(res);
|
const mobileReg = /^1[3-9]\d{9}$/;
|
||||||
_this.$refs.uToast.show({ title: '用户授权失败wx.login,请重试', type: 'error', })
|
if (!mobileReg.test(this.loginForm.mobile)) {
|
||||||
|
this.$u.toast('请输入正确的手机号');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
this.doPasswordLogin();
|
||||||
},
|
},
|
||||||
toLogin: function (data) {
|
// 密码登录
|
||||||
let _this = this
|
doPasswordLogin() {
|
||||||
_this.$u.api.loginByDecodeEncryptedData(data).then(res => {
|
const _this = this;
|
||||||
|
const data = {
|
||||||
|
mobile: this.loginForm.mobile,
|
||||||
|
password: this.loginForm.password
|
||||||
|
};
|
||||||
|
|
||||||
|
// // 显示加载状态
|
||||||
|
// this.$u.loading.show({
|
||||||
|
// title: '登录中...'
|
||||||
|
// });
|
||||||
|
|
||||||
|
this.$u.api.loginByPassword(data).then(res => {
|
||||||
|
// this.$u.loading.hide();
|
||||||
|
console.log('登录结果:', res);
|
||||||
|
|
||||||
if (res.status) {
|
if (res.status) {
|
||||||
//判断是否返回了token,如果没有,就说明没有绑定账号,跳转到绑定页面
|
if (res.data && res.data.token) {
|
||||||
if (res.data.token) {
|
// 登录成功,保存token和用户信息
|
||||||
//登陆成功,设置token,并返回上一页
|
_this.$db.set('userToken', res.data.token);
|
||||||
_this.$db.set('userToken', res.data.token)
|
|
||||||
_this.$store.commit('hasLogin', true);
|
_this.$store.commit('hasLogin', true);
|
||||||
_this.$refs.uToast.show({ title: '登录成功', type: 'success', })
|
|
||||||
return false
|
if (res.data.user) {
|
||||||
} else {
|
_this.$store.commit('userInfo', res.data.user);
|
||||||
_this.sessionAuthIdTool = res.data.sessionAuthId;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
_this.$refs.uToast.show({ title: '登录失败,请重试', type: 'error', })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async getPhoneNumber(e) {
|
|
||||||
let _this = this;
|
|
||||||
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
|
|
||||||
var data = {
|
|
||||||
sessionAuthId: _this.sessionAuthIdTool,
|
|
||||||
iv: e.mp.detail.iv,
|
|
||||||
encryptedData: e.mp.detail.encryptedData,
|
|
||||||
}
|
|
||||||
//有推荐码的话,带上
|
|
||||||
var invitecode = _this.$db.get('invitecode')
|
|
||||||
if (invitecode) {
|
|
||||||
data.invitecode = invitecode
|
|
||||||
}
|
|
||||||
_this.toGetPhoneNumber(data);
|
|
||||||
}
|
|
||||||
else if (e.mp.detail.errMsg == 'getPhoneNumber:fail user deny') {
|
|
||||||
_this.$u.toast('您已经取消了授权,将无法进行关键业务功能。');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_this.$u.toast('如未授权,您可尝试使用手机号+短信验证码登录');
|
|
||||||
}
|
|
||||||
_this.agreement = false;
|
|
||||||
_this.isDisabled = true;
|
|
||||||
_this.showLogin = false;
|
_this.showLogin = false;
|
||||||
},
|
_this.resetForm();
|
||||||
//实际的去登陆
|
_this.$refs.uToast.show({
|
||||||
toGetPhoneNumber: function (data) {
|
title: '登录成功',
|
||||||
let _this = this
|
type: 'success'
|
||||||
_this.$u.api.loginByGetPhoneNumber(data).then(res => {
|
});
|
||||||
console.log(res);
|
|
||||||
if (res.status) {
|
|
||||||
//判断是否返回了token,如果没有,就说明没有绑定账号,跳转到绑定页面
|
|
||||||
if (res.data.token) {
|
|
||||||
//console.log("登陆成功,设置token,并返回上一页");
|
|
||||||
//登陆成功,设置token,并返回上一页
|
|
||||||
_this.$db.set('userToken', res.data.token)
|
|
||||||
_this.$store.commit('hasLogin', true);
|
|
||||||
_this.showLogin = false;
|
|
||||||
_this.$refs.uToast.show({ title: '登录成功', type: 'success', })
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
} else if (res.status == false && res.code == 500) {
|
|
||||||
console.log("sessionId不正确,重载");
|
|
||||||
_this.$u.route({ type: 'switchTab', url: '/pages/index/default/default' });
|
|
||||||
} else {
|
} else {
|
||||||
_this.$u.toast('登录失败,请重试')
|
_this.$u.toast('登录失败,请检查账号密码');
|
||||||
}
|
}
|
||||||
})
|
} else {
|
||||||
|
_this.$u.toast(res.msg || '登录失败,请重试');
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
this.$u.loading.hide();
|
||||||
|
console.error('登录错误:', err);
|
||||||
|
_this.$u.toast('网络错误,请重试');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.modal-box { width: 610rpx; border-radius: 20rpx; background: #fff; position: relative; left: 50%; transform: translateX(-50%); padding: 30rpx; z-index: 11111;
|
.modal-box {
|
||||||
.head-bg { width: 100%; height: 210rpx; }
|
width: 610rpx;
|
||||||
.detail { width: 100%; text-align: center;
|
border-radius: 20rpx;
|
||||||
.title1 { color: #46351b; font-size: 35rpx; font-weight: bold; }
|
background: #fff;
|
||||||
.title2 { font-size: 28rpx; color: #999; padding-top: 20rpx; }
|
position: relative;
|
||||||
.title3 { color: #46351b; font-size: 35rpx; font-weight: bold; text-align: left; line-height: 35rpx; padding: 30rpx 0 30rpx 30rpx; }
|
left: 50%;
|
||||||
.desc { font-size: 24rpx; line-height: 40rpx; color: #333; background: #f7f8fa; text-align: left; padding: 20rpx; }
|
transform: translateX(-50%);
|
||||||
.user-avatar { width: 160rpx; height: 160rpx; overflow: hidden; margin: 0 auto; margin-bottom: 40rpx; }
|
padding: 30rpx;
|
||||||
.user-name { font-size: 35rpx; font-family: PingFang SC; font-weight: bold; color: #845708; margin-bottom: 30rpx; }
|
z-index: 11111;
|
||||||
|
|
||||||
|
.head-bg {
|
||||||
|
width: 100%;
|
||||||
|
height: 210rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.title1 {
|
||||||
|
color: #46351b;
|
||||||
|
font-size: 35rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title2 {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
padding-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title3 {
|
||||||
|
color: #46351b;
|
||||||
|
font-size: 35rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: left;
|
||||||
|
line-height: 35rpx;
|
||||||
|
padding: 30rpx 0 30rpx 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
color: #333;
|
||||||
|
background: #f7f8fa;
|
||||||
|
text-align: left;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-avatar {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 160rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-name {
|
||||||
|
font-size: 35rpx;
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #845708;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.shopDesc { padding: 30rpx 0rpx 0rpx 0rpx; text-align: left;
|
|
||||||
.shopName { margin-left: 20rpx; line-height: 40rpx; }
|
|
||||||
.get { margin-left: 20rpx; line-height: 40rpx; }
|
|
||||||
}
|
}
|
||||||
.agreement-checked-view { position: relative; padding: 18.18rpx 0rpx 18.18rpx 30rpx; display: flex; align-items: center; margin: 10rpx 0; font-size: 24rpx;
|
|
||||||
.coreshop-checked { transform: scale(0.7); }
|
.shopDesc {
|
||||||
|
padding: 30rpx 0rpx 0rpx 0rpx;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
.shopName {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.get {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-checked-view {
|
||||||
|
position: relative;
|
||||||
|
padding: 18.18rpx 0rpx 18.18rpx 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 10rpx 0;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
.coreshop-checked {
|
||||||
|
transform: scale(0.7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-form {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
|
||||||
|
.form-item {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using NPOI.HSSF.UserModel;
|
using NPOI.HSSF.UserModel;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
|
using static SKIT.FlurlHttpClient.Wechat.Api.Models.WeDataQueryBindListResponse.Types;
|
||||||
|
|
||||||
namespace CoreCms.Net.Web.Admin.Controllers
|
namespace CoreCms.Net.Web.Admin.Controllers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -410,7 +412,8 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||||
|
|
||||||
//事物处理过程开始
|
//事物处理过程开始
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(entity.passWord)) oldModel.passWord = CommonHelper.Md5For32(entity.passWord);
|
if (!string.IsNullOrEmpty(entity.passWord)) oldModel.passWord = CommonHelper.EnPassword(entity.passWord, oldModel.createTime);
|
||||||
|
//CommonHelper.Md5For32(entity.passWord);
|
||||||
oldModel.mobile = entity.mobile;
|
oldModel.mobile = entity.mobile;
|
||||||
oldModel.sex = entity.sex;
|
oldModel.sex = entity.sex;
|
||||||
oldModel.birthday = entity.birthday;
|
oldModel.birthday = entity.birthday;
|
||||||
|
|
@ -423,7 +426,6 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||||
var bl = await _coreCmsUserServices.UpdateAsync(oldModel);
|
var bl = await _coreCmsUserServices.UpdateAsync(oldModel);
|
||||||
jm.code = bl ? 0 : 1;
|
jm.code = bl ? 0 : 1;
|
||||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||||
|
|
||||||
return jm;
|
return jm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient"
|
dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient"
|
||||||
connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456"
|
connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456"
|
||||||
-->
|
-->
|
||||||
<target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=192.168.195.8;uid=sa;pwd=Dbt@com@123;Database=CoreShop;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;">
|
<target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=192.168.195.8;uid=sa;pwd=Dbt@com@123;Database=Shop;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;">
|
||||||
<commandText>
|
<commandText>
|
||||||
INSERT INTO SysNLogRecords
|
INSERT INTO SysNLogRecords
|
||||||
(LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod
|
(LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DbType": "SqlServer", //数据库将支持两种模式【SqlServer,MySql】
|
"DbType": "SqlServer", //数据库将支持两种模式【SqlServer,MySql】
|
||||||
"SqlConnection": "Server=192.168.195.8;uid=sa;pwd=Dbt@com@123;Database=CoreShop;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;"
|
"SqlConnection": "Server=192.168.195.8;uid=sa;pwd=Dbt@com@123;Database=Shop;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;"
|
||||||
//SqlServer数据库连接字符串,需要开启数据库连接复用【MultipleActiveResultSets=true】
|
//SqlServer数据库连接字符串,需要开启数据库连接复用【MultipleActiveResultSets=true】
|
||||||
|
|
||||||
// 如果采用容器化部署Service 要写成mysql的服务名,否则写地址
|
// 如果采用容器化部署Service 要写成mysql的服务名,否则写地址
|
||||||
|
|
|
||||||
|
|
@ -431,6 +431,40 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 手机号密码登录===================================================================
|
||||||
|
/// <summary>
|
||||||
|
/// 手机号密码登录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<WebApiCallBack> PasswordLogin([FromBody] FMPasswordLogin entity)
|
||||||
|
{
|
||||||
|
var jm = new WebApiCallBack();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(entity.mobile))
|
||||||
|
{
|
||||||
|
jm.msg = "请输入手机号码";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(entity.password))
|
||||||
|
{
|
||||||
|
jm.msg = "请输入密码";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CommonHelper.IsMobile(entity.mobile))
|
||||||
|
{
|
||||||
|
jm.msg = "请输入合法的手机号码";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
jm = await _userServices.PasswordLogin(entity);
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region 用户短信注册并返回jwt token(弃用)======================================================
|
#region 用户短信注册并返回jwt token(弃用)======================================================
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户短信注册并返回jwt token(弃用)
|
/// 用户短信注册并返回jwt token(弃用)
|
||||||
|
|
|
||||||
|
|
@ -897,6 +897,13 @@
|
||||||
<param name="entity"></param>
|
<param name="entity"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.PasswordLogin(CoreCms.Net.Model.FromBody.FMPasswordLogin)">
|
||||||
|
<summary>
|
||||||
|
手机号密码登录
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.SmsLogin2(CoreCms.Net.Model.FromBody.FMWxAccountCreate)">
|
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.SmsLogin2(CoreCms.Net.Model.FromBody.FMWxAccountCreate)">
|
||||||
<summary>
|
<summary>
|
||||||
用户短信注册并返回jwt token(弃用)
|
用户短信注册并返回jwt token(弃用)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user