diff --git a/api/base.js b/api/base.js new file mode 100644 index 0000000..da13a1d --- /dev/null +++ b/api/base.js @@ -0,0 +1,6 @@ + +const ENV_URL = 'https://www.xjwljb.com'; + +const BASE_URL = ENV_URL; + +export default BASE_URL; diff --git a/api/base.js b/api/base.js new file mode 100644 index 0000000..da13a1d --- /dev/null +++ b/api/base.js @@ -0,0 +1,6 @@ + +const ENV_URL = 'https://www.xjwljb.com'; + +const BASE_URL = ENV_URL; + +export default BASE_URL; diff --git a/api/tort.js b/api/tort.js new file mode 100644 index 0000000..9c5c6ce --- /dev/null +++ b/api/tort.js @@ -0,0 +1,26 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const CREATE_URL = BASE_URL + '/webserver/reportInfos/weburlChange' +const URL_REPEAT = BASE_URL + '/webserver/reportInfos/websiteUrlRepeat.do' +const UPLOAD_PICTURE = BASE_URL + 'webserver/fileUploadController/uploadToLocal' +const WEB_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' +/** + * 生成网址、网址转换 + * @param {*} // url: '' + */ +export function createUrl(data) { + return fetch.get(CREATE_URL, data).then(res => res); +} + +// 网址重复验证 reportWebsiteUrl: '' +export function websiteUrlRepeat(data) { + return fetch.get(URL_REPEAT, data).then(res => res); +} + +// 网站类型举报 +export function webReport(data) { + return fetch.get(WEB_REPORT, data).then(res => res); +} + + diff --git a/api/base.js b/api/base.js new file mode 100644 index 0000000..da13a1d --- /dev/null +++ b/api/base.js @@ -0,0 +1,6 @@ + +const ENV_URL = 'https://www.xjwljb.com'; + +const BASE_URL = ENV_URL; + +export default BASE_URL; diff --git a/api/tort.js b/api/tort.js new file mode 100644 index 0000000..9c5c6ce --- /dev/null +++ b/api/tort.js @@ -0,0 +1,26 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const CREATE_URL = BASE_URL + '/webserver/reportInfos/weburlChange' +const URL_REPEAT = BASE_URL + '/webserver/reportInfos/websiteUrlRepeat.do' +const UPLOAD_PICTURE = BASE_URL + 'webserver/fileUploadController/uploadToLocal' +const WEB_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' +/** + * 生成网址、网址转换 + * @param {*} // url: '' + */ +export function createUrl(data) { + return fetch.get(CREATE_URL, data).then(res => res); +} + +// 网址重复验证 reportWebsiteUrl: '' +export function websiteUrlRepeat(data) { + return fetch.get(URL_REPEAT, data).then(res => res); +} + +// 网站类型举报 +export function webReport(data) { + return fetch.get(WEB_REPORT, data).then(res => res); +} + + diff --git a/common/fetch.js b/common/fetch.js new file mode 100644 index 0000000..1ed1345 --- /dev/null +++ b/common/fetch.js @@ -0,0 +1,69 @@ +import { useStore } from "vuex"; +// import { getLogin } from "@/utils/auth.js"; + +function fetch(method) { + return function (url, data, otherParams = {}) { + // if (method === 'POST' || method === 'PUT') { + // data = { + // param: data, + // }; + // } + const sessionId = uni.getStorageSync("sessionId"); + //定时器 + return new Promise((resolve, reject) => { + uni.request({ + url, + method, + data, + header: { + token: sessionId, + }, + success(data) { + if (data.statusCode === 200) { + if (data.data.status === 1) { + if(data.data.message === '网址未重复') { + wx.setStorageSync('isRepeat', 'false') + } + resolve(data.data.data); + } else { + if(data.data.message === '网址重复') { + uni.showToast({ + // title: "系统异常,请稍后再试!", + title: `网址重复,请换一个网址`, + icon: "none", + duration: 3000, + }); + wx.setStorageSync('isRepeat', 'true') + } else { + uni.showToast({ + // title: "系统异常,请稍后再试!", + title: `${data.data.message}`, + icon: "none", + duration: 2000, + }); + } + reject(data); + } + } else { + reject(data); + } + }, + fail(err) { + reject(err); + }, + ...otherParams, + }); + }); + }; +} + +export default { + get: fetch("GET"), + post: fetch("POST"), + put: fetch("PUT"), + delete: fetch("DELETE"), + connect: fetch("CONNECT"), + head: fetch("HEAD"), + options: fetch("OPTIONS"), + trace: fetch("TRACE"), +}; diff --git a/api/base.js b/api/base.js new file mode 100644 index 0000000..da13a1d --- /dev/null +++ b/api/base.js @@ -0,0 +1,6 @@ + +const ENV_URL = 'https://www.xjwljb.com'; + +const BASE_URL = ENV_URL; + +export default BASE_URL; diff --git a/api/tort.js b/api/tort.js new file mode 100644 index 0000000..9c5c6ce --- /dev/null +++ b/api/tort.js @@ -0,0 +1,26 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const CREATE_URL = BASE_URL + '/webserver/reportInfos/weburlChange' +const URL_REPEAT = BASE_URL + '/webserver/reportInfos/websiteUrlRepeat.do' +const UPLOAD_PICTURE = BASE_URL + 'webserver/fileUploadController/uploadToLocal' +const WEB_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' +/** + * 生成网址、网址转换 + * @param {*} // url: '' + */ +export function createUrl(data) { + return fetch.get(CREATE_URL, data).then(res => res); +} + +// 网址重复验证 reportWebsiteUrl: '' +export function websiteUrlRepeat(data) { + return fetch.get(URL_REPEAT, data).then(res => res); +} + +// 网站类型举报 +export function webReport(data) { + return fetch.get(WEB_REPORT, data).then(res => res); +} + + diff --git a/common/fetch.js b/common/fetch.js new file mode 100644 index 0000000..1ed1345 --- /dev/null +++ b/common/fetch.js @@ -0,0 +1,69 @@ +import { useStore } from "vuex"; +// import { getLogin } from "@/utils/auth.js"; + +function fetch(method) { + return function (url, data, otherParams = {}) { + // if (method === 'POST' || method === 'PUT') { + // data = { + // param: data, + // }; + // } + const sessionId = uni.getStorageSync("sessionId"); + //定时器 + return new Promise((resolve, reject) => { + uni.request({ + url, + method, + data, + header: { + token: sessionId, + }, + success(data) { + if (data.statusCode === 200) { + if (data.data.status === 1) { + if(data.data.message === '网址未重复') { + wx.setStorageSync('isRepeat', 'false') + } + resolve(data.data.data); + } else { + if(data.data.message === '网址重复') { + uni.showToast({ + // title: "系统异常,请稍后再试!", + title: `网址重复,请换一个网址`, + icon: "none", + duration: 3000, + }); + wx.setStorageSync('isRepeat', 'true') + } else { + uni.showToast({ + // title: "系统异常,请稍后再试!", + title: `${data.data.message}`, + icon: "none", + duration: 2000, + }); + } + reject(data); + } + } else { + reject(data); + } + }, + fail(err) { + reject(err); + }, + ...otherParams, + }); + }); + }; +} + +export default { + get: fetch("GET"), + post: fetch("POST"), + put: fetch("PUT"), + delete: fetch("DELETE"), + connect: fetch("CONNECT"), + head: fetch("HEAD"), + options: fetch("OPTIONS"), + trace: fetch("TRACE"), +}; diff --git a/packageA/accountInfo/accountInfo.vue b/packageA/accountInfo/accountInfo.vue index 9d073dc..bfda7ba 100644 --- a/packageA/accountInfo/accountInfo.vue +++ b/packageA/accountInfo/accountInfo.vue @@ -30,7 +30,7 @@ id: 'username', name: '用户名:', value: '', - icon: '../../static/index/back.png' + icon: 'http://111.198.10.15:11604/png/back.png' }, { id: 'name', diff --git a/api/base.js b/api/base.js new file mode 100644 index 0000000..da13a1d --- /dev/null +++ b/api/base.js @@ -0,0 +1,6 @@ + +const ENV_URL = 'https://www.xjwljb.com'; + +const BASE_URL = ENV_URL; + +export default BASE_URL; diff --git a/api/tort.js b/api/tort.js new file mode 100644 index 0000000..9c5c6ce --- /dev/null +++ b/api/tort.js @@ -0,0 +1,26 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const CREATE_URL = BASE_URL + '/webserver/reportInfos/weburlChange' +const URL_REPEAT = BASE_URL + '/webserver/reportInfos/websiteUrlRepeat.do' +const UPLOAD_PICTURE = BASE_URL + 'webserver/fileUploadController/uploadToLocal' +const WEB_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' +/** + * 生成网址、网址转换 + * @param {*} // url: '' + */ +export function createUrl(data) { + return fetch.get(CREATE_URL, data).then(res => res); +} + +// 网址重复验证 reportWebsiteUrl: '' +export function websiteUrlRepeat(data) { + return fetch.get(URL_REPEAT, data).then(res => res); +} + +// 网站类型举报 +export function webReport(data) { + return fetch.get(WEB_REPORT, data).then(res => res); +} + + diff --git a/common/fetch.js b/common/fetch.js new file mode 100644 index 0000000..1ed1345 --- /dev/null +++ b/common/fetch.js @@ -0,0 +1,69 @@ +import { useStore } from "vuex"; +// import { getLogin } from "@/utils/auth.js"; + +function fetch(method) { + return function (url, data, otherParams = {}) { + // if (method === 'POST' || method === 'PUT') { + // data = { + // param: data, + // }; + // } + const sessionId = uni.getStorageSync("sessionId"); + //定时器 + return new Promise((resolve, reject) => { + uni.request({ + url, + method, + data, + header: { + token: sessionId, + }, + success(data) { + if (data.statusCode === 200) { + if (data.data.status === 1) { + if(data.data.message === '网址未重复') { + wx.setStorageSync('isRepeat', 'false') + } + resolve(data.data.data); + } else { + if(data.data.message === '网址重复') { + uni.showToast({ + // title: "系统异常,请稍后再试!", + title: `网址重复,请换一个网址`, + icon: "none", + duration: 3000, + }); + wx.setStorageSync('isRepeat', 'true') + } else { + uni.showToast({ + // title: "系统异常,请稍后再试!", + title: `${data.data.message}`, + icon: "none", + duration: 2000, + }); + } + reject(data); + } + } else { + reject(data); + } + }, + fail(err) { + reject(err); + }, + ...otherParams, + }); + }); + }; +} + +export default { + get: fetch("GET"), + post: fetch("POST"), + put: fetch("PUT"), + delete: fetch("DELETE"), + connect: fetch("CONNECT"), + head: fetch("HEAD"), + options: fetch("OPTIONS"), + trace: fetch("TRACE"), +}; diff --git a/packageA/accountInfo/accountInfo.vue b/packageA/accountInfo/accountInfo.vue index 9d073dc..bfda7ba 100644 --- a/packageA/accountInfo/accountInfo.vue +++ b/packageA/accountInfo/accountInfo.vue @@ -30,7 +30,7 @@ id: 'username', name: '用户名:', value: '', - icon: '../../static/index/back.png' + icon: 'http://111.198.10.15:11604/png/back.png' }, { id: 'name', diff --git a/packageA/egersis/egersis.vue b/packageA/egersis/egersis.vue index 03dbef6..718639b 100644 --- a/packageA/egersis/egersis.vue +++ b/packageA/egersis/egersis.vue @@ -1,6 +1,6 @@