pc端增加工作台切换页,新增生产环境oss地址

This commit is contained in:
Double-_-Z 2025-01-26 16:04:45 +08:00
parent 1a1c5f6cbb
commit 2e62f3fc61
14 changed files with 71 additions and 28 deletions

View File

@ -5,15 +5,16 @@ let BASE_URL = '/pixelApi';
// #endif
// #ifdef APP-PLUS ||MP
let BASE_URL = 'http://8.138.171.103/pixelApi';// 测试环境
// let BASE_URL = 'http://www.ylemai.cn/pixelApi';// 正式环境
// let BASE_URL = 'https://www.ylemai.cn/pixelApi';// 正式环境
// #endif
let IP = 'http://8.138.171.103/';// 测试环境
// let IP = 'http://www.ylemai.cn/';// 正式环境
// let IP = 'https://www.ylemai.cn/';// 正式环境
let FILE_URL = IP+'static/';
// 阿里OSS地址
let ALIOSS_URL = 'http://guojunjie.oss-cn-hangzhou.aliyuncs.com';
let ANOTHER_ALIOSS_URL = 'http://pixel-ai-file-test.oss-cn-guangzhou.aliyuncs.com';
let OTHER_ALIOSS_URL = 'http://pixel-ai-file-test.oss-cn-guangzhou.aliyuncs.com';// 测试环境
let ANOTHER_ALIOSS_URL = 'http://pixel-ai-file.oss-cn-guangzhou.aliyuncs.com';// 正式环境
let ALIOSS_ASYNC_URL = "http://dashscope-result-bj.oss-cn-beijing.aliyuncs.com";// 异步url
// 火山引擎ai接口地址
let AI_URL = 'https://visual.volcengineapi.com';
@ -24,7 +25,8 @@ const configService = {
fileUrl: FILE_URL,
aiUrl: AI_URL,
aliUrl: ALIOSS_URL,
otherAliUrl: ANOTHER_ALIOSS_URL,
otherAliUrl: OTHER_ALIOSS_URL,
anotherAliUrl: ANOTHER_ALIOSS_URL,
aliAsyncUrl: ALIOSS_ASYNC_URL,
};

View File

