封版
This commit is contained in:
@@ -21,7 +21,7 @@ export async function uploadOssByPath(filePath: string) {
|
|||||||
let stsExpired = Taro.getStorageSync('stsExpiredAt');
|
let stsExpired = Taro.getStorageSync('stsExpiredAt');
|
||||||
if (!sts || (stsExpired && dayjs().isBefore(dayjs(stsExpired)))) {
|
if (!sts || (stsExpired && dayjs().isBefore(dayjs(stsExpired)))) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const {data: {data: {credentials}}} = await request.get(`https://server.gxwebsoft.com/api/oss/getSTSToken`)
|
const {data: {data: {credentials}}} = await request.get(`https://server.websoft.top/api/oss/getSTSToken`)
|
||||||
Taro.setStorageSync('sts', credentials)
|
Taro.setStorageSync('sts', credentials)
|
||||||
Taro.setStorageSync('stsExpiredAt', credentials.expiration)
|
Taro.setStorageSync('stsExpiredAt', credentials.expiration)
|
||||||
sts = credentials
|
sts = credentials
|
||||||
@@ -66,7 +66,7 @@ export async function uploadFile() {
|
|||||||
const tempFilePath = res.tempFilePaths[0];
|
const tempFilePath = res.tempFilePaths[0];
|
||||||
// 上传图片到OSS
|
// 上传图片到OSS
|
||||||
Taro.uploadFile({
|
Taro.uploadFile({
|
||||||
url: 'https://server.gxwebsoft.com/api/oss/upload',
|
url: 'https://server.websoft.top/api/oss/upload',
|
||||||
filePath: tempFilePath,
|
filePath: tempFilePath,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export default defineAppConfig({
|
|||||||
{
|
{
|
||||||
"root": "passport",
|
"root": "passport",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
"wxLogin",
|
||||||
"login",
|
"login",
|
||||||
"register",
|
"register",
|
||||||
"forget",
|
"forget",
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ function BxAdd() {
|
|||||||
const uploadSingleImage = (filePath: string, index: number) => {
|
const uploadSingleImage = (filePath: string, index: number) => {
|
||||||
|
|
||||||
Taro.uploadFile({
|
Taro.uploadFile({
|
||||||
url: 'https://server.gxwebsoft.com/api/oss/upload',
|
url: 'https://server.websoft.top/api/oss/upload',
|
||||||
filePath: filePath,
|
filePath: filePath,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: {
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ const Query = () => {
|
|||||||
const uploadSingleImage = (filePath: any, index: number) => {
|
const uploadSingleImage = (filePath: any, index: number) => {
|
||||||
|
|
||||||
Taro.uploadFile({
|
Taro.uploadFile({
|
||||||
url: 'https://server.gxwebsoft.com/api/oss/upload',
|
url: 'https://server.websoft.top/api/oss/upload',
|
||||||
filePath: filePath,
|
filePath: filePath,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: {
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ const Header = (props: any) => {
|
|||||||
success: function () {
|
success: function () {
|
||||||
if (code) {
|
if (code) {
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
|
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
code,
|
code,
|
||||||
@@ -177,16 +177,14 @@ const Header = (props: any) => {
|
|||||||
}}
|
}}
|
||||||
left={
|
left={
|
||||||
!IsLogin ? (
|
!IsLogin ? (
|
||||||
<div style={{display: 'flex', alignItems: 'center'}}>
|
<div style={{display: 'flex', alignItems: 'center'}} onClick={() => Taro.navigateTo({url: '/passport/wxLogin'})}>
|
||||||
<Button style={{color: '#000'}} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
|
<Space>
|
||||||
<Space>
|
<Avatar
|
||||||
<Avatar
|
size="22"
|
||||||
size="22"
|
src={props.user?.avatar}
|
||||||
src={props.user?.avatar}
|
/>
|
||||||
/>
|
<span style={{color: '#000'}}>{props.user?.nickname}</span>
|
||||||
<span style={{color: '#000'}}>{props.user?.nickname}</span>
|
</Space>
|
||||||
</Space>
|
|
||||||
</Button>
|
|
||||||
<TriangleDown size={9}/>
|
<TriangleDown size={9}/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const Login = (props:any) => {
|
|||||||
success: function () {
|
success: function () {
|
||||||
if (code) {
|
if (code) {
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
|
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
code,
|
code,
|
||||||
@@ -60,7 +60,7 @@ const Login = (props:any) => {
|
|||||||
env === 'WEAPP' && (
|
env === 'WEAPP' && (
|
||||||
<>
|
<>
|
||||||
<div className={'flex flex-col w-full text-white rounded-full justify-between items-center my-2'} style={{ background: 'linear-gradient(to right, #7e22ce, #9333ea)'}}>
|
<div className={'flex flex-col w-full text-white rounded-full justify-between items-center my-2'} style={{ background: 'linear-gradient(to right, #7e22ce, #9333ea)'}}>
|
||||||
<Button open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
|
<Button onClick={() => Taro.navigateTo({url: '/passport/wxLogin'})}>
|
||||||
授权手机号登录
|
授权手机号登录
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const Page = () => {
|
|||||||
success: function () {
|
success: function () {
|
||||||
if (code) {
|
if (code) {
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
|
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
code,
|
code,
|
||||||
@@ -191,12 +191,10 @@ const Page = () => {
|
|||||||
<div className={'mt-2'} style={{fontSize: '15px'}}>{item?.title}</div>
|
<div className={'mt-2'} style={{fontSize: '15px'}}>{item?.title}</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<Button className={'text-white'} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
|
<div className={'flex flex-col justify-center items-center'} onClick={() => Taro.navigateTo({url: '/passport/wxLogin'})}>
|
||||||
<div className={'flex flex-col justify-center items-center'}>
|
<Image src={item.icon} height={28} width={28}/>
|
||||||
<Image src={item.icon} height={28} width={28}/>
|
<div className={'mt-2 text-gray-700'} style={{fontSize: '15px'}}>{item?.title}</div>
|
||||||
<div className={'mt-2 text-gray-700'} style={{fontSize: '15px'}}>{item?.title}</div>
|
</div>
|
||||||
</div>
|
|
||||||
</Button>
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const OrderIcon = () => {
|
|||||||
success: function () {
|
success: function () {
|
||||||
if (code) {
|
if (code) {
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
|
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
code,
|
code,
|
||||||
@@ -191,12 +191,10 @@ const OrderIcon = () => {
|
|||||||
<div className={'mt-2'} style={{fontSize: '15px'}}>{item?.title}</div>
|
<div className={'mt-2'} style={{fontSize: '15px'}}>{item?.title}</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<Button className={'text-white'} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
|
<div className={'flex flex-col justify-center items-center'} onClick={() => Taro.navigateTo({url: '/passport/wxLogin'})}>
|
||||||
<div className={'flex flex-col justify-center items-center'}>
|
<Image src={item.icon} height={28} width={28}/>
|
||||||
<Image src={item.icon} height={28} width={28}/>
|
<div className={'mt-2 text-gray-700'} style={{fontSize: '15px'}}>{item?.title}</div>
|
||||||
<div className={'mt-2 text-gray-700'} style={{fontSize: '15px'}}>{item?.title}</div>
|
</div>
|
||||||
</div>
|
|
||||||
</Button>
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ function UserCard() {
|
|||||||
success: function () {
|
success: function () {
|
||||||
if (code) {
|
if (code) {
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
|
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
code,
|
code,
|
||||||
@@ -155,9 +155,9 @@ function UserCard() {
|
|||||||
IsLogin ? (
|
IsLogin ? (
|
||||||
<Avatar size="large" src={userInfo?.avatar} shape="round"/>
|
<Avatar size="large" src={userInfo?.avatar} shape="round"/>
|
||||||
) : (
|
) : (
|
||||||
<Button className={'text-black'} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
|
<div onClick={() => Taro.navigateTo({url: '/passport/wxLogin'})}>
|
||||||
<Avatar size="large" src={userInfo?.avatar} shape="round"/>
|
<Avatar size="large" src={userInfo?.avatar} shape="round"/>
|
||||||
</Button>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<div className={'user-info flex flex-col px-2'}>
|
<div className={'user-info flex flex-col px-2'}>
|
||||||
|
|||||||
4
src/passport/agreement.scss
Normal file
4
src/passport/agreement.scss
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.content{
|
||||||
|
padding: 32px;
|
||||||
|
line-height: 2.4rem;
|
||||||
|
}
|
||||||
@@ -1,30 +1,43 @@
|
|||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from 'react'
|
||||||
import Taro from '@tarojs/taro'
|
import {CmsArticle} from "@/api/cms/cmsArticle/model"
|
||||||
|
// import ReactMarkdown from 'react-markdown';
|
||||||
|
// 显示html富文本
|
||||||
import {View, RichText} from '@tarojs/components'
|
import {View, RichText} from '@tarojs/components'
|
||||||
|
import Line from "@/components/Gap";
|
||||||
|
import {wxParse} from "@/utils/common";
|
||||||
|
import {getCmsArticle} from "@/api/cms/cmsArticle";
|
||||||
|
import './agreement.scss'
|
||||||
|
|
||||||
const Agreement = () => {
|
function Detail() {
|
||||||
|
// 文章详情
|
||||||
const [content, setContent] = useState<any>('')
|
const [item, setItem] = useState<CmsArticle>()
|
||||||
const reload = () => {
|
const reload = () => {
|
||||||
Taro.hideTabBar()
|
getCmsArticle(10112).then(data => {
|
||||||
setContent('<p>' +
|
if(data){
|
||||||
'<span style="font-size: 14px;">欢迎使用</span>' +
|
data.content = wxParse(data.content)
|
||||||
'<span style="font-size: 14px;"> </span>' +
|
setItem(data)
|
||||||
'<span style="font-size: 14px;"><strong><span style="color: rgb(255, 0, 0);">【WebSoft】</span></strong></span>' +
|
}
|
||||||
'<span style="font-size: 14px;">服务协议 </span>' +
|
})
|
||||||
'</p>')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reload()
|
reload();
|
||||||
}, [])
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className={'bg-white'}>
|
||||||
<View className={'content text-gray-700 text-sm p-4'}>
|
<div className={'p-4 font-bold text-lg'}>{item?.title}</div>
|
||||||
<RichText nodes={content}/>
|
<div className={'text-gray-400 text-sm px-4 '}>{item?.createTime}</div>
|
||||||
|
<View className={'content text-gray-700 text-sm'}>
|
||||||
|
{
|
||||||
|
item?.editor === 1 ?
|
||||||
|
<RichText nodes={item?.content} /> :
|
||||||
|
null
|
||||||
|
}
|
||||||
</View>
|
</View>
|
||||||
</>
|
<Line height={44}/>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default Agreement
|
|
||||||
|
export default Detail
|
||||||
|
|||||||
4
src/passport/wxLogin.config.ts
Normal file
4
src/passport/wxLogin.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '快捷登录',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
44
src/passport/wxLogin.tsx
Normal file
44
src/passport/wxLogin.tsx
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import {useEffect, useState} from "react";
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
import {Radio, Button} from '@nutui/nutui-react-taro'
|
||||||
|
|
||||||
|
const Login = () => {
|
||||||
|
const [isAgree, setIsAgree] = useState(false)
|
||||||
|
const reload = () => {
|
||||||
|
Taro.hideTabBar()
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
reload()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className={'flex flex-col justify-center px-5 pt-5'}>
|
||||||
|
<div className={'text-3xl text-center py-5 font-normal my-10'}>快捷登录</div>
|
||||||
|
|
||||||
|
<>
|
||||||
|
<div className={'flex justify-center my-5'}>
|
||||||
|
<Button type="info" size={'large'} className={'w-full rounded-lg p-2'}
|
||||||
|
disabled={!isAgree}>手机号一键登录</Button>
|
||||||
|
</div>
|
||||||
|
{/*<div className={'my-2 flex fixed justify-center bottom-20 left-0 text-sm items-center text-center w-full'}>*/}
|
||||||
|
{/* <Button onClick={() => Taro.navigateTo({url: '/passport/setting'})}>服务配置</Button>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
{/*<div className={'w-full fixed bottom-20 my-2 flex justify-center text-sm items-center text-center'}>*/}
|
||||||
|
{/* 没有账号?<a href={''} onClick={() => Taro.navigateTo({url: '/passport/register'})}*/}
|
||||||
|
{/* className={'text-blue-600'}>立即注册</a>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
</>
|
||||||
|
|
||||||
|
<div className={'my-2 flex text-sm items-center px-1'}>
|
||||||
|
<Radio style={{color: '#333333'}} checked={isAgree} onClick={() => setIsAgree(!isAgree)}></Radio>
|
||||||
|
<span className={'text-gray-400'} onClick={() => setIsAgree(!isAgree)}>勾选表示您已阅读并同意</span><a
|
||||||
|
onClick={() => Taro.navigateTo({url: '/passport/agreement'})}
|
||||||
|
className={'text-blue-600'}>《服务协议及隐私政策》</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Login
|
||||||
@@ -73,7 +73,7 @@ function Profile() {
|
|||||||
avatar: `${detail.avatarUrl}`,
|
avatar: `${detail.avatarUrl}`,
|
||||||
})
|
})
|
||||||
Taro.uploadFile({
|
Taro.uploadFile({
|
||||||
url: 'https://server.gxwebsoft.com/api/oss/upload',
|
url: 'https://server.websoft.top/api/oss/upload',
|
||||||
filePath: detail.avatarUrl,
|
filePath: detail.avatarUrl,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {User} from "@/api/system/user/model";
|
|||||||
// 模版套餐ID
|
// 模版套餐ID
|
||||||
export const TEMPLATE_ID = 10398;
|
export const TEMPLATE_ID = 10398;
|
||||||
// 服务接口
|
// 服务接口
|
||||||
export const SERVER_API_URL = 'https://server.gxwebsoft.com/api';
|
export const SERVER_API_URL = 'https://server.websoft.top/api';
|
||||||
// export const SERVER_API_URL = 'http://127.0.0.1:8000/api';
|
// export const SERVER_API_URL = 'http://127.0.0.1:8000/api';
|
||||||
/**
|
/**
|
||||||
* 保存用户信息到本地存储
|
* 保存用户信息到本地存储
|
||||||
|
|||||||
Reference in New Issue
Block a user