优化
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: {
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ const Header = () => {
|
|||||||
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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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: {
|
||||||
|
|||||||
@@ -69,9 +69,8 @@ export function copyText(text: string) {
|
|||||||
/**
|
/**
|
||||||
* 分享商品链接
|
* 分享商品链接
|
||||||
* @param goodsId 商品ID
|
* @param goodsId 商品ID
|
||||||
* @param goodsName 商品名称
|
|
||||||
*/
|
*/
|
||||||
export function shareGoodsLink(goodsId: string | number, goodsName?: string) {
|
export function shareGoodsLink(goodsId: string | number) {
|
||||||
// 构建分享链接,这里需要根据你的实际域名调整
|
// 构建分享链接,这里需要根据你的实际域名调整
|
||||||
const baseUrl = 'https://your-domain.com'; // 请替换为你的实际域名
|
const baseUrl = 'https://your-domain.com'; // 请替换为你的实际域名
|
||||||
const shareUrl = `${baseUrl}/shop/goodsDetail/index?id=${goodsId}`;
|
const shareUrl = `${baseUrl}/shop/goodsDetail/index?id=${goodsId}`;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {User} from "@/api/system/user/model";
|
|||||||
// 模版套餐ID
|
// 模版套餐ID
|
||||||
export const TEMPLATE_ID = 10258;
|
export const TEMPLATE_ID = 10258;
|
||||||
// 服务接口
|
// 服务接口
|
||||||
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