This commit is contained in:
2025-07-31 00:46:40 +08:00
parent 8b0a0df98d
commit 286215ced0
15 changed files with 115 additions and 55 deletions

View File

@@ -21,7 +21,7 @@ export async function uploadOssByPath(filePath: string) {
let stsExpired = Taro.getStorageSync('stsExpiredAt');
if (!sts || (stsExpired && dayjs().isBefore(dayjs(stsExpired)))) {
// @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('stsExpiredAt', credentials.expiration)
sts = credentials
@@ -66,7 +66,7 @@ export async function uploadFile() {
const tempFilePath = res.tempFilePaths[0];
// 上传图片到OSS
Taro.uploadFile({
url: 'https://server.gxwebsoft.com/api/oss/upload',
url: 'https://server.websoft.top/api/oss/upload',
filePath: tempFilePath,
name: 'file',
header: {

View File

@@ -11,6 +11,7 @@ export default defineAppConfig({
{
"root": "passport",
"pages": [
"wxLogin",
"login",
"register",
"forget",

View File

@@ -129,7 +129,7 @@ function BxAdd() {
const uploadSingleImage = (filePath: string, index: number) => {
Taro.uploadFile({
url: 'https://server.gxwebsoft.com/api/oss/upload',
url: 'https://server.websoft.top/api/oss/upload',
filePath: filePath,
name: 'file',
header: {

View File

@@ -219,7 +219,7 @@ const Query = () => {
const uploadSingleImage = (filePath: any, index: number) => {
Taro.uploadFile({
url: 'https://server.gxwebsoft.com/api/oss/upload',
url: 'https://server.websoft.top/api/oss/upload',
filePath: filePath,
name: 'file',
header: {

View File

@@ -132,7 +132,7 @@ const Header = (props: any) => {
success: function () {
if (code) {
Taro.request({
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
method: 'POST',
data: {
code,
@@ -177,16 +177,14 @@ const Header = (props: any) => {
}}
left={
!IsLogin ? (
<div style={{display: 'flex', alignItems: 'center'}}>
<Button style={{color: '#000'}} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
<Space>
<Avatar
size="22"
src={props.user?.avatar}
/>
<span style={{color: '#000'}}>{props.user?.nickname}</span>
</Space>
</Button>
<div style={{display: 'flex', alignItems: 'center'}} onClick={() => Taro.navigateTo({url: '/passport/wxLogin'})}>
<Space>
<Avatar
size="22"
src={props.user?.avatar}
/>
<span style={{color: '#000'}}>{props.user?.nickname}</span>
</Space>
<TriangleDown size={9}/>
</div>
) : (

View File

@@ -16,7 +16,7 @@ const Login = (props:any) => {
success: function () {
if (code) {
Taro.request({
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
method: 'POST',
data: {
code,
@@ -60,7 +60,7 @@ const Login = (props:any) => {
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)'}}>
<Button open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
<Button onClick={() => Taro.navigateTo({url: '/passport/wxLogin'})}>
</Button>
</div>

View File

@@ -25,7 +25,7 @@ const Page = () => {
success: function () {
if (code) {
Taro.request({
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
method: 'POST',
data: {
code,
@@ -191,12 +191,10 @@ const Page = () => {
<div className={'mt-2'} style={{fontSize: '15px'}}>{item?.title}</div>
</div>
:
<Button className={'text-white'} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
<div className={'flex flex-col justify-center items-center'}>
<Image src={item.icon} height={28} width={28}/>
<div className={'mt-2 text-gray-700'} style={{fontSize: '15px'}}>{item?.title}</div>
</div>
</Button>
<div className={'flex flex-col justify-center items-center'} onClick={() => Taro.navigateTo({url: '/passport/wxLogin'})}>
<Image src={item.icon} height={28} width={28}/>
<div className={'mt-2 text-gray-700'} style={{fontSize: '15px'}}>{item?.title}</div>
</div>
}
</div>
))

View File

@@ -25,7 +25,7 @@ const OrderIcon = () => {
success: function () {
if (code) {
Taro.request({
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
method: 'POST',
data: {
code,
@@ -191,12 +191,10 @@ const OrderIcon = () => {
<div className={'mt-2'} style={{fontSize: '15px'}}>{item?.title}</div>
</div>
:
<Button className={'text-white'} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
<div className={'flex flex-col justify-center items-center'}>
<Image src={item.icon} height={28} width={28}/>
<div className={'mt-2 text-gray-700'} style={{fontSize: '15px'}}>{item?.title}</div>
</div>
</Button>
<div className={'flex flex-col justify-center items-center'} onClick={() => Taro.navigateTo({url: '/passport/wxLogin'})}>
<Image src={item.icon} height={28} width={28}/>
<div className={'mt-2 text-gray-700'} style={{fontSize: '15px'}}>{item?.title}</div>
</div>
}
</div>
))

View File

@@ -107,7 +107,7 @@ function UserCard() {
success: function () {
if (code) {
Taro.request({
url: 'https://server.gxwebsoft.com/api/wx-login/loginByMpWxPhone',
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
method: 'POST',
data: {
code,
@@ -155,9 +155,9 @@ function UserCard() {
IsLogin ? (
<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"/>
</Button>
</div>
)
}
<div className={'user-info flex flex-col px-2'}>

View File

@@ -0,0 +1,4 @@
.content{
padding: 32px;
line-height: 2.4rem;
}

View File

@@ -1,30 +1,43 @@
import {useEffect, useState} from "react";
import Taro from '@tarojs/taro'
import {useEffect, useState} from 'react'
import {CmsArticle} from "@/api/cms/cmsArticle/model"
// import ReactMarkdown from 'react-markdown';
// 显示html富文本
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 = () => {
const [content, setContent] = useState<any>('')
function Detail() {
// 文章详情
const [item, setItem] = useState<CmsArticle>()
const reload = () => {
Taro.hideTabBar()
setContent('<p>' +
'<span style="font-size: 14px;">欢迎使用</span>' +
'<span style="font-size: 14px;">&nbsp;</span>' +
'<span style="font-size: 14px;"><strong><span style="color: rgb(255, 0, 0);">【WebSoft】</span></strong></span>' +
'<span style="font-size: 14px;">服务协议&nbsp;</span>' +
'</p>')
getCmsArticle(10112).then(data => {
if(data){
data.content = wxParse(data.content)
setItem(data)
}
})
}
useEffect(() => {
reload()
}, [])
reload();
}, []);
return (
<>
<View className={'content text-gray-700 text-sm p-4'}>
<RichText nodes={content}/>
<div className={'bg-white'}>
<div className={'p-4 font-bold text-lg'}>{item?.title}</div>
<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>
</>
<Line height={44}/>
</div>
)
}
export default Agreement
export default Detail

View File

@@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '快捷登录',
navigationBarTextStyle: 'black'
})

44
src/passport/wxLogin.tsx Normal file
View 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

View File

@@ -73,7 +73,7 @@ function Profile() {
avatar: `${detail.avatarUrl}`,
})
Taro.uploadFile({
url: 'https://server.gxwebsoft.com/api/oss/upload',
url: 'https://server.websoft.top/api/oss/upload',
filePath: detail.avatarUrl,
name: 'file',
header: {

View File

@@ -4,7 +4,7 @@ import {User} from "@/api/system/user/model";
// 模版套餐ID
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';
/**
* 保存用户信息到本地存储