123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- import { axios } from "@/configue/http";
- // 获取内容列表
- export function getList(type, data, cb) {
- let params = {
- ...data,
- startTime: data.date ? data.date[0] + " 00:00:00" : "",
- endTime: data.date ? data.date[1] + " 23:59:59" : "",
- };
- axios({
- method: "post",
- data: params,
- url: `cms/${type}/list`,
- }).then((res) => {
- cb(res);
- });
- }
- // 获取系统设置列表
- export function getSysList(type, data, cb) {
- let tmp = {}
- if (data.date) {
- tmp = {
- startTime: data.date ? data.date[0] + " 00:00:00" : "",
- endTime: data.date ? data.date[1] + " 23:59:59" : "",
- }
- }
- let params = {
- ...data,
- ...tmp
- };
- axios({
- method: "post",
- data: params,
- url: `sys/${type}/list`,
- }).then((res) => {
- cb(res);
- });
- }
- // 获取用户设置的权限列表
- export function getRoleList(cb) {
- axios({
- method: "get",
- url: `sys/user/getRole`,
- }).then((res) => {
- cb(res);
- });
- }
- // 保存
- export function saveSys(type, data, cb) {
- let params = {
- ...data,
- };
- axios({
- method: "post",
- data: params,
- url: `sys/${type}/save`,
- }).then((res) => {
- cb(res);
- });
- }
- // 保存
- export function save(type, data, cb) {
- let params = {
- ...data,
- };
- axios({
- method: "post",
- data: params,
- url: `cms/${type}/save`,
- }).then((res) => {
- cb(res);
- });
- }
- //删除
- export function del(type, data, cb) {
- axios({
- method: "get",
- url: `cms/${type}/remove/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
- //获取cms详情
- export function getDetail(type, data, cb) {
- axios({
- method: "get",
- url: `cms/${type}/detail/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
- //获取sys详情
- export function getSysDetail(type, data, cb) {
- axios({
- method: "get",
- url: `sys/${type}/detail/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
- //设置图片封面
- export function setCover(data, cb) {
- axios({
- method: "get",
- url: `cms/goods/setIndex/${data.fileId}`,
- }).then((res) => {
- cb(res);
- });
- }
- //删除图库图片
- export function delImg(data, cb) {
- axios({
- method: "get",
- url: `cms/goods/remove/file/${data.fileId}`,
- }).then((res) => {
- cb(res);
- });
- }
- //更新图库图片
- export function refreshImg(data, cb) {
- axios({
- method: "get",
- url: `cms/goods/afresh/uploadImg/${data.fileId}/${data.code}`,
- }).then((res) => {
- cb(res);
- });
- }
- //提审
- export function apply(type,data, cb) {
- axios({
- method: "get",
- url: `cms/${type}/apply/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
- // 审核
- export function audit(type, data, cb) {
- let params = {
- ...data
- };
- axios({
- method: "post",
- data: params,
- url: `cms/${type}/audit`,
- }).then((res) => {
- cb(res);
- });
- }
- //审核详情
- export function applyDetail(type,data, cb) {
- axios({
- method: "get",
- url: `cms/${type}/auditDetail/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
- // 是否显示
- export function handleDisplay(type, data, cb) {
- axios({
- method: "get",
- url: `cms/${type}/display/${data.id}/${data.display}`,
- }).then((res) => {
- cb(res);
- });
- }
- // 是否启用
- export function handleDisable(type, data, cb) {
- axios({
- method: "get",
- url: `sys/${type}/editStatus/${data.id}/${data.isEnabled}`,
- }).then((res) => {
- cb(res);
- });
- }
- // 新建修改问题
- export function saveQuestion(data, cb) {
- axios({
- method: "post",
- data: {
- answer:data
- },
- url: `cms/questionGroup/questionAnswer/save`,
- }).then((res) => {
- cb(res);
- });
- }
- // 修改问题
- export function updateQuestion( data, cb) {
- let params = {
- ...data
- };
- axios({
- method: "post",
- data: params,
- url: `cms/questionGroup/questionAnswer/update`,
- }).then((res) => {
- cb(res);
- });
- }
- //删除问题
- export function delQuestion(data, cb) {
- axios({
- method: "get",
- url: `cms/questionGroup/remove/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
- //删除场景
- export function delscene(data, cb) {
- axios({
- method: "get",
- url: `cms/scene/removes/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
- //删除(sys)
- export function delSys(type, data, cb) {
- axios({
- method: "get",
- url: `sys/${type}/removes/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
- //删除(sys)
- export function delSysSingle(type, data, cb) {
- axios({
- method: "get",
- url: `sys/${type}/remove/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
- //修改密码
- export function updatePwd(data, cb) {
- axios({
- method: "post",
- data,
- url: `sys/user/updatePwd`,
- }).then((res) => {
- cb(res);
- });
- }
- //重置密码
- export function resetPass(data, cb) {
- axios({
- method: "get",
- url: `sys/user/resetPass/${data.id}`,
- }).then((res) => {
- cb(res);
- });
- }
|