@ -47,6 +47,7 @@ const ossUpload = async(vm,filePath,success) => {
// #ifdef H5
clientPath = res.data.replace(configService.aliUrl, "/ossUpload");
clientPath = clientPath.replace(configService.otherAliUrl, "/otherOssUpload");
clientPath = clientPath.replace(configService.anotherAliUrl, "/anotherOssUpload");
// #endif
// #ifndef H5
clientPath = res.data;

View File

@ -24,7 +24,10 @@ const install = (vm) => {
// H5路由拦截,用于拦截用户地址栏输入地址
const token = vm.$store.state.vuex_token;
let locationUrl = window.location.href.split("/#")[1];
if(needLogin.includes(locationUrl)&&!token){
// 参数下标——地址?下标
let quteIndex = locationUrl?.indexOf('?');
let quteUrl = locationUrl.substring(0,(!quteIndex||quteIndex===-1) ? locationUrl.length : quteIndex);
if(needLogin.includes(quteUrl)&&!token){
uni.showToast({
title: '该页面需要登录才能访问,请先登录',
icon: 'none'
@ -32,7 +35,7 @@ const install = (vm) => {
uni.navigateTo({
url: "/pages/mobile_web/my/child_pages/login?nextUrl="+locationUrl
});
} else if(!filterRoute.includes(locationUrl)&&locationUrl!=='/'&&vm.$store.state.current_platform&&
} else if(quteUrl!=='/'&&!filterRoute.includes(quteUrl)&&vm.$store.state.current_platform&&
locationUrl.indexOf(vm.$store.state.current_platform)==-1){
uni.navigateTo({
url: `/pages/${vm.$store.state.current_platform}/index/index`,
@ -66,7 +69,7 @@ const install = (vm) => {
return false;
}
// #ifndef APP
else if(!filterRoute.includes(url)&&url.indexOf(vm.$store.state.current_platform)==-1){
else if(!filterRoute.includes(url)&&url.indexOf(vm.$store.state.current_platform)===-1){
uni.showToast({
title: '该设备端无法访问对应页面!',
icon: 'none'

View File

@ -136,7 +136,7 @@
"proxy" : {
"/pixelApi" : {
"target" : "http://8.138.171.103/pixelApi", //
// "target" : "http://www.ylemai.cn/pixelApi",//
// "target" : "https://www.ylemai.cn/pixelApi",//
"changeOrigin" : true,
"secure" : true,
"ws" : false,
@ -146,21 +146,21 @@
},
"/upload" : {
"target" : "http://8.138.171.103", //
// "target" : "http://www.ylemai.cn",//
// "target" : "https://www.ylemai.cn",//
"changeOrigin" : true,
"secure" : true,
"ws" : false
},
"/static" : {
"target" : "http://8.138.171.103", //
// "target" : "http://www.ylemai.cn",//
// "target" : "https://www.ylemai.cn",//
"changeOrigin" : true,
"secure" : true,
"ws" : false
},
"/aiupload" : {
"target" : "http://8.138.171.103/upload", //
// "target" : "http://www.ylemai.cn/upload",//
// "target" : "https://www.ylemai.cn/upload",//
"changeOrigin" : true,
"secure" : true,
"ws" : false,
@ -187,6 +187,15 @@
"^/otherOssUpload/" : ""
}
},
"/anotherOssUpload" : {
"target" : "http://pixel-ai-file.oss-cn-guangzhou.aliyuncs.com",
"changeOrigin" : true,
"secure" : true,
"ws" : false,
"pathRewrite" : {
"^/anotherOssUpload/" : ""
}
},
"/asyncOssUpload" : {
"target" : "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com",
"changeOrigin" : true,

View File

@ -218,7 +218,8 @@ export default {
getWorkPath(path){
if(!path) return;
let index = path?.indexOf('?');
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
let judge = path?.includes(configService.anotherAliUrl);
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
},
//
async getServices(){

View File

@ -151,7 +151,8 @@
getImagePath(path){
if(!path) return;
let index = path?.indexOf('?');
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
let judge = path?.includes(configService.anotherAliUrl);
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
},
//
back(){

View File

@ -253,7 +253,8 @@ export default {
//
getPhotoPath(path){
let index = path?.indexOf('?');
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
let judge = path?.includes(configService.anotherAliUrl);
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
},
//
navigateTo(id){

View File

@ -221,7 +221,8 @@ export default {
getImagePath(path){
if(!path) return;
let index = path?.indexOf('?');
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.ip+path);
let judge = path?.includes(configService.anotherAliUrl);
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.ip+path);
},
//
changeSelect(index){

View File

@ -205,7 +205,8 @@ export default {
//
getImagePath(path){
let index = path?.indexOf('?');
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
let judge = path?.includes(configService.anotherAliUrl);
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
},
//
mannequinJudge(index){

View File

@ -205,6 +205,7 @@ export default {
ip: configService.ip,
aliIp: configService.aliUrl,
otherAliIp: configService.otherAliUrl,
anotherAliIp: configService.anotherAliUrl,
aliAsyncIp: configService.aliAsyncUrl,
myFileUrl: configService.fileUrl + 'pixel/my/',
fileUrl: configService.fileUrl + 'pixel/workshops/',
@ -519,7 +520,8 @@ export default {
getResultImagePath(path){
if(!path) return;
let index = path?.indexOf('?');
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.ip+path);
let judge = path?.includes(configService.anotherAliUrl);
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.ip+path);
},
//
async asyncPoll(id) {
@ -702,6 +704,7 @@ export default {
// #ifdef H5
let downloadUrl = await that.resultFile.replace(that.aliIp, "/ossUpload");
downloadUrl = await downloadUrl.replace(that.otherAliIp, "/otherOssUpload");
downloadUrl = await downloadUrl.replace(that.anotherAliIp, "/anotherOssUpload");
// #endif
// #ifndef H5
let downloadUrl = that.resultFile;

View File

@ -78,6 +78,7 @@ export default {
fileUrl: configService.fileUrl + 'pixel/',
aliIp: configService.aliUrl,
otherAliIp: configService.otherAliUrl,
anotherAliIp: configService.anotherAliUrl,
//
blackStar: 'work/black-star.png',
//
@ -170,7 +171,8 @@ export default {
getWorkPath(path){
if(!path) return;
let index = path?.indexOf('?');
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
let judge = path?.includes(configService.anotherAliUrl);
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
},
//
linkTo(url){
@ -208,7 +210,7 @@ export default {
//
// let downloadUrl = await path.replace(that.aliIp, "/ossUpload");
let downloadUrl = path;
if(path.includes(that.aliIp)||path.includes(that.otherAliIp)){window.open(downloadUrl);item.loading = false;}
if(path.includes(that.aliIp)||path.includes(that.otherAliIp)||path.includes(that.anotherAliIp)){window.open(downloadUrl);item.loading = false;}
else
uni.request({
url: encodeURI(downloadUrl),

View File

@ -2,7 +2,7 @@
<view class="web-header">
<view class="header-left">
<image class="header-logo" :src="homeFileUrl+logo"></image>
<view class="header-function" v-for="(item,index) in functionList"
<view class="header-function" v-for="(item,index) in functionList" @click="changePage(index)"
:key="index" :class="judgeSelect(item.path)?'function-select':''">
{{ item.name }}
</view>
@ -54,6 +54,10 @@ export default {
isLogin: {
type: String,
default: ''
},
currentPage: {
type: String,
default: 'home'
}
},
components: {
@ -71,14 +75,13 @@ export default {
functionList:[
{
name: '首页',
path: '/pages/pc_web/index/index'
path: 'home'
},
{
name: '工作台',
path: ''
path: 'workshops'
},
],
routePath: this.$route.path,//
//
avatar: 'avatar.png',
//
@ -128,7 +131,7 @@ export default {
methods:{
//
judgeSelect(path){
return this.routePath == path;
return this.currentPage === path;
},
//
init(){
@ -160,6 +163,10 @@ export default {
})
} else if(path) uni.navigateTo({url: path});
},
//
changePage(index){
this.$emit('changePlat',index);
},
//
login(userMessage){
this.userMessage = userMessage;

View File

@ -40,7 +40,7 @@
</el-form>
<view class="ldr-agreement">
<u-checkbox class="ldr-checkbox" active-color="#8fca80" v-model="isAgreed"></u-checkbox>
我已阅读并同意<text>用户服务协议</text><text>隐私权政策</text>
我已阅读并同意<text @click="toAgreement('用户协议')">用户服务协议</text><text @click="toAgreement('隐私协议')">隐私权政策</text>
</view>
</view>
</view>
@ -214,6 +214,10 @@ export default {
finally{
this.dotLoading = false;
}
},
//
toAgreement(type = ''){
if(type) uni.navigateTo({ url: `/pages/index/rich-detail?name=${type}` });
}
},
mounted() {

View File

@ -2,7 +2,7 @@
<view>
<!-- <el-container class="pc-container">
<view class="pc-header">
<Header :isLogin="isLogin" />
<Header :currentPage="refs[current]" :isLogin="isLogin" @changePlat="changePlat" />
</view>
<view style="width: 100%;height: 100rpx;"></view>
<view class="pc-main">
@ -27,11 +27,12 @@
<script>
import Header from './components/header.vue';
import Home from '@/pages/pc_web/home/home.vue';
import Workshops from '@/pages/pc_web/workshops/workshops.vue'
import configService from '@/common/config.service.js';
import { tools } from '@/utils/utils.js';
export default {
components:{
Header, Home
Header, Home, Workshops
},
data(){
return{
@ -41,7 +42,7 @@ export default {
//
current: uni.getStorageSync('pc_current')||0,
// refs
refs: ['home'],
refs: ['home','workshops'],
//
loading: false,
//
@ -64,6 +65,7 @@ export default {
onLoad() {
},
methods:{
//
copyUrl(){
let that = this;
tools.methods.uniCopy({
@ -75,6 +77,11 @@ export default {
that.$refs.uToast.show({type: 'error', title: result});
}
});
},
//
changePlat(current){
this.current = current;
uni.setStorageSync('pc_current', current);
}
}
}