Change Memo Url

This commit is contained in:
sylor_huang@126.com 2020-10-13 14:39:22 +08:00
parent 6d8834403a
commit 79c943d31b
13 changed files with 27 additions and 27 deletions

View File

@ -59,7 +59,7 @@ export function initAxiosInterceptors(props) {
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
var
proxy = "http://localhost:3000"
proxy = "https://testforgeplus.trustie.net"
// proxy = "https://testforgeplus.trustie.net"
const requestMap = {};
window.setfalseInRequestMap = function (keyName) {

View File

@ -30,7 +30,7 @@ export default (({ content , operation ,plateId }) => {
setVisible(false);
//
if(editWord){
const url = `/v1/forum_sections/${plateId}/edit_notice.json`;
const url = `/forum_sections/${plateId}/edit_notice.json`;
axios.post(url,{
content:editWord
}).then(result=>{

View File

@ -16,7 +16,7 @@ export default ({ id , permission , calbackFunc , confirm }) => {
//
function changeSticky(s){
let sticky = s ? 0 : 1;//10
const url = `/v1/memos/${id}/set-top-or-down.json`;
const url = `/memos/${id}/set-top-or-down.json`;
axios.get(url,{
params:{
sticky
@ -31,7 +31,7 @@ export default ({ id , permission , calbackFunc , confirm }) => {
//
function changeFine(f){
let is_fine = f ? 0 : 1;//10
const url = `/v1/memos/${id}/is_fine.json`;
const url = `/memos/${id}/is_fine.json`;
axios.post(url,{
is_fine
}).then(result=>{
@ -45,7 +45,7 @@ export default ({ id , permission , calbackFunc , confirm }) => {
//
function changeMemoWatched(m){
let is_watch = m ? 0 : 1;//10
const url = `/v1/memos/${id}/watch_memo.json`;
const url = `/memos/${id}/watch_memo.json`;
axios.post(url,{
is_watch
}).then(result=>{
@ -60,8 +60,8 @@ export default ({ id , permission , calbackFunc , confirm }) => {
confirm && confirm({
content: '确认删除帖子?',
onOk:()=>{
const url = `/v1/memos/${id}/destroy.json`;
axios.post(url).then(result=>{
const url = `/memos/${id}.json`;
axios.delete(url).then(result=>{
if(result){
notification.open({message:"提示",description:result.data.message});
calbackFunc && calbackFunc();
@ -78,7 +78,7 @@ export default ({ id , permission , calbackFunc , confirm }) => {
confirm && confirm({
content: '确认申请删帖?',
onOk:()=>{
const url = `/v1/memos/${id}/confirm_delete.json`;
const url = `/memos/${id}/confirm_delete.json`;
axios.post(url,{
is_apply
}).then(result=>{

View File

@ -13,7 +13,7 @@ export default ({ isPrised, num, memo_id, container_type, current_login }) => {
function priseForums() {
if (current_login) {
axios
.post(`/v1/discusses/${memo_id}/plus.json`, {
.post(`/memos/${memo_id}/plus.json`, {
container_type: container_type,
id: memo_id,
type: flag ? 0 : 1,

View File

@ -65,7 +65,7 @@ export default ({ headData, title , operation , history }) => {
//
function saveForum(id){
if(id){
const url = `/v1/memos/forum_memos/${id}/is_watch.json`;
const url = `/memos/forum_memos/${id}/is_watch.json`;
axios.post(url,{
is_watch:watched?0:1
}).then(result=>{

View File

@ -44,7 +44,7 @@ function aa(props) {
async function init() {
setListSpin(true);
let url = `/v1/memos.json`;
let url = `/memos.json`;
axios
.get(url, {
params: { page, search, sort , limit:PAGESIZE },
@ -66,7 +66,7 @@ function aa(props) {
useEffect(() => {
async function init() {
let url = `/v1/forum_sections.json`;
let url = `/forum_sections.json`;
axios
.get(url, {
params: { is_detail: true },

View File

@ -47,7 +47,7 @@ function memo_show(props) {
async function init() {
setSpinType(true);
let url = `/v1/memos/${memo_id}.json`;
let url = `/memos/${memo_id}.json`;
axios
.get(url)
.then((result) => {
@ -79,7 +79,7 @@ function memo_show(props) {
}
function related_memos() {
let url = `/v1/memos/${memo_id}/related_memos.json`;
let url = `/memos/${memo_id}/related_memos.json`;
axios
.get(url)
.then((result) => {

View File

@ -50,7 +50,7 @@ function New(props, ref) {
function getDetail(plate){
if(forumId){
const url = `/v1/memos/${forumId}/edit.json`;
const url = `/memos/${forumId}/edit.json`;
axios.get(url).then(result=>{
if(result){
setContent(result.data.content);
@ -90,7 +90,7 @@ function New(props, ref) {
function getPlate() {
setSpining(true);
const url = `/v1/forum_sections.json`;
const url = `/forum_sections.json`;
axios.get(url)
.then((result) => {
if (result && result.data) {
@ -183,7 +183,7 @@ function New(props, ref) {
}
if(forumId){
//
const url = `/v1/memos/${forumId}/update.json`;
const url = `/memos/${forumId}/update.json`;
axios.post(url, params).then((result) => {
if (result && result.data) {
notification.open({
@ -202,7 +202,7 @@ function New(props, ref) {
});
}else{
//
const url = `/v1/memos/create.json`;
const url = `/memos.json`;
axios.post(url, params).then((result) => {
if (result && result.data) {
notification.open({

View File

@ -37,7 +37,7 @@ function theme(props) {
async function InitList() {
setListSpin(true);
const url = `/v1/memos/forum_memos/${plateMainId}.json`;
const url = `/memos/forum_memos/${plateMainId}.json`;
axios.get(url, {
params: {
page, search, sort, select_type: menuKey
@ -56,7 +56,7 @@ function theme(props) {
useEffect(()=>{
async function getTopInfo(){
const url = `/v1/memos/forum_memos_head/${plateMainId}.json`;
const url = `/memos/forum_memos_head/${plateMainId}.json`;
axios.get(url).then(result=>{
if(result && result.data){
setBreadCrumb(result.data.bread_crumb.forum_tag);

View File

@ -11,7 +11,7 @@ export default (({ plateId , operation })=> {
useEffect(()=>{
async function Init(){
const url = `/v1/memos/forum_memos_right/${plateId}.json`;
const url = `/memos/forum_memos_right/${plateId}.json`;
axios.get(url).then(result=>{
if(result){
setContent({notice:result.data.notice,login:result.data.user_login,name:result.data.username});

View File

@ -45,7 +45,7 @@ function comment_list({
const praise_reply = (id) => {
if (current_login) {
axios
.post(`/v1/discusses/${id}/plus.json`, {
.post(`/memos/${id}/plus.json`, {
container_type: "Memo",
id: id,
type: is_praise ? 0 : 1,
@ -65,9 +65,9 @@ function comment_list({
function deleteorder(id) {
setDeleteSpin(true);
let url = `/v1/memos/${id}/destroy.json`;
let url = `/memos/${id}.json`;
axios
.post(url)
.delete(url)
.then((result) => {
if (result) {
if (result.data.status === 0) {
@ -109,7 +109,7 @@ function comment_list({
setChangePage(new_page);
}
setIsSpin(true);
let url = `/v1/${target_type}/${id}/more_reply.json`;
let url = `/${target_type}/${id}/more_reply.json`;
axios
.get(url, {
params: { page: new_page, limit },

View File

@ -27,7 +27,7 @@ function comments({
useEffect(() => {
async function init() {
setIsSpin(true);
let url = `/v1/${target_type}/${target_id}/more_reply.json`;
let url = `/${target_type}/${target_id}/more_reply.json`;
axios
.get(url, {
params: { page, limit },

View File

@ -13,7 +13,7 @@ function new_comment({ memo_id, user_image, click_button, new_reply }) {
function add_reply() {
setJournalSpin(true);
let url = `/v1/memos/${memo_id}/reply.json`;
let url = `/memos/${memo_id}/reply.json`;
axios
.post(url, {parent_id: memo_id, content: content})
.then((result) => {