Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-ui
commit
95d0d4032f
|
@ -411,3 +411,8 @@ export const getChildRegion = (id) => {
|
||||||
export const resetPassword = (params) => {
|
export const resetPassword = (params) => {
|
||||||
return postRequest(`/user/resetPassword/${params}"`);
|
return postRequest(`/user/resetPassword/${params}"`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 初始化商品索引
|
||||||
|
export const createIndex = () => {
|
||||||
|
return getRequest(`/elasticsearch`);
|
||||||
|
};
|
||||||
|
|
|
@ -55,14 +55,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="label-btns">
|
<div class="label-btns">
|
||||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||||
|
<Button type="primary" style="margin-left: 100px" @click="createIndex()">重新生成所有商品索引</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { setSetting } from "@/api/index";
|
import { setSetting,createIndex } from "@/api/index";
|
||||||
import { handleSubmit } from "./validate";
|
import { handleSubmit } from "./validate";
|
||||||
export default {
|
export default {
|
||||||
props: ["res", "type"],
|
props: ["res", "type"],
|
||||||
|
@ -90,13 +90,23 @@ export default {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//保存
|
||||||
submit(name) {
|
submit(name) {
|
||||||
let that = this;
|
let that = this;
|
||||||
if( handleSubmit(that, name )){
|
if( handleSubmit(that, name )){
|
||||||
this.setupSetting()
|
this.setupSetting()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//重新生成所有商品索引
|
||||||
|
createIndex(){
|
||||||
|
createIndex().then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("开始生成!");
|
||||||
|
} else {
|
||||||
|
this.$Message.error("服务器异常!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
setupSetting() {
|
setupSetting() {
|
||||||
setSetting(this.type, this.formValidate).then((res) => {
|
setSetting(this.type, this.formValidate).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
Loading…
Reference in New Issue