Commit 2a38011e authored by yuwenwen's avatar yuwenwen

修改BUG,修改打包配置

parent f153f60a
......@@ -5,4 +5,4 @@ VUE_APP_TITLE = 一站式高校轻享平台
ENV = 'production'
# 若依管理系统/生产环境
VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = '/bbs/prod-api'
......@@ -177,6 +177,7 @@ Router.prototype.replace = function push(location) {
}
export default new Router({
base:'/bbs/pc',
mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
......
<template>
<div class="app-container home">
<div class="app-home">
<p>欢迎使用一站式高校轻享平台</p>
<img src="@/assets/images/index-img.png" />
</div>
</div>
</template>
......@@ -23,64 +27,15 @@ export default {
<style scoped lang="scss">
.home {
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eee;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eee;
}
.col-item {
margin-bottom: 20px;
}
ul {
padding: 0;
margin: 0;
}
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
color: #676a6c;
overflow-x: hidden;
ul {
list-style-type: none;
}
h4 {
margin-top: 0px;
}
h2 {
margin-top: 10px;
font-size: 26px;
font-weight: 100;
}
transform: translateY(25%);
}
.app-home {
margin: auto;
text-align: center;
p {
margin-top: 10px;
b {
font-weight: 700;
}
}
.update-log {
ol {
display: block;
list-style-type: decimal;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0;
margin-inline-end: 0;
padding-inline-start: 40px;
}
margin-bottom: 0px;
font-size: 46px;
color: #eeeeee;
}
}
</style>
......
......@@ -56,7 +56,7 @@
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>
<span>Copyright © 2019-2025 江西唐果科技有限公司 All Rights Reserved.</span>
</div>
</div>
</template>
......@@ -72,8 +72,8 @@ export default {
return {
codeUrl: "",
loginForm: {
username: "admin",
password: "admin123",
username: "",
password: "",
rememberMe: false,
code: "",
uuid: ""
......
......@@ -24,6 +24,9 @@
<el-table-column label="动态内容" prop="content" align="center">
<template #default="{ row }">
<div v-html="formatContent(row.content)" class="content-container"></div>
<div v-if="row.type == 'IMAGE' && row.attachments && row.attachments.length > 0">
<el-image v-for="(img,idx) in row.attachments" :key="idx" :src="img.url"></el-image>
</div>
</template>
</el-table-column>
<el-table-column label="话题" align="center" prop="topicNames" width="240"></el-table-column>
......
......@@ -23,7 +23,7 @@
<el-table-column label="会员等级" prop="gradeName" align="center"></el-table-column>
<el-table-column label="累计积分" prop="accumulatedPoints" align="center"></el-table-column>
<el-table-column label="可用积分" prop="currentPoints" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<el-table-column label="操作" align="center" width="200">
<template #default="{ row }">
<el-button type="text" @click="handleAddPoints(row)">增加</el-button>
<el-button type="text" @click="handleDecreasePoints(row)">扣减</el-button>
......
......@@ -61,7 +61,7 @@
</el-form>
<!-- 底部 -->
<div class="el-register-footer">
<span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>
<span>Copyright © 2019-2025 江西唐果科技有限公司 All Rights Reserved.</span>
</div>
</div>
</template>
......
......@@ -11,12 +11,9 @@
</el-form-item>
</el-form>
<el-row class="mb10">
<el-col :span="2">
<el-button type="primary" @click="handleAdd">新增敏感词</el-button>
</el-col>
<el-col :span="2">
<el-button type="primary" plain @click="handleImport">批量导入敏感词</el-button>
</el-col>
<el-button type="primary" @click="handleAdd">新增敏感词</el-button>
<el-button type="primary" plain @click="handleImport">批量导入敏感词</el-button>
</el-row>
<el-table :data="tableList">
<el-table-column label="序号" width="55" type="index" align="center"></el-table-column>
......
<template>
<el-dialog :visible.sync="visible" v-if="visible" :title="dialogTitle" width="28%" class="dialog"
@close="handleClose" >
@close="handleClose" :close-on-click-modal="false">
<el-form :model="form" ref="formRef" :rules="rules" label-position="top">
<el-form-item label="等级名称" prop="name">
<el-input placeholder="请输入" v-model="form.name"></el-input>
......
......@@ -18,7 +18,7 @@ module.exports = {
// 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
publicPath: process.env.NODE_ENV === "production" ? "/bbs/pc" : "/",
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
......
......@@ -203,6 +203,7 @@
// 从本地相册选择图片或使用相机拍照
uni.chooseImage({
count: _this.limiData,
sourceType: ['album'],
success(res) {
const tempFilePaths = JSON.parse(JSON.stringify(res.tempFilePaths));
if (tempFilePaths.length <= _this.limiData) {
......
......@@ -9,7 +9,7 @@ const CONFIG = {
production: {
debug: false,
platformName: '一站式轻享',
requestUrl: '/prod-api',
requestUrl: '/bbs/prod-api',
}
}
......
......@@ -72,7 +72,7 @@
"h5" : {
"router" : {
"mode" : "history",
"base" : "/h5/"
"base" : "/bbs/h5/"
}
}
}
......@@ -18,7 +18,8 @@
"path" : "pages/topics/topics",
"style" :
{
"navigationBarTitleText" : "话题"
"navigationBarTitleText" : "话题",
"enablePullDownRefresh": true
}
},
{
......@@ -46,7 +47,8 @@
"path" : "pages/topic-detail/topic-detail",
"style" :
{
"navigationBarTitleText" : "话题详情"
"navigationBarTitleText" : "话题详情",
"enablePullDownRefresh": true
}
},
{
......
......@@ -16,7 +16,7 @@
</scroll-view>
<!-- 发布按钮 -->
<movable-area class="movable-area">
<movable-view class="add-dynamic-box move-button" :x="area.x" :y="area.y" direction="all" @change="onChange"
<movable-view class="add-dynamic-box move-button" :x="area.x+'rpx'" :y="area.y + 'rpx'" direction="all" @change="onChange"
damping="30" @click="toPublishPage">
<image class="icon" src="/static/images/publish-icon.png"></image>
</movable-view>
......@@ -41,8 +41,8 @@
},
total: 0,
area: {
x: 330,
y: 600
x: 620,
y: 1060
},
emotions
}
......@@ -128,11 +128,8 @@
.move-button {
pointer-events: auto;
display: flex;
justify-content: center;
align-items: center;
pointer-events: auto;
border-radius: 50%;
}
}
......
......@@ -11,7 +11,8 @@
import {
setToken,
getRedirectPath,
setRedirectPath
setRedirectPath,
removeToken
} from '@/utils/auth';
import {
getParams
......@@ -26,27 +27,9 @@
}
},
onLoad(options) {
let {code,targetPath,token} = options;
const params = new URLSearchParams(window.location.search);
setRedirectPath(window.location.href)
if (targetPath && targetPath != 'undefined') {
this.stateParams = params.get('targetPath')
this.queryParams = params
} else {
this.stateParams = ''
}
if (token && token != 'undefined') {
setToken(token)
this.$store.dispatch('GetInfo')
this.pageRedirect()
} else {
this.code = code;
if (code) {
this.loginIn();
} else {
this.getRedirectUrl()
}
}
let {code} = options;
this.code = code;
this.loginIn();
},
methods: {
......@@ -56,46 +39,55 @@
}
login(params).then(res => {
if (res.code == 200 && res.data) {
setToken(res.data.token)
setToken(res.data)
this.$store.dispatch('GetInfo')
this.pageRedirect()
} else {
this.errInfo = res.msg
uni.switchTab({
url: '/pages/index/index'
})
}
if(res.code == 200 && !res.data){
uni.switchTab({
url: '/pages/index/index'
})
}
if(res.code == 401){
// removeToken()
window.location = res.data
}
})
},
// 获取回调地址
getRedirectUrl() {
// let params = {
// path: getRedirectPath() || ''
// }
// getUrl(params).then(res => {
// console.log(res)
// if (res.code == 200 && res.data) {
// window.location = res.data
// }
// })
window.location = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww63ca87d5f8647514&redirect_uri=https%3A%2F%2Ftest.tangguo.ren/h5/pages/login/login/&response_type=code&scope=snsapi_base#wechat_redirect'
},
// getRedirectUrl() {
// // let params = {
// // path: getRedirectPath() || ''
// // }
// // getUrl(params).then(res => {
// // console.log(res)
// // if (res.code == 200 && res.data) {
// // window.location = res.data
// // }
// // })
// window.location = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd2a84aa7529d3801&redirect_uri=https%3A%2F%2Fwecom.jift.edu.cn%2Fbbs%2Fh5%2Fpages%2Flogin%2Flogin%2F&response_type=code&scope=snsapi_base&state=#wechat_redirect'
// },
// 页面跳转
pageRedirect(){
if (this.stateParams) {
const businessParams = new URLSearchParams();
this.queryParams.forEach((value, key) => {
if (key !== 'code' && key !== 'targetPath') {
businessParams.append(key, value);
}
});
uni.redirectTo({
url: `${this.stateParams}?${businessParams.toString()}`
})
} else {
uni.switchTab({
url: '/pages/index/index'
})
}
}
// pageRedirect(){
// if (this.stateParams) {
// const businessParams = new URLSearchParams();
// this.queryParams.forEach((value, key) => {
// if (key !== 'code' && key !== 'targetPath') {
// businessParams.append(key, value);
// }
// });
// uni.redirectTo({
// url: `${this.stateParams}?${businessParams.toString()}`
// })
// } else {
// uni.switchTab({
// url: '/pages/index/index'
// })
// }
// }
}
}
</script>
......
......@@ -39,11 +39,11 @@
<view class="pk-type-box">
<radio-group v-model="form.voteOptionType" @change="radioChange">
<label class="radio" style="margin-right: 40rpx;">
<radio value="IMAGE" :checked="form.voteOptionType=='IMAGE'" />图片PK
</label>
<label class="radio">
<radio value="TEXT" :checked="form.voteOptionType=='TEXT'" />文字PK
</label>
<label class="radio" >
<radio value="IMAGE" :checked="form.voteOptionType=='IMAGE'" />图片PK
</label>
</radio-group>
<view class="choice-box" v-if="form.voteOptionType=='IMAGE'">
......
......@@ -12,7 +12,7 @@
<scroll-view class="scroll-view-topic" scroll-y :show-scrollbar="false" v-if="list.length>0"
@scrolltolower="loadMore">
<template v-for="(item,index) in list">
<dynamic-item :form="item"></dynamic-item>
<dynamic-item :form="item" @refresh="handleRefresh"></dynamic-item>
</template>
</scroll-view>
<scroll-view class="scroll-view-topic" scroll-y :show-scrollbar="false" v-else>
......@@ -61,6 +61,12 @@
this.getDetail()
}
},
onPullDownRefresh() {
this.refreshContentList()
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1000)
},
methods: {
getDetail() {
uni.showLoading({
......@@ -78,10 +84,21 @@
url: `/pages/publish/publish?topicId=${this.queryParams.topicId}&topicName=${this.topicName}`
})
},
handleRefresh(){
this.list = [];
this.queryParams.pageNum = 1;
this.getDetail();
},
// 下拉刷新
refreshContentList() {
this.list = [];
this.queryParams.pageNum = 1;
this.getDetail();
},
loadMore() {
if (this.list.length < this.total) {
this.queryParams.pageNum += 1;
this.getList()
this.getDetail()
}
},
}
......@@ -93,10 +110,11 @@
.topic-detail-page {
background-color: white;
overflow: hidden;
overflow: hidden;
.topic-box {
padding: 32rpx 34rpx 2rpx 32rpx;
.topic-container {
width: 92vw;
height: 180rpx;
......@@ -139,7 +157,7 @@ overflow: hidden;
.publisb-box {
height: 124rpx;
background-color: rgba(244, 244, 244, 1);
display: flex;
justify-content: center;
align-items: center;
......
......@@ -45,6 +45,12 @@
onShow() {
this.getList()
},
onPullDownRefresh() {
this.refreshContentList()
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1000)
},
methods: {
// 话题热搜榜
getList() {
......@@ -56,6 +62,11 @@
this.hotList = res.data
})
},
// 下拉刷新
refreshContentList() {
this.hotList = [];
this.getList();
},
topTopicDetailPage(item) {
uni.navigateTo({
url: '/pages/topic-detail/topic-detail?topicId=' + item.id + '&topicName=' + item.name
......
......@@ -302,7 +302,7 @@
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.3);
z-index: 990;
z-index: 999;
position:fixed;
top:0;
left:0;
......
import config from '@/config/index.config.js';
import {getToken,setRedirectPath} from '@/utils/auth';
import {getToken,removeToken,setRedirectPath} from '@/utils/auth';
import errorCode from '@/utils/errorCode';
import {toast,showConfirm,tansParams} from '@/utils/common'
import store from '@/store';
......@@ -43,17 +43,8 @@ const request = config => {
const code = data.code || 200
const msg = errorCode[code] || data.msg || errorCode['default']
if (code === 401) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
store.dispatch('LogOut').then(res => {
uni.reLaunch({
url: '/pages/login/login'
})
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
removeToken()
resolve(data)
} else if (code === 500) {
toast(msg)
reject('500')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment