提交信息
This commit is contained in:
parent
a4a81a5873
commit
b8ff83019d
8
env/.env
vendored
8
env/.env
vendored
@ -5,8 +5,8 @@ VITE_APP_TITLE=uniapp-vue3模板项目
|
|||||||
VITE_APP_ENV=development
|
VITE_APP_ENV=development
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_BASE_URL=http://www.caipu.com:8545
|
# VITE_API_BASE_URL=http://www.caipu.com:8545
|
||||||
# VITE_API_BASE_URL=http://ceshi-recipeapi.lihaink.cn/
|
VITE_API_BASE_URL=https://ceshi-recipeapi.lihaink.cn/
|
||||||
|
|
||||||
# 端口号
|
# 端口号
|
||||||
VITE_APP_PORT=9527
|
VITE_APP_PORT=9527
|
||||||
@ -15,8 +15,8 @@ VITE_APP_PORT=9527
|
|||||||
VITE_APP_PROXY=true
|
VITE_APP_PROXY=true
|
||||||
|
|
||||||
# API代理前缀
|
# API代理前缀
|
||||||
VITE_API_PREFIX= http://www.caipu.com:8545
|
# VITE_API_PREFIX= http://www.caipu.com:8545
|
||||||
# VITE_API_PREFIX= http://ceshi-recipeapi.lihaink.cn/
|
VITE_API_PREFIX= https://ceshi-recipeapi.lihaink.cn/
|
||||||
|
|
||||||
# 删除console
|
# 删除console
|
||||||
VITE_DROP_CONSOLE=false
|
VITE_DROP_CONSOLE=false
|
||||||
|
2
env/.env.test
vendored
2
env/.env.test
vendored
@ -2,7 +2,7 @@
|
|||||||
VITE_APP_ENV=staging
|
VITE_APP_ENV=staging
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_BASE_URL=http://localhost:8080/staging
|
VITE_API_BASE_URL=http://ceshi-recipeapi.lihaink.cn
|
||||||
|
|
||||||
# 删除console
|
# 删除console
|
||||||
VITE_DROP_CONSOLE=true
|
VITE_DROP_CONSOLE=true
|
||||||
|
@ -10,7 +10,7 @@ export interface ProfileRes {
|
|||||||
user?: any;
|
user?: any;
|
||||||
}
|
}
|
||||||
export interface LoginReq {
|
export interface LoginReq {
|
||||||
phone: string;
|
account: string;
|
||||||
code: string;
|
code: string;
|
||||||
}
|
}
|
||||||
export interface LoginReqPassword {
|
export interface LoginReqPassword {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name" : "",
|
"name" : "菜谱",
|
||||||
"appid" : "",
|
"appid" : "",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
@ -63,7 +63,7 @@
|
|||||||
"desc" : "获取您的位置"
|
"desc" : "获取您的位置"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"requiredPrivateInfos" : ["login" ,"getLocation", "chooseAddress" , "chooseLocation" ]
|
"requiredPrivateInfos" : [ "getLocation", "chooseAddress" , "chooseLocation" ]
|
||||||
},
|
},
|
||||||
"mp-alipay" : {
|
"mp-alipay" : {
|
||||||
"usingComponents" : true
|
"usingComponents" : true
|
||||||
|
@ -9,6 +9,11 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
/* 确保元素有宽度 */
|
/* 确保元素有宽度 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
height: 0rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -24,7 +29,7 @@
|
|||||||
maxlength="-1" height="60rpx" @change="searchSP()">
|
maxlength="-1" height="60rpx" @change="searchSP()">
|
||||||
</up-search>
|
</up-search>
|
||||||
|
|
||||||
<z-paging :fixed="false" height="calc(100vh - 320rpx)" width="calc(100vw - 50rpx)"
|
<z-paging :fixed="false" height="calc(100vh - 380rpx)" width="calc(100vw - 50rpx)"
|
||||||
:paging-style="{ 'background-color': '#FFFFFFFF', 'padding': '20rpx' }" ref="pagingRefSP"
|
:paging-style="{ 'background-color': '#FFFFFFFF', 'padding': '20rpx' }" ref="pagingRefSP"
|
||||||
v-model="matchedItems_sp" @query="changeSP" class="fv-page flex-col ">
|
v-model="matchedItems_sp" @query="changeSP" class="fv-page flex-col ">
|
||||||
<view v-for="(item, index) in matchedItems_sp" :key="index">
|
<view v-for="(item, index) in matchedItems_sp" :key="index">
|
||||||
|
@ -125,9 +125,50 @@ function getCode () {
|
|||||||
|
|
||||||
|
|
||||||
async function wechatLogin () {
|
async function wechatLogin () {
|
||||||
|
if (isWechat.value === true) {
|
||||||
if (!isWechat.value) {
|
if (!uni.$u.test.mobile(Number(account.value))) {
|
||||||
|
uni.$u.toast('请输入正确的手机号');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (loginType.value === 0) {
|
||||||
|
if (!password.value) {
|
||||||
|
uni.$u.toast('请输入密码');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await userStore.passwordLogin({ account: account.value, password: password.value }).catch((res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.code === 1) {
|
||||||
|
// const token = res.data.token;
|
||||||
|
// if (token) {
|
||||||
|
// setToken(token.token_type+' '+token.token);
|
||||||
|
// }
|
||||||
|
uni.$u.toast('登录成功');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
uni.$u.toast(`登录失败,${res.msg}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!code.value) {
|
||||||
|
uni.$u.toast('请输入验证码');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await userStore.login({ account: account.value, code: password.value }).catch(() => {
|
||||||
|
if (res.code === 1) {
|
||||||
|
// const token = res.data.token;
|
||||||
|
// if (token) {
|
||||||
|
// setToken(token.token_type+' '+token.token);
|
||||||
|
// }
|
||||||
|
uni.$u.toast('登录成功');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
uni.$u.toast(`登录失败,${res.msg}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('222微信登录');
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
// onlyAuthorize: true,// 微信登录仅请求授权认证
|
// onlyAuthorize: true,// 微信登录仅请求授权认证
|
||||||
@ -145,7 +186,7 @@ async function wechatLogin () {
|
|||||||
// uni.setStorageSync('token', res.token)
|
// uni.setStorageSync('token', res.token)
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
userStore.login({ account: account.value, code: event.code }).catch(() => {
|
userStore.login({ account: account.value, code: event.code }).catch((res) => {
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
// const token = res.data.token;
|
// const token = res.data.token;
|
||||||
// if (token) {
|
// if (token) {
|
||||||
@ -154,7 +195,7 @@ async function wechatLogin () {
|
|||||||
uni.$u.toast('登录成功');
|
uni.$u.toast('登录成功');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uni.$u.toast(`登录失败,${res.message}`);
|
uni.$u.toast(`登录失败,${res.msg}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -164,51 +205,9 @@ async function wechatLogin () {
|
|||||||
// err.code是错误码
|
// err.code是错误码
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!uni.$u.test.mobile(Number(account.value))) {
|
|
||||||
uni.$u.toast('请输入正确的手机号');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (loginType.value === 0) {
|
|
||||||
if (!password.value) {
|
|
||||||
uni.$u.toast('请输入密码');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await userStore.passwordLogin({ account: account.value, password: password.value }).catch((res) => {
|
|
||||||
console.log(res);
|
|
||||||
if (res.code === 1) {
|
|
||||||
// const token = res.data.token;
|
|
||||||
// if (token) {
|
|
||||||
// setToken(token.token_type+' '+token.token);
|
|
||||||
// }
|
|
||||||
uni.$u.toast('登录成功');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
uni.$u.toast(`登录失败,${res.message}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (!code.value) {
|
|
||||||
uni.$u.toast('请输入验证码');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await userStore.login({ account: account.value, code: password.value }).catch(() => {
|
|
||||||
if (res.code === 1) {
|
|
||||||
// const token = res.data.token;
|
|
||||||
// if (token) {
|
|
||||||
// setToken(token.token_type+' '+token.token);
|
|
||||||
// }
|
|
||||||
uni.$u.toast('登录成功');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
uni.$u.toast(`登录失败,${res.message}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (isLogin()) {
|
if (isLogin()) {
|
||||||
// await userStore.info()
|
// await userStore.info()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -445,7 +445,8 @@ export default defineComponent({
|
|||||||
if (this.totalNum == 1) {
|
if (this.totalNum == 1) {
|
||||||
this.totalNum = res.data.peopleNumber
|
this.totalNum = res.data.peopleNumber
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
uni.$u.toast(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -29,7 +29,7 @@ export function request<T = any>(config: HttpRequestConfig): Promise<T> {
|
|||||||
const { result } = res.data;
|
const { result } = res.data;
|
||||||
resolve(result as T);
|
resolve(result as T);
|
||||||
}).catch((res: any) => {
|
}).catch((res: any) => {
|
||||||
if(res.data.code==401){
|
if(res.code==401){
|
||||||
//未登录拦截跳转
|
//未登录拦截跳转
|
||||||
uni.$u.toast(res.data.msg);
|
uni.$u.toast(res.data.msg);
|
||||||
usePermission();
|
usePermission();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user